예제 #1
0
 /** @see org.eclipse.bpel.ui.editparts.BPELEditPart#refreshVisuals() */
 public void refreshVisuals() {
   super.refreshVisuals();
   // Refresh any decorations on this edit part
   this.hasFH = getFaultHandler() != null;
   this.hasEH = getEventHandler() != null;
   // Force a repaint, as the decorations.
   getFigure().repaint();
 }
예제 #2
0
    @Override
    protected ArrayList<PolylineConnection> createHorizontalConnections(BPELEditPart parent) {
      ArrayList<PolylineConnection> connections = new ArrayList<PolylineConnection>();
      List children = getConnectionChildren(parent);
      BPELEditPart sourcePart, targetPart;
      ConnectionAnchor sourceAnchor = null, targetAnchor = null;

      sourcePart = parent;
      sourceAnchor = sourcePart.getConnectionAnchor(CenteredConnectionAnchor.LEFT);

      if (children != null) {
        for (int i = 0; i < children.size(); i++) {
          if (i == 0) {
            // Link from the left border to the first child
            targetPart = (BPELEditPart) children.get(i);
            targetAnchor = targetPart.getConnectionAnchor(CenteredConnectionAnchor.LEFT);
            if (sourceAnchor != null && targetAnchor != null)
              connections.add(createConnection(sourceAnchor, targetAnchor, arrowColor));
          }
          if (i < children.size() - 1) {
            sourcePart = (BPELEditPart) children.get(i);
            sourceAnchor = sourcePart.getConnectionAnchor(CenteredConnectionAnchor.RIGHT);

            targetPart = (BPELEditPart) children.get(i + 1);
            targetAnchor = targetPart.getConnectionAnchor(CenteredConnectionAnchor.LEFT);
          } else {
            // Link from the last child to the right border
            sourcePart = (BPELEditPart) children.get(i);
            sourceAnchor = sourcePart.getConnectionAnchor(CenteredConnectionAnchor.RIGHT);
            targetAnchor = parent.getConnectionAnchor(CenteredConnectionAnchor.RIGHT);
          }
          if (sourceAnchor != null && targetAnchor != null) {
            PolylineConnection connection =
                createConnection(sourceAnchor, targetAnchor, arrowColor);

            if (sourcePart instanceof StartNodeEditPart
                || sourcePart instanceof ScopeEditPart
                || sourcePart instanceof InvokeEditPart) {
              boolean horizontal =
                  ModelHelper.getBPELEditor(getHost().getModel()).isHorizontalLayout();
              connection.setConnectionRouter(new ImplicitLinkHandlerConnectionRouter(horizontal));
            }
            connections.add(connection);
          }
        }
      }
      return connections;
    }
예제 #3
0
    @Override
    protected ArrayList<PolylineConnection> createHorizontalConnections(BPELEditPart parent) {
      ArrayList<PolylineConnection> connections = new ArrayList<PolylineConnection>();
      List children = getConnectionChildren(parent);
      BPELEditPart sourcePart, targetPart;
      ConnectionAnchor sourceAnchor = null, targetAnchor = null;

      sourcePart = parent;
      sourceAnchor = sourcePart.getConnectionAnchor(CenteredConnectionAnchor.LEFT);

      if (children != null) {
        for (int i = 0; i < children.size(); i++) {
          if (i == 0) {
            targetPart = (BPELEditPart) children.get(i);
            targetAnchor = targetPart.getConnectionAnchor(CenteredConnectionAnchor.LEFT);
            if (sourceAnchor != null && targetAnchor != null)
              connections.add(createConnection(sourceAnchor, targetAnchor, arrowColor));
          }
          if (i < children.size() - 1) {
            if (i > 0) {
              sourcePart = (BPELEditPart) children.get(i);
              sourceAnchor = sourcePart.getConnectionAnchor(CenteredConnectionAnchor.RIGHT);
            }
            targetPart = (BPELEditPart) children.get(i + 1);
            targetAnchor = targetPart.getConnectionAnchor(CenteredConnectionAnchor.LEFT);
          } else {
            // Link from the last child to the right border
            sourcePart = (BPELEditPart) children.get(i);
            sourceAnchor = sourcePart.getConnectionAnchor(CenteredConnectionAnchor.RIGHT);
            targetAnchor = parent.getConnectionAnchor(CenteredConnectionAnchor.RIGHT);
          }
          if (sourceAnchor != null && targetAnchor != null)
            connections.add(createConnection(sourceAnchor, targetAnchor, arrowColor));
        }
      }

      return connections;
    }
예제 #4
0
 protected void removeAllAdapters() {
   adapter.removedFrom(getProcess());
   super.removeAllAdapters();
 }
예제 #5
0
 protected void addAllAdapters() {
   super.addAllAdapters();
   adapter.addToObject(getProcess());
 }