GeometryUtils { public static Point2D getConnectorPosition(final GConnector connector, final SkinLookup skinLookup) { final GConnectorSkin connectorSkin = skinLookup.lookupConnector(connector); final GConnectable parent = connector.getParent(); if (parent instanceof GNode) { final GNodeSkin nodeSkin = skinLookup.lookupNode((GNode) parent); nodeSkin.layoutConnectors(); nodeSkin.getConnectorPosition(skinLookup.lookupConnector(connector)); 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)); } return null; }  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 List<Point2D> getJointPositions(final GConnection connection, final SkinLookup skinLookup); static List<Point2D> getJointPositions(final GConnection connection); static List<GJointSkin> getJointSkins(final GConnection connection, final SkinLookup skinLookup); 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);  }
@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); }