/** * Returns the bounds of the edge shape without label */ public Rectangle2D getPaintBounds(EdgeView view) { Rectangle2D rec = null; setView(view); if (view.getShape() != null && view.getShape().getBounds()!=null) rec = view.getShape().getBounds(); else rec = new Rectangle2D.Double(0, 0, 0, 0); return rec; }
/** * Returns the label position of the specified view in the given graph. */ public Point2D getLabelPosition(EdgeView view) { setView(view); return getLabelPosition(view.getLabelPosition()); }
/** * Returns the label position of the specified view in the given graph. */ public Point2D getExtraLabelPosition(EdgeView view, int index) { setView(view); Point2D[] pts = GraphConstants.getExtraLabelPositions(view .getAllAttributes()); if (pts != null && index < pts.length) return getLabelPosition(pts[index]); return null; }
/** * Returns the label bounds of the specified view in the given graph. Note: * The index is the position of the String object for the label in the extra * labels array of the view. */ public Rectangle2D getExtraLabelBounds(JGraph paintingContext, EdgeView view, int index) { if (paintingContext == null && graph != null) { JGraph graph = (JGraph)this.graph.get(); paintingContext = graph; } setView(view); Object[] labels = GraphConstants .getExtraLabels(view.getAllAttributes()); if (labels != null && index < labels.length) { Point2D p = getExtraLabelPosition(this.view, index); Dimension d = getExtraLabelSize(paintingContext, this.view, index); String label = (paintingContext != null) ? paintingContext .convertValueToString(labels[index]) : String .valueOf(labels[index]); return getLabelBounds(p, d, label); } return new Rectangle2D.Double(getX(), getY(), 0, 0); }
this.childrenSelected = graph.getSelectionModel() .isChildrenSelected(view.getCell()); setView(view); return this;