コード例 #1
0
 /*
  * (non-Javadoc)
  *
  * @see org.eclipse.papyrus.layout.LayouttoolInterface#getSource(org.eclipse.gef.EditPart)
  */
 public EditPart getSource(EditPart element) {
   if (element.getModel() instanceof Edge) {
     Edge edge = (Edge) element.getModel();
     removeBendPoints(edge);
     AbstractConnectionEditPart acep = (AbstractConnectionEditPart) element;
     return acep.getSource();
   }
   return null;
 }
コード例 #2
0
 public void deactivateFigure() {
   if (getRelation().getRelation() instanceof Changeable) {
     Changeable changeable = (Changeable) getRelation().getRelation();
     changeable.removeChangeListener(this);
   }
   super.deactivateFigure();
 }
コード例 #3
0
 public void activateFigure() {
   super.activateFigure();
   if (getRelation().getRelation() instanceof Changeable) {
     Changeable changeable = (Changeable) getRelation().getRelation();
     changeable.addChangeListener(this);
   }
 }
コード例 #4
0
 @Override
 public void deactivate() {
   if (isActive()) {
     ((NPNSymbolArcSN) getModel()).eAdapters().remove(adapter);
     ((NPNSymbolArcSN) getModel()).getModel().eAdapters().remove(adapter);
   }
   super.deactivate();
 }
コード例 #5
0
 @Override
 public void activate() {
   if (!isActive()) {
     ((NPNSymbolArcSN) getModel()).eAdapters().add(adapter);
     ((NPNSymbolArcSN) getModel()).getModel().eAdapters().add(adapter);
   }
   super.activate();
 }
コード例 #6
0
  /** @see org.eclipse.gef.EditPart#setSelected(int) */
  public void setSelected(int value) {
    super.setSelected(value);

    if (getCastedModel().getConnectionLabel() != null) {
      ConnLabelEditPart part = (ConnLabelEditPart) children.get(0);
      if (part.getSelected() != value) part.setSelected(value);
    }
  }
コード例 #7
0
  /** @see org.eclipse.gef.editparts.AbstractEditPart#refreshVisuals() */
  protected void refreshVisuals() {
    super.refreshVisuals();

    PolylineConnection fig = (PolylineConnection) getFigure();
    Object constraint = getCastedModel().getBendpoints();
    fig.setRoutingConstraint(constraint);

    // Effettuo il refresh della ConnectionLabel associata
    if (!getChildren().isEmpty()) {
      ConnLabelEditPart connEP = (ConnLabelEditPart) getChildren().get(0);
      connEP.refreshVisuals();
    }
  }
コード例 #8
0
 /** Upon deactivation, detach from the model element as a property change listener. */
 public void deactivate() {
   if (isActive()) {
     super.deactivate();
     ((Notifier) getModel()).eAdapters().remove(modelListener);
   }
 }
コード例 #9
0
 /** Upon activation, attach to the model element as a property change listener. */
 public void activate() {
   if (!isActive()) {
     super.activate();
     ((Notifier) getModel()).eAdapters().add(modelListener);
   }
 }
コード例 #10
0
 public void deactivate() {
   super.deactivate();
   if (getSource() != null) {
     getSource().removeEditPartListener(this);
   }
 }
コード例 #11
0
 public void activate() {
   super.activate();
   if (getSource() != null) {
     getSource().addEditPartListener(this);
   }
 }