Chart FX for Java 6.2

SoftwareFX.ChartFX
Class TitleDockable

java.lang.Object
  extended bySoftwareFX.ChartFX.TitleDockable

public final class TitleDockable
extends java.lang.Object

Provides access to the TitleDockable object.

The TitleDockable Class provides the developer with a means of controlling positioning and alignment for configured titles in a chart as well as visual attributes. Using the supported members, you can adjust title strings to be center, near and fear as well as dock them in the right, left, top, or bottom of the chart. To dock a title or use line alignment attributes, chart title objects must be created as a TitleDockable rather than a general Title object.


Constructor Summary
TitleDockable()
           
 
Method Summary
 int getAlignment()
          Allows you to set the alignment of a specified title.
 java.awt.Color getBackColor()
          Sets the color background of the specified title.
 int getDockArea()
          Allows you to set where the title will be docked.
 int getFlags()
          Allows you to set flags in order to format the title with the desired attributes.
 java.awt.Font getFont()
          Assigns a font to the specified title.
 int getGap()
          Specify the space in pixels to the front and back of the selected title string when read from right to left.
 int getLineAlignment()
          Sets the vertical alignment for the lines of the chart title.
 int getLineGap()
          Specify the space in pixels above and below the selected title text when read from right to left.
 Link getLink()
          Gets the Link object for a selected title item.
 java.lang.String getText()
          Used to set the text for a selected title.
 java.awt.Color getTextColor()
          Sets the color of text for the specified title.
 java.lang.String getURL()
          Deprecated. You should use TitleDockable.getLink().getUrl instead.
 boolean isDrawingArea()
          Specifies if the top title header will stretch the entire length of the chart, or only above the drawing area of the chart.
 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 setDockArea(int value)
          Allows you to set where the title will be docked.
 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 setLineAlignment(int value)
          Sets the vertical alignment for the lines of the chart title.
 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 TitleDockable.getLink().setUrl instead.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TitleDockable

public TitleDockable()
Method Detail

getAlignment

