public class mxGraphExtended extends mxGraph { @Override public void drawCell(mxICanvas canvas, Object cell) { // add the cell's id as a style attribute // cause canvas only get the style and geometry mxCellState state = this.getView().getState(cell); state.getStyle().put("cellid", ((mxCell)cell).getId()); super.drawCell(canvas, cell); } }
/** * */ public boolean hasShadow(mxGraphics2DCanvas canvas, mxCellState state) { return mxUtils .isTrue(state.getStyle(), mxConstants.STYLE_SHADOW, false); }
/** * */ public Color getFillColor(mxGraphics2DCanvas canvas, mxCellState state) { return mxUtils.getColor(state.getStyle(), mxConstants.STYLE_IMAGE_BACKGROUND); }
/** * */ public Color getStrokeColor(mxGraphics2DCanvas canvas, mxCellState state) { return mxUtils .getColor(state.getStyle(), mxConstants.STYLE_STROKECOLOR); }
/** * */ public Color getStrokeColor(mxGraphics2DCanvas canvas, mxCellState state) { return mxUtils .getColor(state.getStyle(), mxConstants.STYLE_STROKECOLOR); }
/** * Helper method to configure the given wrapper canvas. */ protected double getArcSize(mxCellState state, double start) { double f = mxUtils.getDouble(state.getStyle(), mxConstants.STYLE_ARCSIZE, mxConstants.RECTANGLE_ROUNDING_FACTOR * 100) / 100; return start * f * 3; }
/** * */ public String getImageForStyle(mxGraphics2DCanvas canvas, mxCellState state) { return canvas.getImageForStyle(state.getStyle()); }
/** * */ public Color getFillColor(mxGraphics2DCanvas canvas, mxCellState state) { return mxUtils.getColor(state.getStyle(), mxConstants.STYLE_FILLCOLOR); }
/** * Helper method to configure the given wrapper canvas. */ protected double getArcSize(mxCellState state, double start) { double f = mxUtils.getDouble(state.getStyle(), mxConstants.STYLE_ARCSIZE, mxConstants.RECTANGLE_ROUNDING_FACTOR * 100) / 100; return start * f * 3; }
/** * */ public Color getFillColor(mxGraphics2DCanvas canvas, mxCellState state) { return mxUtils.getColor(state.getStyle(), mxConstants.STYLE_FILLCOLOR); }
/** * */ public Color getStrokeColor(mxGraphics2DCanvas canvas, mxCellState state) { return mxUtils.getColor(state.getStyle(), mxConstants.STYLE_IMAGE_BORDER); }
/** * */ public Color getFillColor(mxGraphics2DCanvas canvas, mxCellState state) { return mxUtils.getColor(state.getStyle(), mxConstants.STYLE_IMAGE_BACKGROUND); }
/** * */ public Color getStrokeColor(mxGraphics2DCanvas canvas, mxCellState state) { return mxUtils.getColor(state.getStyle(), mxConstants.STYLE_IMAGE_BORDER); }
/** * */ public Color getStrokeColor(mxGraphics2DCanvas canvas, mxCellState state) { return mxUtils .getColor(state.getStyle(), mxConstants.STYLE_STROKECOLOR); }
/** * Returns the x-coordinate of the center point for automatic routing. * * @return Returns the x-coordinate of the routing center point. */ public double getRoutingCenterX(mxCellState state) { float f = (state.getStyle() != null) ? mxUtils.getFloat( state.getStyle(), mxConstants.STYLE_ROUTING_CENTER_X) : 0; return state.getCenterX() + f * state.getWidth(); }
/** * Returns the x-coordinate of the center point for automatic routing. * * @return Returns the x-coordinate of the routing center point. */ public double getRoutingCenterX(mxCellState state) { float f = (state.getStyle() != null) ? mxUtils.getFloat( state.getStyle(), mxConstants.STYLE_ROUTING_CENTER_X) : 0; return state.getCenterX() + f * state.getWidth(); }
/** * Returns the y-coordinate of the center point for automatic routing. * * @return Returns the y-coordinate of the routing center point. */ public double getRoutingCenterY(mxCellState state) { float f = (state.getStyle() != null) ? mxUtils.getFloat( state.getStyle(), mxConstants.STYLE_ROUTING_CENTER_Y) : 0; return state.getCenterY() + f * state.getHeight(); }
/** * Returns the bounding box for the gradient box for this shape. */ protected double getTitleSize(mxGraphics2DCanvas canvas, mxCellState state) { return Math.max( 0, mxUtils.getFloat(state.getStyle(), mxConstants.STYLE_STARTSIZE, mxConstants.DEFAULT_STARTSIZE) * canvas.getScale()); };
/** * Returns the perimeter bounds for the given terminal, edge pair. */ public mxRectangle getPerimeterBounds(mxCellState terminal, double border) { if (terminal != null) { border += mxUtils.getDouble(terminal.getStyle(), mxConstants.STYLE_PERIMETER_SPACING); } return terminal.getPerimeterBounds(border * scale); }
/** * */ public void paintShape(mxGraphics2DCanvas canvas, mxCellState state) { super.paintShape(canvas, state); if (mxUtils.isTrue(state.getStyle(), mxConstants.STYLE_GLASS, false)) { drawGlassEffect(canvas, state); } }