/** * Returns the cached bounds for the vertex. */ public Rectangle2D getBounds() { Rectangle2D rect = super.getBounds(); if (rect == null) rect = bounds; return rect; }
/** * 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; }
/** * Sets the bounds of this <code>view</code>. Calls translateView and * scaleView. * * @param bounds * the new bounds for this cell view */ public void setBounds(Rectangle2D bounds) { Rectangle2D oldBounds = getBounds(); if (oldBounds == null) oldBounds = new Rectangle2D.Double(); Point2D p0 = new Point2D.Double(oldBounds.getX(), oldBounds.getY()); Point2D pe = new Point2D.Double(bounds.getX(), bounds.getY()); Rectangle2D localBounds = new Rectangle2D.Double(bounds.getX(), bounds .getY(), bounds.getWidth(), bounds.getHeight()); if (GraphConstants.isMoveable(getAllAttributes()) && !pe.equals(p0)) translate(pe.getX() - p0.getX(), pe.getY() - p0.getY()); else localBounds.setFrame(localBounds.getX(), localBounds.getY(), bounds .getWidth() - pe.getX() + p0.getX(), bounds.getHeight() - pe.getY() + p0.getY()); double lbw = localBounds.getWidth(), lbh = localBounds.getHeight(); double obw = oldBounds.getWidth(), obh = oldBounds.getHeight(); if ((lbw != obw || lbh != obh) && obw > 0 && obh > 0) scale(lbw / obw, lbh / obh, pe); }
/** * Updates the bounds of this view and its children * */ protected void updateGroupBounds() { // Note: Prevent infinite recursion by removing // child edges that point to their parent. CellView[] childViews = getChildViews(); LinkedList result = new LinkedList(); for (int i = 0; i < childViews.length; i++) if (includeInGroupBounds(childViews[i])) result.add(childViews[i]); childViews = new CellView[result.size()]; result.toArray(childViews); Rectangle2D r = getBounds(childViews); int groupBorder = GraphConstants.getInset(getAllAttributes()); if (r != null) r.setFrame(r.getX() - groupBorder, r.getY() - groupBorder, r .getWidth() + 2 * groupBorder, r.getHeight() + 2 * groupBorder); groupBounds = r; }
&& initialLocation != null && start != null) { Rectangle2D graphBounds = graph.getBounds(); Rectangle2D viewBounds = AbstractCellView.getBounds(views); if (initialLocation.getX() + totDx + viewBounds.getWidth() > graphBounds .getWidth())
Rectangle2D size = AbstractCellView.getBounds(graphLayoutCache .getRoots()); if (size == null)
/** * Returns true if the view intersects the given rectangle. * * @param graph * the <code>JGraph</code> instance of the view * @param rect * the rectangle within which intersection is being checked for * * @return whether or not the rectangle specified intersects the view */ public boolean intersects(JGraph graph, Rectangle2D rect) { if (isLeaf() || GraphConstants.isGroupOpaque(getAllAttributes())) { Rectangle2D bounds = getBounds(); if (bounds != null) return bounds.intersects(rect); } else { // Check If Children Intersect Iterator it = childViews.iterator(); while (it.hasNext()) if (((CellView) it.next()).intersects(graph, rect)) return true; } return false; }
.getBounds().intersects( AbstractCellView .getBounds(views)))) { pm = new ParentMap(context.getCells(), null);
if (offgraphics != null || !graph.isXorEnabled()) { dirty = graph.toScreen(AbstractCellView .getBounds(views)); Rectangle2D t = graph.toScreen(AbstractCellView .getBounds(contextViews)); if (t != null) dirty.add(t); && (ignoredRegion == null || !ignoredRegion .intersects(AbstractCellView .getBounds(views)))) { targetGroup = (event.isControlDown()) ? null : findUnselectedInnermostGroup( .getBounds(views))); Rectangle2D t = graph.toScreen(AbstractCellView .getBounds(contextViews)); if (t != null) dirty.add(t);
if (offgraphics != null || !graph.isXorEnabled()) { dirty = graph .toScreen((Rectangle2D) vertex.getBounds().clone()); Rectangle2D t = graph.toScreen(AbstractCellView .getBounds(contextViews)); if (t != null) dirty.add(t); .clone())); Rectangle2D t = graph.toScreen(AbstractCellView .getBounds(contextViews)); if (t != null) dirty.add(t);