/** * */ public Graphics2D createTemporaryGraphics(Map<String, Object> style, float opacity, mxRectangle bounds) { Graphics2D temporaryGraphics = (Graphics2D) g.create(); // Applies the default translate temporaryGraphics.translate(translate.x, translate.y); // Applies the rotation on the graphics object if (bounds != null) { double rotation = mxUtils.getDouble(style, mxConstants.STYLE_ROTATION, 0); if (rotation != 0) { temporaryGraphics.rotate(Math.toRadians(rotation), bounds.getCenterX(), bounds.getCenterY()); } } // Applies the opacity to the graphics object if (opacity != 100) { temporaryGraphics.setComposite(AlphaComposite.getInstance( AlphaComposite.SRC_OVER, opacity / 100)); } return temporaryGraphics; }
/** * */ public Graphics2D createTemporaryGraphics(Map<String, Object> style, float opacity, mxRectangle bounds) { Graphics2D temporaryGraphics = (Graphics2D) g.create(); // Applies the default translate temporaryGraphics.translate(translate.getX(), translate.getY()); // Applies the rotation on the graphics object if (bounds != null) { double rotation = mxUtils.getDouble(style, mxConstants.STYLE_ROTATION, 0); if (rotation != 0) { temporaryGraphics.rotate(Math.toRadians(rotation), bounds.getCenterX(), bounds.getCenterY()); } } // Applies the opacity to the graphics object if (opacity != 100) { temporaryGraphics.setComposite(AlphaComposite.getInstance( AlphaComposite.SRC_OVER, opacity / 100)); } return temporaryGraphics; }
labelbounds.getCenterX(), labelbounds.getCenterY()); temporaryGraphics.translate( - plusx, plusy);
mxPoint cx = new mxPoint(bounds.getCenterX(), bounds.getCenterY()); String direction = mxUtils.getString(vertex.getStyle(), mxConstants.STYLE_DIRECTION); point.setX(2 * bounds.getCenterX() - point.getX());
/** * Scrolls the graph so that it shows the given cell. * * @param cell */ public void scrollCellToVisible(Object cell, boolean center) { mxCellState state = graph.getView().getState(cell); if (state != null) { mxRectangle bounds = state; if (center) { bounds = (mxRectangle) bounds.clone(); bounds.setX(bounds.getCenterX() - getWidth() / 2); bounds.setWidth(getWidth()); bounds.setY(bounds.getCenterY() - getHeight() / 2); bounds.setHeight(getHeight()); } getGraphControl().scrollRectToVisible(bounds.getRectangle()); } }
public mxPoint apply(mxRectangle bounds, mxCellState vertex, mxPoint next, boolean orthogonal) { double cx = bounds.getCenterX(); double cy = bounds.getCenterY(); double nx = next.getX();
/** * Scrolls the graph so that it shows the given cell. * * @param cell */ public void scrollCellToVisible(Object cell, boolean center) { mxCellState state = graph.getView().getState(cell); if (state != null) { mxRectangle bounds = state; if (center) { bounds = (mxRectangle) bounds.clone(); bounds.setX(bounds.getCenterX() - getWidth() / 2); bounds.setWidth(getWidth()); bounds.setY(bounds.getCenterY() - getHeight() / 2); bounds.setHeight(getHeight()); } getGraphControl().scrollRectToVisible(bounds.getRectangle()); } }
public mxPoint apply(mxRectangle bounds, mxCellState vertex, mxPoint next, boolean orthogonal) double cx = bounds.getCenterX(); double cy = bounds.getCenterY(); double dx = next.getX() - cx;
public mxPoint apply(mxRectangle bounds, mxCellState vertex, mxPoint next, boolean orthogonal) double cx = bounds.getCenterX(); double cy = bounds.getCenterY(); double dx = next.getX() - cx;
double h = bounds.getHeight(); double cx = bounds.getCenterX(); double cy = bounds.getCenterY(); double px = next.getX();
double h = bounds.getHeight(); double cx = bounds.getCenterX(); double cy = bounds.getCenterY(); double px = next.getX();