|
Chart FX for Java 6.5 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SoftwareFX.ChartFX.Title
public final class Title
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 |
---|
public Title()
Method Detail |
---|
public int getAlignment()
Gets the Alignment. For more detail see setAlignment(int)
.
public java.awt.Color getBackColor()
Gets the BackColor. For more detail see setBackColor(java.awt.Color)
.
public int getFlags()
Gets the Flags. For more detail see setFlags(int)
.
public java.awt.Font getFont()
Gets the Font. For more detail see setFont(java.awt.Font)
.
public int getGap()
Gets the Gap. For more detail see setGap(int)
.
public int getLineGap()
Gets the LineGap. For more detail see setLineGap(int)
.
public Link getLink()
Gets the Link object for a selected title item.
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.
Link.setUrl(java.lang.String)
,
Link.setTarget(java.lang.String)
,
Link
public java.lang.String getText()
Gets the Text. For more detail see setText(java.lang.String)
.
public java.awt.Color getTextColor()
Gets the TextColor. For more detail see setTextColor(java.awt.Color)
.
public java.lang.String getURL()
Title.getLink().getUrl
instead.
getLink()
public boolean isDrawingArea()
Gets the DrawingArea. For more detail see setDrawingArea(boolean)
.
public void setAlignment(int value)
Allows you to set the alignment of a specified title.
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. Value | Description |
---|---|
StringAlignment.STRING_ALIGNMENT_NEAR | Specifies 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_CENTER | Specifies that alignment is centered between origin and extent (width) of the formatting rectangle. |
StringAlignment.STRING_ALIGNMENT_FAR | Specifies that alignment is to the far extent (right side) of the formatting rectangle. |
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 .
TitleDockable.setLineAlignment(int)
,
AxisBase.setTitle(SoftwareFX.ChartFX.Title)
,
Axis
,
TitleDockable
public void setBackColor(java.awt.Color value)
Sets the color background of the specified title.
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.
setTextColor(java.awt.Color)
,
AxisBase.setTitle(SoftwareFX.ChartFX.Title)
,
Axis
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.
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.
setAlignment(int)
,
setText(java.lang.String)
public void setFlags(int value)
Allows you to set flags in order to format the title with the desired attributes.
TitleFlag :
Define Attributes for Titles object that may be set using Flag propertyValue | Description |
---|---|
TitleFlag.HIDDEN | Hides the selected title. |
TitleFlag.EXCLUDE_FROM_BORDER | If Border are presented, the title area will go over the border. |
TitleFlag.NO_CHANGE_DOCK_AREA | Having 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_BORDER | If 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_AREA | Having this flag ON, the title area will be only the drawing area in other case it will occupy the full area. |
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;
ChartCore.setChartStyle(int)
,
ChartCore.setStyleEx(int)
,
ChartCore.setTypeEx(int)
,
Chart
public void setFont(java.awt.Font value)
Assigns a font to the specified title.
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.
setText(java.lang.String)
,
Chart.setFont(java.awt.Font)
,
Chart
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.
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.
ChartCore.setBottomGap(int)
,
ChartCore.setLeftGap(int)
,
ChartCore.setRightGap(int)
,
ChartCore.setTopGap(int)
,
Axis.setSeparation(int)
,
setLineGap(int)
,
setText(java.lang.String)
,
Axis
,
Chart
public void setLineGap(int value)
Specify the space in pixels above and below the selected title text when read from right to left.
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.
setGap(int)
,
setText(java.lang.String)
,
Axis
public void setText(java.lang.String value)
Used to set the text for a selected title.
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
.
setTextColor(java.awt.Color)
,
AxisBase.setTitle(SoftwareFX.ChartFX.Title)
,
ChartCore.getTitles()
,
Chart
,
Axis
public void setTextColor(java.awt.Color value)
Sets the color of text for the specified title.
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.
ChartCore.getAxisX()
,
ChartCore.getAxisY()
,
setText(java.lang.String)
,
Axis
public void setURL(java.lang.String value)
Title.getLink().setUrl
instead.
getLink()
|
http://www.softwarefx.com | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |