예제 #1
0
  public static void setContainerChildrenVisible(
      IFeatureProvider fp, ContainerShape container, boolean visible) {
    List<PictogramElement> list = new ArrayList<PictogramElement>();
    list.addAll(container.getChildren());
    for (PictogramElement pe : list) {
      if (ShapeDecoratorUtil.isActivityBorder(pe)) continue;

      if (ShapeDecoratorUtil.isEventSubProcessDecorator(pe)) {
        pe.setVisible(!visible);
      } else pe.setVisible(visible);

      if (visible) FeatureSupport.updateLabel(fp, pe, null);
      if (pe instanceof AnchorContainer) {
        AnchorContainer ac = (AnchorContainer) pe;
        for (Anchor a : ac.getAnchors()) {
          for (Connection c : a.getOutgoingConnections()) {
            c.setVisible(visible);
            if (visible) FeatureSupport.updateLabel(fp, c, null);
            for (ConnectionDecorator decorator : c.getConnectionDecorators()) {
              decorator.setVisible(visible);
            }
          }
        }
      }
    }
  }
예제 #2
0
 public static boolean setHidden(PictogramElement pe, boolean hidden) {
   if (hidden) {
     pe.eSetDeliver(false);
     Graphiti.getPeService()
         .setPropertyValue(pe, GraphitiConstants.IS_HIDDEN, Boolean.TRUE.toString());
     pe.setVisible(false);
     pe.eSetDeliver(true);
   } else {
     pe.eSetDeliver(false);
     Graphiti.getPeService().removeProperty(pe, GraphitiConstants.IS_HIDDEN);
     pe.setVisible(true);
     pe.eSetDeliver(true);
   }
   return false;
 }