/** * */ 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.setY(2 * bounds.getCenterY() - point.getY());
/** * 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()); } }
boolean orthogonal) { double cx = bounds.getCenterX(); double cy = bounds.getCenterY(); double nx = next.getX(); double ny = next.getY();
/** * 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()); } }
double cy = bounds.getCenterY(); double dx = next.getX() - cx; double dy = next.getY() - cy;
double cy = bounds.getCenterY(); double dx = next.getX() - cx; double dy = next.getY() - cy;
double cy = bounds.getCenterY(); double px = next.getX(); double py = next.getY();
double cy = bounds.getCenterY(); double px = next.getX(); double py = next.getY();