|
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.ToolBar
public final class ToolBar
Provides access to the ToolBar object.
The Chart FX Tools give end users the ability to interact with the chart more efficiently and access features without any additional programming efforts on your part. You, as a programmer, may customize these tools as you please using the supported members of the ToolBar Class .
The Chart
Class
includes two properties that give access to the ToolBar Class and its supported members. The ChartCore.getToolBarObj(int)
and ChartCore.getMenuBarObj(int)
properties allow you as the programmer to control the selected tool's positioning and visual attributes.
Constructor Summary | |
---|---|
ToolBar()
|
Method Summary | |
---|---|
void |
clear()
Clears all items from a selected toolbar object. |
java.awt.Color |
getBackColor()
Gets the BackColor. |
Command |
getCommand(int nID)
Deprecated. You should use getCommands() instead. |
CommandBar |
getCommands()
Gets the Commands. |
Command |
getCommands(int nID)
Deprecated. You should use getCommands() instead. |
int |
getDocked()
Gets the Docked. |
int |
getHeight()
Gets the Height. |
int |
getItem(int n)
Gets the Item. |
int |
getLength()
Gets the total number of items included for a selected toolbar object. |
int |
getWidth()
Gets the Width. |
void |
insertAt(int nPos)
Allows you to insert space for items in a selected toolbar. |
void |
insertAt(int nPos,
int nItems)
Allows you to insert space for items in a selected toolbar. |
void |
invalidate()
Invalidates the selected tool and causes a paint message to be sent to the tool. |
boolean |
isAutoSize()
Gets the AutoSize. |
boolean |
isShowImages()
Gets the ShowImages. |
boolean |
isVisible()
Gets the Visible. |
void |
removeAt(int nPos)
Allows you to remove items from a selected toolbar. |
void |
removeAt(int nPos,
int nItems)
Allows you to remove items from a selected toolbar. |
void |
setAutoSize(boolean value)
Allows Chart FX to calculate the best-fit size according to the selected tool position. |
void |
setBackColor(java.awt.Color value)
Sets the background color for the selected tool. |
void |
setCommands(CommandBar value)
Gets or sets a list of commands associated with the selected Chart FX tool object. |
void |
setDocked(int value)
Used to change the default position the selected tool object. |
void |
setHeight(int value)
Sets the height (in pixels) for a selected tool when it is docked or fixed. |
void |
setItem(int n,
int value)
Returns a specific item in the selected Chart FX Tool. |
void |
setShowImages(boolean value)
Allows to show or hide the images on a selected Chart FX tool. |
void |
setVisible(boolean value)
Shows or hides the selected Chart FX tool. |
void |
setWidth(int value)
Sets the width for a selected Chart FX tool when it is Docked or Fixed. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ToolBar()
Method Detail |
---|
public void clear()
Clears all items from a selected toolbar object.
Clearing the items for a particular tool will not clear the items that are accessible through other tools. For example, if you remove all the items of the Chart FX ToolBar the Chart FX MenuBar and Context menus will still have include their items (Commands).
After clearing a Toolbar using this method, you can use the ToolBarObj property along with the CommandID enumeration to set new items to the selected toolbar.
setItem(int, int)
,
setCommands(SoftwareFX.ChartFX.CommandBar)
,
insertAt(int, int)
,
removeAt(int, int)
,
invalidate()
,
Command
public java.awt.Color getBackColor()
Gets the BackColor. For more detail see setBackColor(java.awt.Color)
.
public Command getCommand(int nID)
getCommands()
instead.
public CommandBar getCommands()
Gets the Commands. For more detail see setCommands(SoftwareFX.ChartFX.CommandBar)
.
public Command getCommands(int nID)
getCommands()
instead.
public int getDocked()
Gets the Docked. For more detail see setDocked(int)
.
public int getHeight()
Gets the Height. For more detail see setHeight(int)
.
public int getItem(int n)
Gets the Item. For more detail see setItem(int, int)
.
public int getLength()
Gets the total number of items included for a selected toolbar object.
This is a read only property.
This property may be used to obtain the total number of items included in any of the supported Chart FX toolbars: ToolBar, MenuBar, etc.
The ChartCore.getToolBarObj(int)
and ChartCore.getMenuBarObj(int)
properties may be used to expose the members of the ToolBar class.
ChartCore.getToolBarObj(int)
,
ChartCore.getMenuBarObj(int)
,
Chart
public int getWidth()
Gets the Width. For more detail see setWidth(int)
.
public void insertAt(int nPos, int nItems)
Allows you to insert space for items in a selected toolbar.
The nPos parameter is a zero based index, therefore if you want to insert an item in the first position you should use the index 0:
If you do not assign a command for the inserted item, a separator will be placed in that position by default.
Multiple items may be inserted into a selected toolbar by calling this method with the configured nPos and nItems parameters.
This method is particularly useful when customizing the Chart FX tools, however, you must remember that if you insert an item into the toolbar that item will not be accessible through other tools such as the menubar and context menus.
The clear()
method can be used to clear all pre-defined items from a selected toolbar object.
You can use the removeAt(int, int)
method to remove items from a selected toolbar.
nPos
- Position in the toolbar to create a toolbar item placeholder.nItems
- Number of items to insert into the toolbar.setItem(int, int)
,
setCommands(SoftwareFX.ChartFX.CommandBar)
,
clear()
,
removeAt(int, int)
,
Command
public void insertAt(int nPos)
Allows you to insert space for items in a selected toolbar.
The nPos parameter is a zero based index, therefore if you want to insert an item in the first position you should use the index 0:
If you do not assign a command for the inserted item, a separator will be placed in that position by default.
Multiple items may be inserted into a selected toolbar by calling this method with the configured nPos and nItems parameters.
This method is particularly useful when customizing the Chart FX tools, however, you must remember that if you insert an item into the toolbar that item will not be accessible through other tools such as the menubar and context menus.
The clear()
method can be used to clear all pre-defined items from a selected toolbar object.
You can use the removeAt(int, int)
method to remove items from a selected toolbar.
nPos
- Position in the toolbar to create a toolbar item placeholder.setItem(int, int)
,
setCommands(SoftwareFX.ChartFX.CommandBar)
,
clear()
,
removeAt(int, int)
,
Command
public void invalidate()
Invalidates the selected tool and causes a paint message to be sent to the tool.
When you modify a visual attribute of a selected Chart FX Tool, sometimes it requires that the tool be recalculated and repainted to display the legend as desired. Calling this method after customization will ensure new changes are visible.
ChartCore.setToolBar(boolean)
,
ChartCore.setMenuBar(boolean)
,
ChartCore.paint(java.awt.Graphics2D, int, int, int, int, int)
,
Chart
public boolean isAutoSize()
Gets the AutoSize. For more detail see setAutoSize(boolean)
.
public boolean isShowImages()
Gets the ShowImages. For more detail see setShowImages(boolean)
.
public boolean isVisible()
Gets the Visible. For more detail see setVisible(boolean)
.
public void removeAt(int nPos, int nItems)
Allows you to remove items from a selected toolbar.
The nPos parameter is a zero based index, therefore if you want to remove the first item in a toolbar you should use the index 0:
Multiple items may be removed from a selected toolbar by calling this method with the configured nPos and nItems parameters.
This method is particularly useful when customizing the Chart FX tools, however, you must remember that if you remove an item from the toolbar that item will still be accessible through other tools such as the menubar and context menus.
The clear()
method can be used to clear all pre-defined items from a selected toolbar object.
You can use the insertAt(int, int)
method to add items to a selected toolbar which includes custom and pre-defined commands.
nPos
- Position of the item in the toolbar you would like to remove.nItems
- The total number of items that you would like to remove.setItem(int, int)
,
setCommands(SoftwareFX.ChartFX.CommandBar)
,
clear()
,
insertAt(int, int)
,
Command
public void removeAt(int nPos)
Allows you to remove items from a selected toolbar.
The nPos parameter is a zero based index, therefore if you want to remove the first item in a toolbar you should use the index 0:
Multiple items may be removed from a selected toolbar by calling this method with the configured nPos and nItems parameters.
This method is particularly useful when customizing the Chart FX tools, however, you must remember that if you remove an item from the toolbar that item will still be accessible through other tools such as the menubar and context menus.
The clear()
method can be used to clear all pre-defined items from a selected toolbar object.
You can use the insertAt(int, int)
method to add items to a selected toolbar which includes custom and pre-defined commands.
nPos
- Position of the item in the toolbar you would like to remove.setItem(int, int)
,
setCommands(SoftwareFX.ChartFX.CommandBar)
,
clear()
,
insertAt(int, int)
,
Command
public void setAutoSize(boolean value)
Allows Chart FX to calculate the best-fit size according to the selected tool position.
When the user moves a tool from one docked position to another (e.g. Docked-Right to Docked-Top), the tool must be resized accordingly to fit all the labels associated with the tool being shown. When this property is set to True, you will not need to set the tool setWidth(int)
or setHeight(int)
as Chart FX will calculate those values for you.
setWidth(int)
,
setHeight(int)
,
ChartCore.getToolBarObj(int)
,
ChartCore.getMenuBarObj(int)
,
DataEditor
,
LegendBox
,
ToolBar
public void setBackColor(java.awt.Color value)
Sets the background color for the selected tool.
You need to set the selected tool to visible in order to see the changes made with BackColor property. For example, you can use the ChartCore.setToolBar(boolean)
property to make the Chart FX ToolBar visible in the chart.ChartCore.setToolBar(boolean)
For more information regarding the Color type, please refer to the Java API Documentation.
ChartCore.getToolBarObj(int)
,
ChartCore.getMenuBarObj(int)
,
Chart
public void setCommands(CommandBar value)
Gets or sets a list of commands associated with the selected Chart FX tool object.
This object is normally accessed when you want to customize the Chart FX tool or change any option associated with the default tool. For more information please see the Programmer's Guide or the Resource Center.
Please refer to the Command
object for more information on properties supported by this object.
ChartCore.getToolBarObj(int)
,
ChartCore.getMenuBarObj(int)
,
Command
public void setDocked(int value)
Used to change the default position the selected tool object.
Docked :
Define how to set the selected tool position (docked, floating or fixed).Value | Description |
---|---|
Docked.TOP | Docks the selected tool to the top margin. |
Docked.BOTTOM | Docks the selected tool to the bottom margin. |
Docked.LEFT | Docks the selected tool to the left margin. |
Docked.RIGHT | Docks the selected tool to the right margin. |
All tool objects in Chart FX are created (by default) with the setAutoSize(boolean)
property set to True. When this property is set to True and the end user moves the tool to another position, Chart FX will calculate the appropriate width and height.
You may change the size of a selected tool with the setWidth(int)
and setHeight(int)
properties.
setWidth(int)
,
setHeight(int)
,
setAutoSize(boolean)
,
ChartCore.getToolBarObj(int)
,
ChartCore.getMenuBarObj(int)
,
DataEditor
,
LegendBox
public void setHeight(int value)
Sets the height (in pixels) for a selected tool when it is docked or fixed.
For a setDocked(int)
tool, the Height property applies only when it is docked to the top or bottom margin. The height can always be modified when the tool is fixed inside the chart area.
When you modify the height of a particular tool the setAutoSize(boolean)
property will be set to False and even if you move the tool from a docked to a fixed position or viceversa, Chart FX will not recalculate the best-fit height for the tool unless the AutoSize property is set to True.
setDocked(int)
,
setAutoSize(boolean)
,
ChartCore.getToolBarObj(int)
,
ChartCore.getMenuBarObj(int)
,
LegendBox
,
DataEditor
public void setItem(int n, int value)
Returns a specific item in the selected Chart FX Tool.
This property can be useful in adding commands to the default Chart FX Tools.
ChartCore.getToolBarObj(int)
,
Command
,
Chart
public void setShowImages(boolean value)
Allows to show or hide the images on a selected Chart FX tool.
You must make sure the selected Chart FX tool is visible in order to see the effect of this property.ChartCore.setToolBar(boolean)
The first image is a ToolBar with the ShowImages property set to True:
This second image is a ToolBar with the ShowImages property set to False (Text Only):
ChartCore.getToolBarObj(int)
,
ChartCore.getMenuBarObj(int)
,
Chart
public void setVisible(boolean value)
Shows or hides the selected Chart FX tool.
Hiding a tool does not destroy it nor loses previous settings assigned by other properties.
Each tool also has a property in the Chart
class to show/hide the tool in the chart.
ChartCore.getToolBarObj(int)
,
ChartCore.getMenuBarObj(int)
,
Chart
,
DataEditor
,
LegendBox
public void setWidth(int value)
Sets the width for a selected Chart FX tool when it is Docked or Fixed.
For a docked tool, the Width property applies only when it is docked to the right or left margin. The width can always be modified when the tool is fixed inside the chart area.
When you modify the width of a particular tool the setAutoSize(boolean)
property will be set to False and even if you move the tool from a docked to a fixed position or viceversa, Chart FX will not recalculate the best-fit width for the tool unless the setAutoSize(boolean)
property is set to True.
setHeight(int)
,
setDocked(int)
,
setAutoSize(boolean)
,
ChartCore.getToolBarObj(int)
,
ChartCore.getMenuBarObj(int)
,
LegendBox
,
DataEditor
|
http://www.softwarefx.com | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |