@Override public IUIPanel getUIPanel() { return connectable.getUIPanel(); }
@Override public void onStart(IDragStartEvent event) { connectableElement.refreshMagnets(); }
@Override public void onStart(IDragStartEvent event) { this.getConnector().refresh(); //if current point is already attached => detach it if (this.getConnectedToMagnet()!=null){ this.getConnectedToMagnet().removeConnectorPoint(this); //remove incoming or outgoing connector this.getConnectedToMagnet().getConnectableElement().getIncommingConnectors().remove(this.getConnector()); this.getConnectedToMagnet().getConnectableElement().getOutgoingConnectors().remove(this.getConnector()); this.setConnectedToMagnet(null); if (this instanceof IConnectorStart){ this.getConnector().setSource(null); }else if (this instanceof IConnectorEnd){ this.getConnector().setTarget(null); } } }
@Override public boolean isConform(IDiagramElementView diagramElementView) { IConnectable connectable = (IConnectable) diagramElementView; if (connectable.getIncommingConnectors().size()==0 || connectable.getOutgoingConnectors().size()==0){ return false; } return true; }
public HashMap<Direction, Point> getIntersectionPoints() { HashMap<Direction, Point> ip = new HashMap<Direction, Point>(); ip.put(Direction.NE, new Point(connectorStart.getAbsoluteLeft(), connectorStart.getAbsoluteTop())); ip.put(Direction.SE, new Point(connectorEnd.getAbsoluteLeft(), connectorEnd.getAbsoluteTop())); return ip; }
private boolean hasMultipleOutgoingSequenceFlow(IDiagramElementView view){ IConnectableElement connectable = (IConnectableElement) view; int i = 0; for(IConnector c:connectable.getOutgoingConnectors()){ if (c instanceof SequenceFlow){ i++; }else{ return false; } } if (i>1){ return true; } return false; }
private boolean hasOneIncomingSequenceFlow(IDiagramElementView view){ IConnectableElement connectable = (IConnectableElement) view; int i = 0; for(IConnector c:connectable.getIncommingConnectors()){ if (c instanceof SequenceFlow){ i++; }else{ return false; } } if (i==1){ return true; } return false; }
@Override public boolean isConform(IDiagramElementView diagramElementView) { IConnectable connectable = (IConnectable) diagramElementView; if (connectable.getIncommingConnectors().size()==0){ return false; } return true; }
public void setRelativeY(float y) { invisibleLinearPath.setY(y); connectorStart.setRelativeY(y); connectorEnd.setRelativeY(y); refresh(); }
public void setRelativeX(float x) { invisibleLinearPath.setX(x); connectorStart.setRelativeX(x); connectorEnd.setRelativeX(x+100); refresh(); }
@Override public void onClick(ClickEvent event) { connector.removeIntermediateConnectorPoint(ConnectorPointElement.this); removeFromParent(); } });
@Override public boolean isConform(IDiagramElementView diagramElementView) { IConnector connector = (IConnector) diagramElementView; IDiagramElementView source = (IDiagramElementView) connector.getSource(); IDiagramElementView target = (IDiagramElementView) connector.getTarget(); if (source==target){ return false; } return true; }
@Override public boolean isConform(IDiagramElementView diagramElementView) { IConnectable connectable = (IConnectable) diagramElementView; if (connectable.getIncommingConnectors().size()==0 && connectable.getOutgoingConnectors().size()==0){ return false; } return true; }
private boolean hasOneOutgoingSequenceFlow(IDiagramElementView view){ IConnectableElement connectable = (IConnectableElement) view; int i = 0; for(IConnector c:connectable.getOutgoingConnectors()){ if (c instanceof SequenceFlow){ i++; }else{ return false; } } if (i==1){ return true; } return false; }
public ContextualMenuHandler(IConnectableElement connectableElement) { this.bpmnelement = connectableElement; this.uipanel = bpmnelement.getUIPanel(); }
private boolean hasMultipleIncommingSequenceFlow(IDiagramElementView view){ IConnectableElement connectable = (IConnectableElement) view; int i = 0; for(IConnector c:connectable.getIncommingConnectors()){ if (c instanceof SequenceFlow){ i++; }else{ return false; } } if (i>1){ return true; } return false; }
@Override public void onStop(IDragStopEvent event) { connectableElement.refreshMagnets(); }
private HashSet<IConnector> getOutgoingSequenceFlows(IConnectableElement connectable){ HashSet<IConnector> result = new HashSet<IConnector>(); for(IConnector connector:connectable.getOutgoingConnectors()){ if (connector instanceof SequenceFlow){ result.add(connector); } } return result; }
@Override public void onMove(IDragMoveEvent event) { connectableElement.refreshMagnets(); }