org.jCharts.chartText

## Class TextTag

- java.lang.Object
- - org.jCharts.chartText.TextTag

- All Implemented Interfaces:
    Serializable, HTMLTestable
  Direct Known Subclasses:
    BarValueGroup.BarValue

      public class TextTag
      extends Object
      implements HTMLTestable, Serializable

  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private Hashtable` | `attributes`
    `private Font` | `derivedFont`
    `private Font` | `font`
    `private float` | `fontAscent`
    `private float` | `fontDescent`
    `private float` | `height`
    `private boolean` | `isDerived`
    `private boolean` | `isHidden`
    `private String` | `text`
    `private TextLayout` | `textLayout`
    `private float` | `width`
    `private float` | `xPosition`
    `private float` | `yPosition`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TextTag(String text, Font baseFont, Font derivedFont, FontRenderContext fontRenderContext)` Constructor when using transformed (derived) fonts The need for this arises because the java metrics classes return either 0 or very strange values for the width and height of a string (TextLayout, LineMetrics, etc..) when the font is derived
    `TextTag(String text, Font baseFont, FontRenderContext fontRenderContext)` Default constructor - for untransformed fonts.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAttribute(String name, Object o)`
    `Object` | `getAttribute(String name)`
    `float` | `getBottomSide()`
    `float` | `getFontAscent()`
    `float` | `getFontDescent()`
    `float` | `getHeight()`
    `boolean` | `getHidden()`
    `Rectangle2D.Float` | `getRectangle()`
    `float` | `getRightSide()`
    `String` | `getText()`
    `float` | `getWidth()`
    `float` | `getXPosition()`
    `float` | `getYPosition()`
    `void` | `render(Graphics2D g2d, float x, float y)` Renders the text, at the position - renders from the top (instead of baseline)
    `void` | `render(Graphics2D g2d, Paint fontColor)` Renders the text, at the position - renders from the top (instead of baseline)
    `void` | `setHidden(boolean b)`
    `void` | `setPosition(float x, float y)`
    `void` | `setXPosition(float x)`
    `void` | `setYPosition(float y)`
    `void` | `toHTML(HTMLGenerator htmlGenerator)` Enables the testing routines to display the contents of this Object.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### xPosition

          private float xPosition

    - #### yPosition

          private float yPosition

    - #### textLayout

          private TextLayout textLayout

    - #### attributes

          private Hashtable attributes

    - #### isHidden

          private boolean isHidden

    - #### width

          private float width

    - #### height

          private float height

    - #### fontAscent

          private float fontAscent

    - #### fontDescent

          private float fontDescent

    - #### isDerived

          private boolean isDerived

    - #### derivedFont

          private Font derivedFont

    - #### text

          private String text

    - #### font

          private Font font

  - ### Constructor Detail

    - #### TextTag

          public TextTag(String text,
                         Font baseFont,
                         FontRenderContext fontRenderContext)

      Default constructor - for untransformed fonts.

    - #### TextTag

          public TextTag(String text,
                         Font baseFont,
                         Font derivedFont,
                         FontRenderContext fontRenderContext)

      Constructor when using transformed (derived) fonts The need for this arises because the java metrics classes return either 0 or very strange values for the width and height of a string (TextLayout, LineMetrics, etc..) when the font is derived
      Parameters:
        `text` -
        `baseFont` - is the original (untransformed) font.
        `derivedFont` - is the transformed font
        `fontRenderContext` -

  - ### Method Detail

    - #### getWidth

          public float getWidth()

    - #### getHeight

          public float getHeight()

    - #### getFontAscent

          public float getFontAscent()

    - #### getFontDescent

          public float getFontDescent()

    - #### setPosition

          public void setPosition(float x,
                                  float y)

    - #### setXPosition

          public void setXPosition(float x)

    - #### setYPosition

          public void setYPosition(float y)

    - #### getXPosition

          public float getXPosition()

    - #### getYPosition

          public float getYPosition()

    - #### getRightSide

          public float getRightSide()

    - #### getBottomSide

          public float getBottomSide()

    - #### getRectangle

          public Rectangle2D.Float getRectangle()

    - #### setHidden

          public void setHidden(boolean b)

    - #### getHidden

          public boolean getHidden()

    - #### getText

          public String getText()

    - #### addAttribute

          public void addAttribute(String name,
                                   Object o)

    - #### getAttribute

          public Object getAttribute(String name)

    - #### render

          public void render(Graphics2D g2d,
                             Paint fontColor)

      Renders the text, at the position - renders from the top (instead of baseline)
      Parameters:
        `g2d` -
        `fontColor` -

    - #### render

          public void render(Graphics2D g2d,
                             float x,
                             float y)

      Renders the text, at the position - renders from the top (instead of baseline)
      Parameters:
        `g2d` -

    - #### toHTML

          public void toHTML(HTMLGenerator htmlGenerator)

      Enables the testing routines to display the contents of this Object.
      Specified by:
        `toHTML` in interface `HTMLTestable`
      Parameters:
        `htmlGenerator` -

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`
      Returns: