public void refreshVisuals() {
    // If the text position has been changed by user update it
    if (fDiagramModelConnection.getTextPosition() != fTextPosition) {
      fTextPosition = fDiagramModelConnection.getTextPosition();
      setLabelLocator(fTextPosition);
    }

    setLabelFont();

    setLabelFontColor();

    setLineColor();

    setConnectionText();

    setLineWidth();

    // Set Enabled according to current Viewpoint
    boolean enabled = ViewpointsManager.INSTANCE.isAllowedType(getModelConnection());
    setEnabled(enabled);
    if (getSourceDecoration() != null) {
      getSourceDecoration().setEnabled(enabled);
    }
    if (getTargetDecoration() != null) {
      getTargetDecoration().setEnabled(enabled);
    }
    getConnectionLabel().setEnabled(enabled);
  }
  @Override
  public boolean isChildElementVisible(EditPart parentEditPart, Object childObject) {
    IViewpoint viewPoint = null;

    if (childObject instanceof IDiagramModelObject) {
      IArchimateDiagramModel dm =
          (IArchimateDiagramModel) ((IDiagramModelObject) childObject).getDiagramModel();
      if (dm != null) {
        int index = dm.getViewpoint();
        viewPoint = ViewpointsManager.INSTANCE.getViewpoint(index);
      }
    }

    if (viewPoint != null && childObject instanceof EObject) {
      return viewPoint.isElementVisible((EObject) childObject);
    }

    return true;
  }
Example #3
0
 @Override
 public void refreshVisuals() {
   // Set Enabled according to current Viewpoint
   boolean enabled = ViewpointsManager.INSTANCE.isAllowedType(getDiagramModelObject());
   setEnabled(enabled);
 }