Chart FX for Java 6.5

SoftwareFX.ChartFX
Class Title

java.lang.Object
  extended by SoftwareFX.ChartFX.Title
Direct Known Subclasses:
TitleDockable

public final class Title
extends java.lang.Object

Provides access to the Title object.

Titles are a new object added on latest version of ChartFX. Now users can create as many titles as they wish on their chart.

As an object, titles have diverse properties that can be accessed in order to change their appearance.


Constructor Summary
Title()
           
 
Method Summary
 int getAlignment()
          Gets the Alignment.
 java.awt.Color getBackColor()
          Gets the BackColor.
 int getFlags()
          Gets the Flags.
 java.awt.Font getFont()
          Gets the Font.
 int getGap()
          Gets the Gap.
 int getLineGap()
          Gets the LineGap.
 Link getLink()
          Gets the Link object for a selected title item.
 java.lang.String getText()
          Gets the Text.
 java.awt.Color getTextColor()
          Gets the TextColor.
 java.lang.String getURL()
          Deprecated. You should use Title.getLink().getUrl instead.
 boolean isDrawingArea()
          Gets the DrawingArea.
 void setAlignment(int value)
          Allows you to set the alignment of a specified title.
 void setBackColor(java.awt.Color value)
          Sets the color background of the specified title.
 void setDrawingArea(boolean value)
          Specifies if the top title header will stretch the entire length of the chart, or only above the drawing area of the chart.
 void setFlags(int value)
          Allows you to set flags in order to format the title with the desired attributes.
 void setFont(java.awt.Font value)
          Assigns a font to the specified title.
 void setGap(int value)
          Specify the space in pixels to the front and back of the selected title string when read from right to left.
 void setLineGap(int value)
          Specify the space in pixels above and below the selected title text when read from right to left.
 void setText(java.lang.String value)
          Used to set the text for a selected title.
 void setTextColor(java.awt.Color value)
          Sets the color of text for the specified title.
 void setURL(java.lang.String value)
          Deprecated. You should use Title.getLink().setUrl instead.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Title

public Title()
Method Detail

getAlignment

public int getAlignment()

Gets the Alignment. For more detail see setAlignment(int).


getBackColor

public java.awt.Color getBackColor()

Gets the BackColor. For more detail see setBackColor(java.awt.Color).


getFlags

public int getFlags()

Gets the Flags. For more detail see setFlags(int).


getFont

public java.awt.Font getFont()

Gets the Font. For more detail see setFont(java.awt.Font).


getGap

public int getGap()

Gets the Gap. For more detail see setGap(int).


getLineGap

public int getLineGap()

Gets the LineGap. For more detail see setLineGap(int).


getLink

public Link getLink()

Gets the Link object for a selected title item.

