public Widget getRelatedWidget () { return anchors[index].getRelatedWidget(); }
public Widget getRelatedWidget () { return anchors[index].getRelatedWidget(); }
private ConnectionWidget oppositeConnection(ConnectionWidget c0) { Widget sourceAnchorWidget = c0.getSourceAnchor().getRelatedWidget(); Widget targetAnchorWidget = c0.getTargetAnchor().getRelatedWidget(); for (Widget w : connectionLayer.getChildren()) { if (w instanceof ConnectionWidget) { ConnectionWidget c1 = (ConnectionWidget) w; Anchor sourceAnchor = c1.getSourceAnchor(); Anchor targetAnchor = c1.getTargetAnchor(); if (sourceAnchor == null || targetAnchor == null) { continue; } if (sourceAnchor.getRelatedWidget().equals(targetAnchorWidget) && targetAnchor.getRelatedWidget().equals(sourceAnchorWidget)) { return c1; } } } return null; }
private Rectangle getTargetBounds(ConnectionWidget connectionWidget) { Widget target = connectionWidget.getTargetAnchor().getRelatedWidget(); if (target == null) return null; Point targetLocation = target.getLocation(); Rectangle targetArea = target.getClientArea(); return new Rectangle(targetLocation, targetArea.getSize()); }
private Rectangle getTargetBounds() { Widget target = connection.getTargetAnchor().getRelatedWidget(); if(target != null) { Point targetLocation = target.getLocation(); Rectangle targetArea = target.getClientArea(); return new Rectangle(targetLocation, targetArea.getSize()); } return null; } }
private Rectangle getTargetBounds(ConnectionWidget connectionWidget) { Widget target = connectionWidget.getTargetAnchor().getRelatedWidget(); if (target == null) return null; Point targetLocation = target.getLocation(); Rectangle targetArea = target.getClientArea(); return new Rectangle(targetLocation, targetArea.getSize()); }
private Rectangle getTargetBounds() { Widget target = connection.getTargetAnchor().getRelatedWidget(); if(target != null) { Point targetLocation = target.getLocation(); Rectangle targetArea = target.getClientArea(); return new Rectangle(targetLocation, targetArea.getSize()); } return null; } }
private Rectangle getSourceBounds(ConnectionWidget connectionWidget) { Widget source = connectionWidget.getSourceAnchor().getRelatedWidget(); if (source == null) return null; Point sourceLocation = source.getLocation(); Rectangle clientArea = source.getClientArea(); return new Rectangle(sourceLocation, clientArea.getSize()); }
private Rectangle getSourceBounds() { Widget source = connection.getSourceAnchor().getRelatedWidget(); if(source != null) { Point sourceLocation = source.getLocation(); Rectangle clientArea = source.getClientArea(); return new Rectangle(sourceLocation, clientArea.getSize()); } return null; }
private Rectangle getSourceBounds(ConnectionWidget connectionWidget) { Widget source = connectionWidget.getSourceAnchor().getRelatedWidget(); if (source == null) return null; Point sourceLocation = source.getLocation(); Rectangle clientArea = source.getClientArea(); return new Rectangle(sourceLocation, clientArea.getSize()); }
private Rectangle getSourceBounds() { Widget source = connection.getSourceAnchor().getRelatedWidget(); if(source != null) { Point sourceLocation = source.getLocation(); Rectangle clientArea = source.getClientArea(); return new Rectangle(sourceLocation, clientArea.getSize()); } return null; }
public int getEndLocation() { int retVal = 0; if(attachedWidget != null) { Rectangle bounds = attachedWidget.getBounds(); retVal = getLocation(bounds); } else { // Rectangle bounds = attachedWidget.getBounds(); Rectangle bounds = new Rectangle(); if(attachedEnd == ConnectionEnd.SOURCE) { Widget sourceWidget = getConnection().getSourceAnchor().getRelatedWidget(); bounds = sourceWidget.getBounds(); } else { Widget sourceWidget = getConnection().getTargetAnchor().getRelatedWidget(); bounds = sourceWidget.getBounds(); } retVal = getLocation(bounds); } return retVal; }
public int getEndLocation() { int retVal = 0; if(attachedWidget != null) { Rectangle bounds = attachedWidget.getBounds(); retVal = getLocation(bounds); } else { // Rectangle bounds = attachedWidget.getBounds(); Rectangle bounds = new Rectangle(); if(attachedEnd == ConnectionEnd.SOURCE) { Widget sourceWidget = getConnection().getSourceAnchor().getRelatedWidget(); bounds = sourceWidget.getBounds(); } else { Widget sourceWidget = getConnection().getTargetAnchor().getRelatedWidget(); bounds = sourceWidget.getBounds(); } retVal = getLocation(bounds); } return retVal; }
if (sourceAnchor.getRelatedWidget() != null && (sourceAnchor.getRelatedWidget() == targetAnchor.getRelatedWidget())) Rectangle rec = sourceAnchor.getRelatedWidget().convertLocalToScene(sourceAnchor.getRelatedWidget().getBounds()); rec.grow(SPACING_NODE, SPACING_NODE); verticalCollisions.add(rec);
if (sourceAnchor.getRelatedWidget() != null && (sourceAnchor.getRelatedWidget() == targetAnchor.getRelatedWidget())) Rectangle rec = sourceAnchor.getRelatedWidget().convertLocalToScene(sourceAnchor.getRelatedWidget().getBounds()); rec.grow(SPACING_NODE, SPACING_NODE); verticalCollisions.add(rec);
if (sourceAnchor != null && targetAnchor != null) { Object sourceObject = scene.findObject(CONNECT_WIDGET.getSourceAnchor().getRelatedWidget()); Page sourcePage = null; Pin sourcePin = null; Object targetObject = scene.findObject(CONNECT_WIDGET.getTargetAnchor().getRelatedWidget()); Page targetPage = null; if (scene.isPin(targetObject)) {