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); } } } } } }
public static boolean updateConnection(IFeatureProvider fp, Connection connection) { boolean layoutChanged = false; LayoutContext layoutContext = new LayoutContext(connection); ILayoutFeature layoutFeature = fp.getLayoutFeature(layoutContext); if (layoutFeature != null) { layoutFeature.layout(layoutContext); layoutChanged = layoutFeature.hasDoneChanges(); } boolean updateChanged = false; UpdateContext updateContext = new UpdateContext(connection); IUpdateFeature updateFeature = fp.getUpdateFeature(updateContext); if (updateFeature != null && updateFeature.updateNeeded(updateContext).toBoolean()) { updateFeature.update(updateContext); updateChanged = updateFeature.hasDoneChanges(); } if (layoutChanged) FeatureSupport.updateLabel(fp, connection, null); // also update any Connections that are connected to this Connection // for (Shape shape : AnchorUtil.getConnectionPoints(connection)) { // updateConnections(fp, shape); // } return layoutChanged || updateChanged; }