Remarks:
  • Developers may obtain the Link object for a title item using this property. Using the supported Link class members, developers may configure a Link.setUrl(java.lang.String) and Link.setTarget(java.lang.String) for the object.

  • See Also:
    Link.setUrl(java.lang.String), Link.setTarget(java.lang.String), Link

    getText

    public java.lang.String getText()

    Gets the Text. For more detail see setText(java.lang.String).


    getTextColor

    public java.awt.Color getTextColor()

    Gets the TextColor. For more detail see setTextColor(java.awt.Color).


    getURL

    public java.lang.String getURL()
    Deprecated. You should use Title.getLink().getUrl instead.

    See Also:
    getLink()

    isDrawingArea

    public boolean isDrawingArea()

    Gets the DrawingArea. For more detail see setDrawingArea(boolean).


    setAlignment

    public void setAlignment(int value)

    Allows you to set the alignment of a specified title.

    Values:
    StringAlignment : The StringAlignment type specifies how a string is aligned in reference to the bounding rectangle. A bounding rectangle is used to define the area in which the text displays.
    ValueDescription
    StringAlignment.STRING_ALIGNMENT_NEARSpecifies that alignment is towards the origin of the bounding rectangle. May be used for alignment of characters along the line or for alignment of lines within the rectangle. For a right to left bounding rectangle, the origin is at the upper right.
    StringAlignment.STRING_ALIGNMENT_CENTERSpecifies that alignment is centered between origin and extent (width) of the formatting rectangle.
    StringAlignment.STRING_ALIGNMENT_FARSpecifies that alignment is to the far extent (right side) of the formatting rectangle.

    Remarks:
  • The alignment of a specified title may be assigned to Near, Center or Far using this property. Reading the chart from left to right, Near will be to the left and Far will be to the right.

  • The Alignment property may also be used for Axis AxisBase.setTitle(SoftwareFX.ChartFX.Title) by utilizing the Axis Class .

  • The TitleDockable.setLineAlignment(int) property can be used to position the top title vertically in the title area.

  • For information regarding the StringAlignment type refer to Java API .

  • See Also:
    TitleDockable.setLineAlignment(int), AxisBase.setTitle(SoftwareFX.ChartFX.Title), Axis, TitleDockable

    setBackColor

    public void setBackColor(java.awt.Color value)

    Sets the color background of the specified title.

    Remarks:
  • This property gives the titles of a chart a highlighted effect. It is best to select colors that contrast to the setTextColor(java.awt.Color) in order to view the titles clearly.

  • The BackColor property may also be applied to the Axis AxisBase.setTitle(SoftwareFX.ChartFX.Title).

  • See Java API documentation for information regarding the Color type.

  • See Also:
    setTextColor(java.awt.Color), AxisBase.setTitle(SoftwareFX.ChartFX.Title), Axis

    setDrawingArea

    public void setDrawingArea(boolean value)

    Specifies if the top title header will stretch the entire length of the chart, or only above the drawing area of the chart.

    Remarks:
  • When set to True, the top title header is only above the chart's drawing area. When set to False, the top title header is across the entire chart.

  • When using the setAlignment(int) property, the DrawingArea property will effect the position of the text when configured to near and far.

  • See Also:
    setAlignment(int), setText(java.lang.String)

    setFlags

    public void setFlags(int value)

    Allows you to set flags in order to format the title with the desired attributes.

    Values:
    TitleFlag : Define Attributes for Titles object that may be set using Flag property
    ValueDescription
    TitleFlag.HIDDENHides the selected title.
    TitleFlag.EXCLUDE_FROM_BORDERIf Border are presented, the title area will go over the border.
    TitleFlag.NO_CHANGE_DOCK_AREAHaving this flag ON, it won't be possible to dock the selected title on a different position. The property DockArea won't have any affect.
    TitleFlag.HIDDEN_BY_BORDERIf border are presented, the portion of the title area overlapping with the portion of border area will be hidden by the border figure.
    TitleFlag.DRAWING_AREAHaving this flag ON, the title area will be only the drawing area in other case it will occupy the full area.

    Remarks:
  • Using this property allows you to specify a format for the selected title.

  • You set this property using the bitwise operators (And, Or, Not, Xor) provided by your development tool.

    For example, the correct way to turn ON the Editable setting:

    chart1.getTitle(0).setFlags(chart1.getTitle(0).getFlags() | TitleFlag.DRAWING_AREA | TitleFlag.NO_CHANGE_DOCK_AREA);

    The following code is WRONG (it will erase all other settings in the property causing an erratic behavior of the library and an incorrect setting of the individual properties which also control these flags.):

    chart1.getTitle(0).setFlags(TitleFlag.DRAWING_AREA | TitleFlag.NO_CHANGE_DOCK_AREA;

  • See Also:
    ChartCore.setChartStyle(int), ChartCore.setStyleEx(int), ChartCore.setTypeEx(int), Chart

    setFont

    public void setFont(java.awt.Font value)

    Assigns a font to the specified title.

    Remarks:
  • You can set the font for the entire chart using the Chart object Chart.setFont(java.awt.Font) property.

  • When setting a font in Chart FX, you must create a new font object with the desired attributes and assign that object to the desired chart element every time you want to change the font.

  • For more information regarding the Font type, please refer to the Java API Documentation.

  • See Also:
    setText(java.lang.String), Chart.setFont(java.awt.Font), Chart

    setGap

    public void setGap(int value)

    Specify the space in pixels to the front and back of the selected title string when read from right to left.

    Remarks:
  • This property assigns space in pixels around a Title string in reference to the title orientation. If the Title text reads horizontally (top title), space will be assigned to the right and left of the string. If the Title text reads vertically (Y Axis title), the space will be assigned above and below the string.

  • The setLineGap(int) property may be used to add space in pixels above and below the title string when read from right to left.

  • See Also:
    ChartCore.setBottomGap(int), ChartCore.setLeftGap(int), ChartCore.setRightGap(int), ChartCore.setTopGap(int), Axis.setSeparation(int), setLineGap(int), setText(java.lang.String), Axis, Chart

    setLineGap

    public void setLineGap(int value)

    Specify the space in pixels above and below the selected title text when read from right to left.

    Remarks:
  • This property assigns space in pixels around a Title string in reference to the title orientation. If the Title text reads horizontally (top title), space will be assigned above and below the string. If the Title text reads vertically (Y Axis title), the space will be assigned to the right and left of the string.

  • The setGap(int) property may be used to add space in pixels to the front and back of the title string when read from right to left.

  • See Also:
    setGap(int), setText(java.lang.String), Axis

    setText

    public void setText(java.lang.String value)

    Used to set the text for a selected title.

    Remarks:
  • The setTextColor(java.awt.Color) property allows you to change the color of the specified title text.

  • Multiple titles are supported in Chart FX, for more information please refer to the ChartCore.getTitles() property of the Chart Class .

  • Titles can also be applied to a specific axis through the use of the AxisBase.setTitle(SoftwareFX.ChartFX.Title) property of the Axis Class .

  • See Also:
    setTextColor(java.awt.Color), AxisBase.setTitle(SoftwareFX.ChartFX.Title), ChartCore.getTitles(), Chart, Axis

    setTextColor

    public void setTextColor(java.awt.Color value)

    Sets the color of text for the specified title.

    Remarks:
  • The TextColor property is used in conjunction with the setText(java.lang.String) property.

  • For more information regarding the Color type, please refer to the Java API Documentation.

  • See Also:
    ChartCore.getAxisX(), ChartCore.getAxisY(), setText(java.lang.String), Axis

    setURL

    public void setURL(java.lang.String value)
    Deprecated. You should use Title.getLink().setUrl instead.

    See Also:
    getLink()

    http://www.softwarefx.com

    2007 Software FX, Inc. All Rights Reserved. Chart FX is a registered trademark of Software FX, Inc
    All other names are trademarks or registered trademarks of their respective owners.