/** * Processes the changes and returns the minimal rectangle to be * repainted in the buffer. A return value of null means no repaint * is required. */ public mxRectangle processChanges(List<mxUndoableChange> changes, boolean invalidate, boolean ignoreDirty) { mxRectangle bounds = null; Iterator<mxUndoableChange> it = changes.iterator(); while (it.hasNext()) { mxRectangle rect = processChange(it.next(), invalidate, ignoreDirty); if (bounds == null) { bounds = rect; } else { bounds.add(rect); } } return bounds; }
/** * Processes the changes and returns the minimal rectangle to be * repainted in the buffer. A return value of null means no repaint * is required. */ public mxRectangle processChanges(List<mxUndoableChange> changes, boolean invalidate, boolean ignoreDirty) { mxRectangle bounds = null; Iterator<mxUndoableChange> it = changes.iterator(); while (it.hasNext()) { mxRectangle rect = processChange(it.next(), invalidate, ignoreDirty); if (bounds == null) { bounds = rect; } else { bounds.add(rect); } } return bounds; }
/** * Returns the bounds for the given cells. */ public mxRectangle getBoundsForCells(Object[] cells, boolean includeEdges, boolean includeDescendants, boolean boundingBox) { mxRectangle result = null; if (cells != null && cells.length > 0) { for (int i = 0; i < cells.length; i++) { mxRectangle tmp = getCellBounds(cells[i], includeEdges, includeDescendants, boundingBox); if (tmp != null) { if (result == null) { result = new mxRectangle(tmp); } else { result.add(tmp); } } } } return result; }
/** * Returns the bounds for the given cells. */ public mxRectangle getBoundsForCells(Object[] cells, boolean includeEdges, boolean includeDescendants, boolean boundingBox) { mxRectangle result = null; if (cells != null && cells.length > 0) { for (int i = 0; i < cells.length; i++) { mxRectangle tmp = getCellBounds(cells[i], includeEdges, includeDescendants, boundingBox); if (tmp != null) { if (result == null) { result = new mxRectangle(tmp); } else { result.add(tmp); } } } } return result; }
/** * */ public void mouseDragged(MouseEvent e) { if (graphComponent.isEnabled() && isEnabled() && !e.isConsumed() && first != null) { mxRectangle dirty = current; current = new mxRectangle(first.x, first.y, 0, 0); current.add(new mxRectangle(e.getX(), e.getY(), 0, 0)); if (dirty != null) { dirty.add(current); } else { dirty = current; } Rectangle tmp = dirty.getRectangle(); int b = (int) Math.ceil(lineWidth); graphComponent.getGraphControl().repaint(tmp.x - b, tmp.y - b, tmp.width + 2 * b, tmp.height + 2 * b); e.consume(); } }
/** * */ public void mouseDragged(MouseEvent e) { if (graphComponent.isEnabled() && isEnabled() && !e.isConsumed() && first != null) { mxRectangle dirty = current; current = new mxRectangle(first.x, first.y, 0, 0); current.add(new mxRectangle(e.getX(), e.getY(), 0, 0)); if (dirty != null) { dirty.add(current); } else { dirty = current; } Rectangle tmp = dirty.getRectangle(); int b = (int) Math.ceil(lineWidth); graphComponent.getGraphControl().repaint(tmp.x - b, tmp.y - b, tmp.width + 2 * b, tmp.height + 2 * b); e.consume(); } }
+ PI4 + initialAngle; dirty.add(mxUtils.getBoundingBox(currentState, currentAngle
+ PI4 + initialAngle; dirty.add(mxUtils.getBoundingBox(currentState, currentAngle
/** * Returns the bounding box for the geometries of the vertices in the * given array of cells. */ public mxRectangle getBoundingBoxFromGeometry(Object[] cells) { mxRectangle result = null; if (cells != null) { for (int i = 0; i < cells.length; i++) { if (getModel().isVertex(cells[i])) { mxGeometry geo = getCellGeometry(cells[i]); if (result == null) { result = new mxRectangle(geo); } else { result.add(geo); } } } } return result; }
/** * Returns the bounding box for the geometries of the vertices in the * given array of cells. */ public mxRectangle getBoundingBoxFromGeometry(Object[] cells) { mxRectangle result = null; if (cells != null) { for (int i = 0; i < cells.length; i++) { if (getModel().isVertex(cells[i])) { mxGeometry geo = getCellGeometry(cells[i]); if (result == null) { result = new mxRectangle(geo); } else { result.add(geo); } } } } return result; }
/** * */ protected Rectangle getDirtyRect(mxRectangle dirty) { if (previewState != null) { mxRectangle tmp = graphComponent.getGraph().getPaintBounds( new Object[] { previewState.getCell() }); if (dirty != null) { dirty.add(tmp); } else { dirty = tmp; } if (dirty != null) { // TODO: Take arrow size into account dirty.grow(2); return dirty.getRectangle(); } } return null; }
/** * */ protected Rectangle getDirtyRect(mxRectangle dirty) { if (previewState != null) { mxRectangle tmp = graphComponent.getGraph().getPaintBounds( new Object[] { previewState.getCell() }); if (dirty != null) { dirty.add(tmp); } else { dirty = tmp; } if (dirty != null) { // TODO: Take arrow size into account dirty.grow(2); return dirty.getRectangle(); } } return null; }
result.add(tmp);
result.add(tmp);
bbox.add(bounds);
bbox.add(bounds);
bbox.add(bounds);
bbox.add(bounds);
tmp.add(state.getLabelBounds());
tmp.add(state.getLabelBounds());