/** * Returns the value for key in dictionary as a color or null if no value is * defined for the key. * * @param dict * Dictionary that contains the key, value pairs. * @param key * Key whose value should be returned. * @return Returns the color value for key in dict. */ public static Color getColor(Map<String, Object> dict, String key) { return getColor(dict, key, null); }
/** * Returns the value for key in dictionary as a color or null if no value is * defined for the key. * * @param dict * Dictionary that contains the key, value pairs. * @param key * Key whose value should be returned. * @return Returns the color value for key in dict. */ public static Color getColor(Map<String, Object> dict, String key) { return getColor(dict, key, null); }
/** * */ 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); }
/** * */ public Color getFillColor(mxGraphics2DCanvas canvas, mxCellState state) { return mxUtils.getColor(state.getStyle(), mxConstants.STYLE_FILLCOLOR); }
/** * */ 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_STROKECOLOR); }
/** * */ public Color getFillColor(mxGraphics2DCanvas canvas, mxCellState state) { return mxUtils.getColor(state.getStyle(), mxConstants.STYLE_FILLCOLOR); }
/** * */ 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); }
public Object drawLabel(String text, mxCellState state, boolean html) { Map<String, Object> style = state.getStyle(); mxITextShape shape = getTextShape(style, html); if (g != null && shape != null && drawLabels && text != null && text.length() > 0) { // Creates a temporary graphics instance for drawing this shape float opacity = mxUtils.getFloat(style, mxConstants.STYLE_TEXT_OPACITY, 100); Graphics2D previousGraphics = g; g = createTemporaryGraphics(style, opacity, null); // Draws the label background and border Color bg = mxUtils.getColor(style, mxConstants.STYLE_LABEL_BACKGROUNDCOLOR); Color border = mxUtils.getColor(style, mxConstants.STYLE_LABEL_BORDERCOLOR); paintRectangle(state.getLabelBounds().getRectangle(), bg, border); // Paints the label and restores the graphics object shape.paintShape(this, text, state, style); g.dispose(); g = previousGraphics; } return shape; }
public Object drawLabel(String text, mxCellState state, boolean html) { Map<String, Object> style = state.getStyle(); mxITextShape shape = getTextShape(style, html); if (g != null && shape != null && drawLabels && text != null && text.length() > 0) { // Creates a temporary graphics instance for drawing this shape float opacity = mxUtils.getFloat(style, mxConstants.STYLE_TEXT_OPACITY, 100); Graphics2D previousGraphics = g; g = createTemporaryGraphics(style, opacity, null); // Draws the label background and border Color bg = mxUtils.getColor(style, mxConstants.STYLE_LABEL_BACKGROUNDCOLOR); Color border = mxUtils.getColor(style, mxConstants.STYLE_LABEL_BORDERCOLOR); paintRectangle(state.getLabelBounds().getRectangle(), bg, border); // Paints the label and restores the graphics object shape.paintShape(this, text, state, style); g.dispose(); g = previousGraphics; } return shape; }
Color fontColor = mxUtils.getColor(state.getStyle(), mxConstants.STYLE_FONTCOLOR, Color.black); textArea.setForeground(fontColor);
Color fontColor = mxUtils.getColor(state.getStyle(), mxConstants.STYLE_FONTCOLOR, Color.black); textArea.setForeground(fontColor);