@Test public void testGetConnectorPosition() { final Point2D target = new Point2D(NODE_X + CONNECTOR_CENTER_X, NODE_Y + CONNECTOR_CENTER_Y); assertEquals(GeometryUtils.getConnectorPosition(connector, skinLookup), target); }
public static Point2D getConnectorPosition(final GConnector connector, final SkinLookup skinLookup) { final GConnectorSkin connectorSkin = skinLookup.lookupConnector(connector); final GNode parent = connector.getParent(); final GNodeSkin nodeSkin = skinLookup.lookupNode(parent); if (nodeSkin == null) { return null; } nodeSkin.layoutConnectors(); final double nodeX = nodeSkin.getRoot().getLayoutX(); final double nodeY = nodeSkin.getRoot().getLayoutY(); final Point2D connectorPosition = nodeSkin.getConnectorPosition(connectorSkin); final double connectorX = connectorPosition.getX(); final double connectorY = connectorPosition.getY(); return new Point2D(moveOnPixel(nodeX + connectorX), moveOnPixel(nodeY + connectorY)); }
GeometryUtils { public static Point2D getConnectorPosition(final GConnector connector, final SkinLookup skinLookup) { final GConnectorSkin connectorSkin = skinLookup.lookupConnector(connector); final GNode parent = connector.getParent(); final GNodeSkin nodeSkin = skinLookup.lookupNode(parent); if (nodeSkin == null) { return null; } nodeSkin.layoutConnectors(); final double nodeX = nodeSkin.getRoot().getLayoutX(); final double nodeY = nodeSkin.getRoot().getLayoutY(); final Point2D connectorPosition = nodeSkin.getConnectorPosition(connectorSkin); final double connectorX = connectorPosition.getX(); final double connectorY = connectorPosition.getY(); return new Point2D(moveOnPixel(nodeX + connectorX), moveOnPixel(nodeY + connectorY)); } }
GeometryUtils { public static Point2D getConnectorPosition(final GConnector connector, final SkinLookup skinLookup) { final GConnectorSkin connectorSkin = skinLookup.lookupConnector(connector); final GNode parent = connector.getParent(); final GNodeSkin nodeSkin = skinLookup.lookupNode(parent); if (nodeSkin == null) { return null; } nodeSkin.layoutConnectors(); final double nodeX = nodeSkin.getRoot().getLayoutX(); final double nodeY = nodeSkin.getRoot().getLayoutY(); final Point2D connectorPosition = nodeSkin.getConnectorPosition(connectorSkin); final double connectorX = connectorPosition.getX(); final double connectorY = connectorPosition.getY(); return new Point2D(moveOnPixel(nodeX + connectorX), moveOnPixel(nodeY + connectorY)); }  }
GeometryUtils { public static Point2D getConnectorPosition(final GConnector connector, final SkinLookup skinLookup) { final GConnectorSkin connectorSkin = skinLookup.lookupConnector(connector); final GNode parent = connector.getParent(); final GNodeSkin nodeSkin = skinLookup.lookupNode(parent); if (nodeSkin == null) { return null; } nodeSkin.layoutConnectors(); final double nodeX = nodeSkin.getRoot().getLayoutX(); final double nodeY = nodeSkin.getRoot().getLayoutY(); final Point2D connectorPosition = nodeSkin.getConnectorPosition(connectorSkin); final double connectorX = connectorPosition.getX(); final double connectorY = connectorPosition.getY(); return new Point2D(moveOnPixel(nodeX + connectorX), moveOnPixel(nodeY + connectorY)); }  static Point2D getConnectorPosition(final GConnector connector, final SkinLookup skinLookup); static Point2D getCursorPosition(final MouseEvent event, final Node node); static List<Point2D> getJointPositions(final List<GJointSkin> jointSkins); static void fillJointPositions(final GConnection connection, final SkinLookup skinLookup, final Point2D[] pTarget); static List<Point2D> getJointPositions(final GConnection connection, final SkinLookup skinLookup); static Point2D getJointPosition(final GJoint joint, final SkinLookup skinLookup); static List<Point2D> getJointPositions(final GConnection connection); static double moveOnPixel(final double position); static double moveOffPixel(final double position); static boolean checkInRange(final double firstValue, final double secondValue, final double position); static boolean checkIntersection(final Point2D a, final Point2D b, final Point2D c, final Point2D d); static double roundToGridSpacing(final GraphEditorProperties pProperties, final double pValue); }
GeometryUtils { public static Point2D getConnectorPosition(final GConnector connector, final SkinLookup skinLookup) { final GConnectorSkin connectorSkin = skinLookup.lookupConnector(connector); final GNode parent = connector.getParent(); final GNodeSkin nodeSkin = skinLookup.lookupNode(parent); if (nodeSkin == null) { return null; } nodeSkin.layoutConnectors(); final double nodeX = nodeSkin.getRoot().getLayoutX(); final double nodeY = nodeSkin.getRoot().getLayoutY(); final Point2D connectorPosition = nodeSkin.getConnectorPosition(connectorSkin); final double connectorX = connectorPosition.getX(); final double connectorY = connectorPosition.getY(); return new Point2D(moveOnPixel(nodeX + connectorX), moveOnPixel(nodeY + connectorY)); }  static Point2D getConnectorPosition(final GConnector connector, final SkinLookup skinLookup); static Point2D getCursorPosition(final MouseEvent event, final Node node); static List<Point2D> getJointPositions(final List<GJointSkin> jointSkins); static void fillJointPositions(final GConnection connection, final SkinLookup skinLookup, final Point2D[] pTarget); static List<Point2D> getJointPositions(final GConnection connection, final SkinLookup skinLookup); static Point2D getJointPosition(final GJoint joint, final SkinLookup skinLookup); static List<Point2D> getJointPositions(final GConnection connection); static double moveOnPixel(final double position); static double moveOffPixel(final double position); static boolean checkInRange(final double firstValue, final double secondValue, final double position); static boolean checkIntersection(final Point2D a, final Point2D b, final Point2D c, final Point2D d); static double roundToGridSpacing(final GraphEditorProperties pProperties, final double pValue);  }