public int getAlignment()

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
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.
STRING_ALIGNMENT_CENTERSpecifies that alignment is centered between origin and extent (width) of the formatting rectangle.
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 Axis.setTitle(SoftwareFX.ChartFX.Title) by utilizing the Axis.

  • The 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:
    setLineAlignment(int), Axis.setTitle(SoftwareFX.ChartFX.Title), Axis, TitleDockable

    getBackColor

    public java.awt.Color getBackColor()

    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 Title.setTextColor(java.awt.Color) in order to view the titles clearly.

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

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

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

    getDockArea

    public int getDockArea()

    Allows you to set where the title will be docked.

    Values:
    DockArea : Define how to set the docked selected tool position
    ValueDescription
    LEFTDocks the selected tool to the left margin.
    TOPDocks the selected tool to the top margin.
    RIGHTDocks the selected tool to the right margin.
    BOTTOMDocks the selected tool to the bottom margin.

    Remarks:
  • This property allows you to dock the chart at the top, bottom, left or right of the chart.

  • Other properties such as Title.setAlignment(int) and Title.setBackColor(java.awt.Color) assigned to a chart title will be applied in the new DockArea.

  • See Also:
    LegendBox.setDocked(int)

    getFlags

    public int getFlags()

    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
    HIDDENHides the selected title.
    EXCLUDE_FROM_BORDERIf Border are presented, the title area will go over the border.
    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.
    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.
    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:
    Chart.setChartStyle(int), Chart.setStyleEx(int), Chart.setTypeEx(int), Chart

    getFont

    public java.awt.Font getFont()

    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:
    Title.setText(java.lang.String), Chart.setFont(java.awt.Font), Chart

    getGap

    public int getGap()

    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 Title.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:
    Chart.setBottomGap(int), Chart.setLeftGap(int), Chart.setRightGap(int), Chart.setTopGap(int), Axis.setSeparation(int), Title.setLineGap(int), Title.setText(java.lang.String), Axis, Chart

    getLineAlignment

    public int getLineAlignment()

    Sets the vertical alignment for the lines of the chart 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
    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.
    STRING_ALIGNMENT_CENTERSpecifies that alignment is centered between origin and extent (width) of the formatting rectangle.
    STRING_ALIGNMENT_FARSpecifies that alignment is to the far extent (right side) of the formatting rectangle.

    Remarks:
  • By changing the LineAlignment value, you can control distance from the title to the chart.

  • The Title.setAlignment(int) property allows you set the title left, center or right justified in the chart.

  • See Also:
    Title.setAlignment(int)

    getLineGap

    public int getLineGap()

    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 Title.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:
    Title.setGap(int), Title.setText(java.lang.String), Axis

    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()

    Used to set the text for a selected title.

    Remarks:
  • The Title.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 Chart.getTitles() property of the Chart.

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

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

    getTextColor

    public java.awt.Color getTextColor()

    Sets the color of text for the specified title.

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

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

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

    getURL

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

    See Also:
    getLink()

    isDrawingArea

    public boolean isDrawingArea()

    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 Title.setAlignment(int) property, the DrawingArea property will effect the position of the text when configured to near and far.

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

    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
    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.
    STRING_ALIGNMENT_CENTERSpecifies that alignment is centered between origin and extent (width) of the formatting rectangle.
    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 Axis.setTitle(SoftwareFX.ChartFX.Title) by utilizing the Axis.

  • The 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:
    setLineAlignment(int), Axis.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 Title.setTextColor(java.awt.Color) in order to view the titles clearly.

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

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

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

    setDockArea

    public void setDockArea(int value)

    Allows you to set where the title will be docked.

    Values:
    DockArea : Define how to set the docked selected tool position
    ValueDescription
    LEFTDocks the selected tool to the left margin.
    TOPDocks the selected tool to the top margin.
    RIGHTDocks the selected tool to the right margin.
    BOTTOMDocks the selected tool to the bottom margin.

    Remarks:
  • This property allows you to dock the chart at the top, bottom, left or right of the chart.

  • Other properties such as Title.setAlignment(int) and Title.setBackColor(java.awt.Color) assigned to a chart title will be applied in the new DockArea.

  • See Also:
    LegendBox.setDocked(int)

    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 Title.setAlignment(int) property, the DrawingArea property will effect the position of the text when configured to near and far.

  • See Also:
    Title.setAlignment(int), Title.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
    HIDDENHides the selected title.
    EXCLUDE_FROM_BORDERIf Border are presented, the title area will go over the border.
    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.
    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.
    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:
    Chart.setChartStyle(int), Chart.setStyleEx(int), Chart.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:
    Title.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 Title.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:
    Chart.setBottomGap(int), Chart.setLeftGap(int), Chart.setRightGap(int), Chart.setTopGap(int), Axis.setSeparation(int), Title.setLineGap(int), Title.setText(java.lang.String), Axis, Chart

    setLineAlignment

    public void setLineAlignment(int value)

    Sets the vertical alignment for the lines of the chart 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
    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.
    STRING_ALIGNMENT_CENTERSpecifies that alignment is centered between origin and extent (width) of the formatting rectangle.
    STRING_ALIGNMENT_FARSpecifies that alignment is to the far extent (right side) of the formatting rectangle.

    Remarks:
  • By changing the LineAlignment value, you can control distance from the title to the chart.

  • The Title.setAlignment(int) property allows you set the title left, center or right justified in the chart.

  • See Also:
    Title.setAlignment(int)

    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 Title.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:
    Title.setGap(int), Title.setText(java.lang.String), Axis

    setText

    public void setText(java.lang.String value)

    Used to set the text for a selected title.

    Remarks:
  • The Title.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 Chart.getTitles() property of the Chart.

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

  • See Also:
    Title.setTextColor(java.awt.Color), Axis.setTitle(SoftwareFX.ChartFX.Title), Chart.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 Title.setText(java.lang.String) property.

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

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

    setURL

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

    See Also:
    getLink()

    http://www.softwarefx.com

    2005 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.