/** * Converts relative label position to absolute and allows for * any label offset. * @param geometry the relative label position * @return the absolute label position including any offset */ protected Point2D getAbsoluteLabelPositionFromRelative(Point2D geometry) { Point2D result = convertRelativeLabelPositionToAbsolute(geometry); if (result != null) { double offsetX = 0; double offsetY = 0; Point2D offset = GraphConstants.getOffset(getAllAttributes()); if (offset != null) { offsetX = offset.getX(); offsetY = offset.getY(); } double x = result.getX() + offsetX; double y = result.getY() + offsetY; return new Point2D.Double(x, y); } return null; }
Point2D storedRelativePosition = edge.convertRelativeLabelPositionToAbsolute(result); if (p.equals(storedRelativePosition)) { GraphConstants.setRemoveAttributes(edge.getAllAttributes(), new Object[] {GraphConstants.OFFSET});