Search in sources :

Example 6 with ToolTipFigure

use of com.archimatetool.editor.diagram.figures.ToolTipFigure in project archi by archimatetool.

the class AbstractArchimateConnectionFigure method getToolTip.

@Override
public IFigure getToolTip() {
    ToolTipFigure toolTipFigure = (ToolTipFigure) super.getToolTip();
    if (toolTipFigure == null) {
        return null;
    }
    IArchimateRelationship relation = getModelConnection().getArchimateRelationship();
    String text = ArchiLabelProvider.INSTANCE.getLabel(relation);
    toolTipFigure.setText(text);
    String type = ArchiLabelProvider.INSTANCE.getDefaultName(relation.eClass());
    // $NON-NLS-1$
    toolTipFigure.setType(Messages.AbstractArchimateConnectionFigure_0 + " " + type);
    String rubric = ArchiLabelProvider.INSTANCE.getRelationshipSentence(relation);
    toolTipFigure.setRubric(rubric);
    return toolTipFigure;
}
Also used : ToolTipFigure(com.archimatetool.editor.diagram.figures.ToolTipFigure) IArchimateRelationship(com.archimatetool.model.IArchimateRelationship)

Example 7 with ToolTipFigure

use of com.archimatetool.editor.diagram.figures.ToolTipFigure in project archi by archimatetool.

the class AccessConnectionFigure method getToolTip.

@Override
public IFigure getToolTip() {
    ToolTipFigure tooltip = (ToolTipFigure) super.getToolTip();
    if (tooltip == null) {
        return null;
    }
    // Show access type in tooltip
    IAccessRelationship relation = (IAccessRelationship) getModelConnection().getArchimateRelationship();
    String type = ArchiLabelProvider.INSTANCE.getDefaultName(relation.eClass());
    switch(relation.getAccessType()) {
        case IAccessRelationship.WRITE_ACCESS:
            // $NON-NLS-1$
            type += " " + Messages.AccessConnectionFigure_0;
            break;
        case IAccessRelationship.READ_ACCESS:
            // $NON-NLS-1$
            type += " " + Messages.AccessConnectionFigure_1;
            break;
        case IAccessRelationship.UNSPECIFIED_ACCESS:
            // $NON-NLS-1$
            type += " " + Messages.AccessConnectionFigure_2;
            break;
        case IAccessRelationship.READ_WRITE_ACCESS:
            // $NON-NLS-1$
            type += " " + Messages.AccessConnectionFigure_3;
            break;
        default:
            break;
    }
    // $NON-NLS-1$
    tooltip.setType(Messages.AccessConnectionFigure_4 + " " + type);
    return tooltip;
}
Also used : ToolTipFigure(com.archimatetool.editor.diagram.figures.ToolTipFigure) IAccessRelationship(com.archimatetool.model.IAccessRelationship)

Aggregations

ToolTipFigure (com.archimatetool.editor.diagram.figures.ToolTipFigure)7 IArchimateRelationship (com.archimatetool.model.IArchimateRelationship)2 IAccessRelationship (com.archimatetool.model.IAccessRelationship)1 IArchimateConcept (com.archimatetool.model.IArchimateConcept)1