コード例 #1
0
 @Override
 public void moveShape(IMoveShapeContext context) {
   super.moveShape(context);
   Object bo = getBusinessObjectForPictogramElement(context.getPictogramElement());
   if (bo instanceof Action) {
     Action action = (Action) bo;
     relocatePins(action, context);
   }
 }
コード例 #2
0
 @Override
 public void moveShape(IMoveShapeContext context) {
   // if this Label Shape is part of a multiselection, and if its owner is included
   // in that multiselection, then do not move the label. Moving the label is
   // already handled by the label's owner.
   PictogramElement pes[] =
       getFeatureProvider()
           .getDiagramTypeProvider()
           .getDiagramBehavior()
           .getDiagramContainer()
           .getSelectedPictogramElements();
   Shape shape = context.getShape();
   for (PictogramElement pe : pes) {
     ContainerShape s = BusinessObjectUtil.getFirstElementOfType(pe, ContainerShape.class);
     if (s == shape) return;
   }
   super.moveShape(context);
 }