private static BoundingBox computeBoundingBox(Layout layout, VertexRef vertRef) { return new BoundingBox(layout.getLocation(vertRef), 100, 100); }
private static BoundingBox computeBoundingBox(Layout layout, VertexRef vertRef) { return new BoundingBox(layout.getLocation(vertRef), 100, 100); }
@Override public Point2D transform(VertexRef v) { if (v == null) { LOG.warn("Algorithm tried to layout a null vertex"); return new Point(0,0); } org.opennms.features.topology.api.Point location = graphLayout.getLocation(v); return new Point2D.Double(location.getX(), location.getY()); } };
private static Map<VertexRef,Point> saveLocations(Graph graph) { Collection<? extends Vertex> vertices = graph.getDisplayVertices(); Map<VertexRef,Point> locations = new HashMap<>(); for(Vertex vert : vertices) { locations.put(vert, graph.getLayout().getLocation(vert)); } return locations; }
@Override public Point2D transform(VertexRef v) { if (v == null) { LOG.warn("Algorithm tried to layout a null vertex"); return new Point(0,0); } org.opennms.features.topology.api.Point location = graphLayout.getLocation(v); return new Point2D.Double(location.getX(), location.getY()); } };
private static Map<VertexRef,Point> saveLocations(Graph graph) { Collection<? extends Vertex> vertices = graph.getDisplayVertices(); Map<VertexRef,Point> locations = new HashMap<>(); for(Vertex vert : vertices) { locations.put(vert, graph.getLayout().getLocation(vert)); } return locations; }
private static Map<VertexRef,Point> saveLocations(Graph graph) { Collection<? extends Vertex> vertices = graph.getDisplayVertices(); Map<VertexRef,Point> locations = new HashMap<VertexRef,Point>(); for(Vertex vert : vertices) { locations.put(vert, graph.getLayout().getLocation(vert)); } return locations; }
@Override public Point2D transform(VertexRef v) { org.opennms.features.topology.api.Point location = graphLayout.getLocation(v); return new Point2D.Double(location.getX()-xOffset, location.getY()-yOffset); } };
@Override public Point2D transform(VertexRef v) { org.opennms.features.topology.api.Point location = graphLayout.getLocation(v); return new Point2D.Double(location.getX()+xOffset, location.getY()+yOffset); } };
@Override public Point2D transform(VertexRef v) { org.opennms.features.topology.api.Point location = graphLayout.getLocation(v); return new Point2D.Double(location.getX()+xOffset, location.getY()+yOffset); } };
@Override public Point2D transform(VertexRef v) { org.opennms.features.topology.api.Point location = graphLayout.getLocation(v); return new Point2D.Double(location.getX()+xOffset, location.getY()+yOffset); } };
@Override public Point2D transform(VertexRef v) { org.opennms.features.topology.api.Point location = graphLayout.getLocation(v); return new Point2D.Double(location.getX()-xOffset, location.getY()-yOffset); } };
@Override public Point2D transform(VertexRef v) { org.opennms.features.topology.api.Point location = graphLayout.getLocation(v); return new Point2D.Double(location.getX()+xOffset, location.getY()+yOffset); } };
final Layout layout = graph.getLayout(); final long notLayedOutCount = vertices.stream().filter(v -> { Point location = layout.getLocation(v); return location.getX() == 0 && location.getY() == 0; }).count(); Point p = layout.getLocation(vertex); layout.setLocation(vertex, p);
final Layout layout = graph.getLayout(); final long notLayedOutCount = vertices.stream().filter(v -> { Point location = layout.getLocation(v); return location.getX() == 0 && location.getY() == 0; }).count(); Point p = layout.getLocation(vertex); layout.setLocation(vertex, p);
final List<VertexPositionEntity> vertexPositionEntities = vertexRefs.stream() .map(vertexRef -> { final Point p = layout.getLocation(vertexRef); PointEntity pointEntity = new PointEntity(); pointEntity.setX((int) p.getX());
final List<VertexPositionEntity> vertexPositionEntities = vertexRefs.stream() .map(vertexRef -> { final Point p = layout.getLocation(vertexRef); PointEntity pointEntity = new PointEntity(); pointEntity.setX((int) p.getX());
@Override public void visitVertex(Vertex vertex) throws PaintException { boolean selected = isSelected(m_graphContainer.getSelectionManager(), vertex); Point initialLocation = m_layout.getInitialLocation(vertex); Point location = m_layout.getLocation(vertex); SharedVertex v = new SharedVertex(); v.setKey(vertex.getKey()); //TODO cast to int for now v.setInitialX((int)initialLocation.getX()); v.setInitialY((int)initialLocation.getY()); v.setX((int)location.getX()); v.setY((int) location.getY()); v.setSelected(selected); v.setStatus(getStatus(vertex)); v.setStatusCount(getStatusCount(vertex)); v.setSVGIconId(getIconId(vertex)); v.setLabel(vertex.getLabel()); v.setTooltipText(getTooltipText(vertex)); v.setStyleName(getVertexStyle(vertex, selected)); v.setTargets(getTargets(vertex)); v.setEdgePathOffset(getEdgePathOffset(vertex)); m_vertices.add(v); }
@Override public void visitVertex(Vertex vertex) throws PaintException { boolean selected = isSelected(m_graphContainer.getSelectionManager(), vertex); Point initialLocation = m_layout.getInitialLocation(vertex); Point location = m_layout.getLocation(vertex); SharedVertex v = new SharedVertex(); v.setKey(vertex.getKey()); //TODO cast to int for now v.setInitialX((int)initialLocation.getX()); v.setInitialY((int)initialLocation.getY()); v.setX((int)location.getX()); v.setY((int) location.getY()); v.setSelected(selected); v.setStatus(getStatus(vertex)); v.setStatusCount(getStatusCount(vertex)); v.setSVGIconId(getIconId(vertex)); v.setLabel(vertex.getLabel()); v.setTooltipText(getTooltipText(vertex)); v.setStyleName(getVertexStyle(vertex, selected)); v.setTargets(getTargets(vertex)); v.setEdgePathOffset(getEdgePathOffset(vertex)); m_vertices.add(v); }