/** * */ protected mxRectangle apply(TreeNode node, mxRectangle bounds) { mxRectangle g = graph.getModel().getGeometry(node.cell); if (node.cell != null && g != null) { if (isVertexMovable(node.cell)) { g = setVertexLocation(node.cell, node.x, node.y); } if (bounds == null) { bounds = new mxRectangle(g.getX(), g.getY(), g.getWidth(), g.getHeight()); } else { bounds = new mxRectangle(Math.min(bounds.getX(), g.getX()), Math.min(bounds.getY(), g.getY()), Math.max(bounds.getX() + bounds.getWidth(), g.getX() + g.getWidth()), Math.max(bounds.getY() + bounds.getHeight(), g.getY() + g.getHeight())); } } return bounds; }
/** * Hook for subclassers to return the container size. */ public mxRectangle getContainerSize() { return new mxRectangle(); }
/** * Hook for subclassers to return the container size. */ public mxRectangle getContainerSize() { return new mxRectangle(); }
/** * Hook for subclassers to return the container size. */ public mxRectangle getContainerSize() { return new mxRectangle(); }
/** * Hook for subclassers to return the container size. */ public mxRectangle getContainerSize() { return new mxRectangle(); }
/** * */ public mxRectangle getBounds() { if (!valid) { createCoreCurve(); } return new mxRectangle(minXBounds, minYBounds, maxXBounds - minXBounds, maxYBounds - minYBounds); }
public mxRectangle getImageBounds(int x, int y, int width, int height) { int arc = getArcSize(width, height) / 2; int minSize = Math.min(width - arc*2, height - 4); mxRectangle imageBounds = new mxRectangle(x + arc, y+2, minSize, minSize); return imageBounds; }
/** * */ public mxRectangle getBounds() { if (!valid) { createCoreCurve(); } return new mxRectangle(minXBounds, minYBounds, maxXBounds - minXBounds, maxYBounds - minYBounds); }
public mxRectangle getImageBounds(int x, int y, int width, int height) { int arc = getArcSize(width, height) / 2; int minSize = Math.min(width - arc*2, height - 4); mxRectangle imageBounds = new mxRectangle(x + arc, y+2, minSize, minSize); return imageBounds; }
/** * Returns the size of the area that layouts can operate in. */ public mxRectangle getLayoutAreaSize() { if (pageVisible) { Dimension d = getPreferredSizeForPage(); return new mxRectangle(new Rectangle(d)); } else { return new mxRectangle(new Rectangle(graphControl.getSize())); } }
/** * Returns the size of the area that layouts can operate in. */ public mxRectangle getLayoutAreaSize() { if (pageVisible) { Dimension d = getPreferredSizeForPage(); return new mxRectangle(new Rectangle(d)); } else { return new mxRectangle(new Rectangle(graphControl.getSize())); } }
/** * Returns the rectangle that should be used as the perimeter of the cell. * * @return Returns the rectangle that defines the perimeter. */ public mxRectangle getPerimeterBounds(double border) { mxRectangle bounds = new mxRectangle(getRectangle()); if (border != 0) { bounds.grow(border); } return bounds; }
/** * Returns the rectangle that should be used as the perimeter of the cell. * * @return Returns the rectangle that defines the perimeter. */ public mxRectangle getPerimeterBounds(double border) { mxRectangle bounds = new mxRectangle(getRectangle()); if (border != 0) { bounds.grow(border); } return bounds; }
/** * */ protected mxRectangle getGradientBounds(mxGraphics2DCanvas canvas, mxCellState state) { double start = getTitleSize(canvas, state); if (mxUtils .isTrue(state.getStyle(), mxConstants.STYLE_HORIZONTAL, true)) { start = Math.min(start, state.getHeight()); return new mxRectangle(state.getX(), state.getY(), state.getWidth(), start); } else { start = Math.min(start, state.getWidth()); return new mxRectangle(state.getX(), state.getY(), start, state.getHeight()); } }
/** * */ protected mxRectangle getGradientBounds(mxGraphics2DCanvas canvas, mxCellState state) { double start = getTitleSize(canvas, state); if (mxUtils .isTrue(state.getStyle(), mxConstants.STYLE_HORIZONTAL, true)) { start = Math.min(start, state.getHeight()); return new mxRectangle(state.getX(), state.getY(), state.getWidth(), start); } else { start = Math.min(start, state.getWidth()); return new mxRectangle(state.getX(), state.getY(), start, state.getHeight()); } }
/** * First validates all bounds and then validates all points recursively on * all visible cells. */ public void validate() { mxRectangle graphBounds = getBoundingBox(validateCellState(validateCell((currentRoot != null) ? currentRoot : graph.getModel().getRoot()))); setGraphBounds((graphBounds != null) ? graphBounds : new mxRectangle()); }
/** * First validates all bounds and then validates all points recursively on * all visible cells. */ public void validate() { mxRectangle graphBounds = getBoundingBox(validateCellState(validateCell((currentRoot != null) ? currentRoot : graph.getModel().getRoot()))); setGraphBounds((graphBounds != null) ? graphBounds : new mxRectangle()); }
/** * */ protected mxRectangle apply(TreeNode node, mxRectangle bounds) { mxRectangle g = graph.getModel().getGeometry(node.cell); if (node.cell != null && g != null) { if (isVertexMovable(node.cell)) { g = setVertexLocation(node.cell, node.x, node.y); } if (bounds == null) { bounds = new mxRectangle(g.getX(), g.getY(), g.getWidth(), g.getHeight()); } else { bounds = new mxRectangle(Math.min(bounds.getX(), g.getX()), Math.min(bounds.getY(), g.getY()), Math.max(bounds.getX() + bounds.getWidth(), g.getX() + g.getWidth()), Math.max(bounds.getY() + bounds.getHeight(), g.getY() + g.getHeight())); } } return bounds; }
/** * */ protected mxRectangle apply(TreeNode node, mxRectangle bounds) { mxRectangle g = graph.getModel().getGeometry(node.cell); if (node.cell != null && g != null) { if (isVertexMovable(node.cell)) { g = setVertexLocation(node.cell, node.x, node.y); } if (bounds == null) { bounds = new mxRectangle(g.getX(), g.getY(), g.getWidth(), g.getHeight()); } else { bounds = new mxRectangle(Math.min(bounds.getX(), g.getX()), Math.min(bounds.getY(), g.getY()), Math.max(bounds.getX() + bounds.getWidth(), g.getX() + g.getWidth()), Math.max(bounds.getY() + bounds.getHeight(), g.getY() + g.getHeight())); } } return bounds; }
/** * Swaps the x, y, width and height with the values stored in * alternateBounds and puts the previous values into alternateBounds as * a rectangle. This operation is carried-out in-place, that is, using the * existing geometry instance. If this operation is called during a graph * model transactional change, then the geometry should be cloned before * calling this method and setting the geometry of the cell using * mxGraphModel.setGeometry. */ public void swap() { if (alternateBounds != null) { mxRectangle old = new mxRectangle(getX(), getY(), getWidth(), getHeight()); x = alternateBounds.getX(); y = alternateBounds.getY(); width = alternateBounds.getWidth(); height = alternateBounds.getHeight(); alternateBounds = old; } }