Search in sources :

Example 6 with IAccessRelationship

use of com.archimatetool.model.IAccessRelationship in project archi by archimatetool.

the class AccessConnectionFigure method refreshVisuals.

@Override
public void refreshVisuals() {
    // Access type
    IAccessRelationship relation = (IAccessRelationship) getModelConnection().getArchimateRelationship();
    switch(relation.getAccessType()) {
        case IAccessRelationship.WRITE_ACCESS:
        default:
            setSourceDecoration(null);
            // arrow at target endpoint
            setTargetDecoration(fDecoratorTarget);
            break;
        case IAccessRelationship.READ_ACCESS:
            // arrow at source endpoint
            setSourceDecoration(fDecoratorSource);
            setTargetDecoration(null);
            break;
        case IAccessRelationship.UNSPECIFIED_ACCESS:
            // no arrows
            setSourceDecoration(null);
            setTargetDecoration(null);
            break;
        case IAccessRelationship.READ_WRITE_ACCESS:
            // both arrows
            setSourceDecoration(fDecoratorSource);
            setTargetDecoration(fDecoratorTarget);
            break;
    }
    // This last
    super.refreshVisuals();
}
Also used : IAccessRelationship(com.archimatetool.model.IAccessRelationship)

Example 7 with IAccessRelationship

use of com.archimatetool.model.IAccessRelationship in project archi by archimatetool.

the class DiagramModelArchimateConnectionTests method testSetArchimateConcept.

@Test
public void testSetArchimateConcept() {
    IAccessRelationship r = IArchimateFactory.eINSTANCE.createAccessRelationship();
    connection.setArchimateConcept(r);
    assertSame(r, connection.getArchimateConcept());
    assertSame(r, connection.getArchimateRelationship());
}
Also used : IAccessRelationship(com.archimatetool.model.IAccessRelationship) Test(org.junit.Test)

Aggregations

IAccessRelationship (com.archimatetool.model.IAccessRelationship)7 IAggregationRelationship (com.archimatetool.model.IAggregationRelationship)2 IAssignmentRelationship (com.archimatetool.model.IAssignmentRelationship)2 ICompositionRelationship (com.archimatetool.model.ICompositionRelationship)2 IInfluenceRelationship (com.archimatetool.model.IInfluenceRelationship)2 IRealizationRelationship (com.archimatetool.model.IRealizationRelationship)2 ISpecializationRelationship (com.archimatetool.model.ISpecializationRelationship)2 Test (org.junit.Test)2 CSVParseException (com.archimatetool.csv.CSVParseException)1 ToolTipFigure (com.archimatetool.editor.diagram.figures.ToolTipFigure)1 IArchimateConcept (com.archimatetool.model.IArchimateConcept)1 IArchimateElement (com.archimatetool.model.IArchimateElement)1 IArchimateRelationship (com.archimatetool.model.IArchimateRelationship)1 IFlowRelationship (com.archimatetool.model.IFlowRelationship)1 IJunction (com.archimatetool.model.IJunction)1 IProperties (com.archimatetool.model.IProperties)1 IProperty (com.archimatetool.model.IProperty)1 IServingRelationship (com.archimatetool.model.IServingRelationship)1 ITriggeringRelationship (com.archimatetool.model.ITriggeringRelationship)1 PolylineConnection (org.eclipse.draw2d.PolylineConnection)1