Package com.mxgraph.shape

Examples of com.mxgraph.shape.mxITextShape


   * @see com.mxgraph.canvas.mxICanvas#drawLabel()
   */
  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;
View Full Code Here


   * @see com.mxgraph.canvas.mxICanvas#drawLabel()
   */
  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;
View Full Code Here

   * @see com.mxgraph.canvas.mxICanvas#drawLabel()
   */
  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;
View Full Code Here

TOP

Related Classes of com.mxgraph.shape.mxITextShape

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.