/** * Gets the maximum drawing area containing graphics * * @return */ public Dimension getDrawingArea() { Rectangle2D area = new Rectangle(0, 0); for (VisreedNode node : this.getHigraph().getTops()) { NodeView< VisreedPayload, VisreedEdgeLabel, VisreedHigraph, VisreedWholeGraph, VisreedSubgraph, VisreedNode, VisreedEdge> nodeView = this.getNodeView(node); Rectangle.union(area, nodeView.getNextExtent(), area); } return new Dimension((int) area.getWidth() + 1, (int) area.getHeight() + 1); }
/** After each layout, update the position for each node */ public void updateNodePosition() { this.positionTable.clear(); for (VisreedNode node : this.getHigraph().getNodes()) { NodeView< VisreedPayload, VisreedEdgeLabel, VisreedHigraph, VisreedWholeGraph, VisreedSubgraph, VisreedNode, VisreedEdge> nodeView = this.getNodeView(node); this.positionTable.put(nodeView.getNextShapeExtent(), nodeView); } }