/** * Returns the shape of the view according to the last rendering state */ public Shape getShape() { if (sharedPath != null) return sharedPath; else { return sharedPath = (GeneralPath) getEdgeRenderer().createShape(); } }
/** * Returns true if this view intersects the given rectangle. */ public boolean intersects(JGraph graph, Rectangle2D rect) { boolean intersects = super.intersects(graph, rect); if (!isLeaf()) { return intersects; } else if (intersects) { Rectangle r = new Rectangle((int) rect.getX(), (int) rect.getY(), (int) rect.getWidth(), (int) rect.getHeight()); return getEdgeRenderer().intersects(graph, this, r); } return false; }
/** * Returns the location for this edgeview. */ public Rectangle2D getBounds() { Rectangle2D rect = super.getBounds(); if (rect == null) { if (cachedBounds == null) { cachedBounds = getEdgeRenderer().getBounds(this); } rect = cachedBounds; } return rect; }