|
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.CommandBar
public final class CommandBar
Provides access to the CommandBar object.
The members of the CommandBar object allow you to customize Chart FX Tools by allowing developers to add custom commands, add command images and make changes to Chart FX commands. Used in conjunction with the members of the Command object, you can create any custom command that you wish for your charting applications.
Constructor Summary | |
---|---|
CommandBar()
|
Method Summary | |
---|---|
Command |
addCommand(int nID)
Adds a custom command item by specifying a command id. |
int |
addPicture(java.awt.Image img)
Appends an image containing one or more icons to the Commands picture. |
void |
changePicture(int n,
java.awt.Image img)
Replaces all or part of the Commands picture. |
int |
getCommandPaintStyle()
Gets the CommandPaintStyle. |
java.awt.Font |
getFont()
Gets the Font. |
Command |
getItem(int nID)
Returns a specific item in the commands list. |
void |
setCommandPaintStyle(int value)
Used to instruct Chart FX of the style to paint the images for commands in the commands list. |
void |
setFont(java.awt.Font value)
Used to set the Font for the text used for the Chart FX MenuBar options. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CommandBar()
Method Detail |
---|
public Command addCommand(int nID)
Adds a custom command item by specifying a command id.
IMPORTANT: please note you must NOT use numbers between CommandID.First (29440) and CommandID.Last (29951) for the command id. These numbers are internally used by Chart FX and must not be used by your application when adding commands to the Chart FX commands list.
You can use this method to add a command to the Chart FX commands list that will be passed to your application through the UserCommand Event.
The Chart FX Command list does not limit the amount of commands you can add to it. However, you must be aware that the Toolbar is limited to display only 32 items.
nID
- An integer specifying the command id to add.getItem(int)
,
addPicture(java.awt.Image)
,
changePicture(int, java.awt.Image)
,
Command
,
ToolBar
public int addPicture(java.awt.Image img)
Appends an image containing one or more icons to the Commands picture.
This method returns the location (index) in which this picture was added, so you can easily refer to the images you have inserted. For example, if you add a picture containing 5 icons, you can use the return value of this method to refer to the icons in the appended picture as nRetValue, nRetValue+1, nRetValue+2, etc.
You can change the picture associated with a specific command using the Command.setPicture(int)
property.
Please note that this image is not only used in the Chart FX Toolbar, but in the menu that appears when the user right-clicks elements in the chart as well as the MenuBar displayed by Chart FX. Please check the Command.setStyle(int)
property to check when a command shows the text or icon associated with it.
You can use the changePicture(int, java.awt.Image)
method to replace one or more icons in the Commands picture.
img
- The image to add as the command icon.Command.setPicture(int)
,
Command.setStyle(int)
,
changePicture(int, java.awt.Image)
,
addCommand(int)
public void changePicture(int n, java.awt.Image img)
Replaces all or part of the Commands picture.
Please note you can replace the entire Commands image by specifying zero (0) in the location and passing a picture with the exact number of icons the original Commands image has. You can also append (instead of replace) a picture to the Commands picture with the addPicture(java.awt.Image)
method.
Please note that this image is not only used in the Chart FX Toolbar, but in the menu that appears when the user right-clicks elements in the chart as well as the MenuBar displayed by Chart FX. Please check the Command.setStyle(int)
property in the Command
Class
to check when a command shows the text or icon associated with it.
n
- An integer specifying the location where you want to start replacing the existing Commands picture (zero based).img
- A picture object containing the image with one or more icons to add. Each icon must be 16x16 pixels and, if you're adding more than 1 icon there shouldn't be any spaces between them.Command.setPicture(int)
,
addPicture(java.awt.Image)
,
Command
public int getCommandPaintStyle()
Gets the CommandPaintStyle. For more detail see setCommandPaintStyle(int)
.
public java.awt.Font getFont()
Gets the Font. For more detail see setFont(java.awt.Font)
.
public Command getItem(int nID)
Returns a specific item in the commands list.
Please refer to the Command
Class
for more information on properties supported by each command item.
Please refer to the Programmer's Guide section for a step-by-step guide on how to create and customize command lists.
Command.setEnabled(boolean)
,
Command.getID()
,
Command.setPicture(int)
,
Command.setChecked(boolean)
,
Command.setStyle(int)
,
Command.setText(java.lang.String)
public void setCommandPaintStyle(int value)
Used to instruct Chart FX of the style to paint the images for commands in the commands list.
CommandPaintStyle :
CommandPaintStyleValue | Description |
---|---|
CommandPaintStyle.FADED | Instructs Chart FX to paint command images with a slight fade so when they are hoovered over or selected they change to a more vibrant color. |
CommandPaintStyle.ALPHA | Instructs Chart FX to paint command images so when they are hoovered over they display a shadow. |
This property allows you to control how the images used in the Chart FX ToolBar and context menus will be painted. For example, the default setting is Faded which means that when a command image on a toolbar is initially painted the colors will be slightly faded. When a user hovers their mouse over the command, the colors of the command image will become move vibrant. You can remove this setting by turning off the Faded flag:
Command
public void setFont(java.awt.Font value)
Used to set the Font for the text used for the Chart FX MenuBar options.
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.
Chart.setFont(java.awt.Font)
,
Chart
|
http://www.softwarefx.com | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |