|
Chart FX 7 for Java Server | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.softwarefx.chartfx.server.Command
public class Command
Provides access to the Command object.
Sometimes, customizing a tool becomes imperative as you don't want end users to access a particular feature in it or you want to extend the original functionality provided by it, or you simply want to change the tooltips the Toolbar buttons display.
In Chart FX for Java , there are numerous ways to access the available commands. For example, to change the chart type, the end user may select the Gallery button in the Toolbar, MenuBar or right-clicking the marker and changing the gallery type.
For this reason Chart FX for Java introduces the Commands Class , which contains all commands available that all tools use to create and display the user interface in Chart FX for Java .
Constructor Summary | |
---|---|
Command(int id)
|
Method Summary | |
---|---|
int |
getID()
Gets the unique identifier of the command item. |
int |
getImageIndex()
Gets the ImageIndex. |
String |
getScript()
Gets the Script. |
EnumSet<CommandStyles> |
getStyle()
Gets the Style. |
SubCommandCollection |
getSubCommands()
Returns the SubCommandCollection for a command. |
String |
getText()
Gets the Text. |
boolean |
isChecked()
Gets the Checked. |
boolean |
isEnabled()
Gets the Enabled. |
boolean |
isGeneratePostBack()
Gets the GeneratePostBack. |
boolean |
isPredefined()
Gets a value specifying if a command is pre-defined or user-defined. |
void |
setChecked(boolean value)
Sets a value used to check or uncheck a command in the commands list. |
void |
setEnabled(boolean value)
Sets a value to enable or disable a command from the commands list. |
void |
setGeneratePostBack(boolean value)
Sets the value to generate or not Postback events for commands. |
void |
setImageIndex(int value)
Sets the picture (icon) associated with a command. |
void |
setScript(String value)
Sets the name of a client side JavaScript function to call for a custom command. |
void |
setStyle(EnumSet<CommandStyles> value)
Allows you to set the style for a command item. |
void |
setText(String value)
Sets the text associated with the command. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Command(int id)
Method Detail |
---|
public int getID()
Gets the unique identifier of the command item.
(Read only)
Each command has a unique identifier and you can not change it. Please refer to the Commands List available in Chart FX.
setEnabled(boolean)
,
setChecked(boolean)
,
setStyle(java.util.EnumSet)
,
setText(java.lang.String)
public int getImageIndex()
Gets the ImageIndex. For more detail see setImageIndex(int)
.
public String getScript()
Gets the Script. For more detail see setScript(java.lang.String)
.
public EnumSet<CommandStyles> getStyle()
Gets the Style. For more detail see setStyle(java.util.EnumSet
.
public SubCommandCollection getSubCommands()
Returns the SubCommandCollection for a command.
Commands may have a collection of subcommands. This allows you to create a command button with several underlying options. Using the SubCommands property, you can obtain the SubCommandCollection for a selected command.
The SubCommandCollection supports all the standard collection members used to administer the object.
The Chart.getCommands()
property is used to return the CommandCollection for the chart.
Chart.getCommands()
,
Chart
public String getText()
Gets the Text. For more detail see setText(java.lang.String)
.
public boolean isChecked()
Gets the Checked. For more detail see setChecked(boolean)
.
public boolean isEnabled()
Gets the Enabled. For more detail see setEnabled(boolean)
.
public boolean isGeneratePostBack()
Gets the GeneratePostBack. For more detail see setGeneratePostBack(boolean)
.
public boolean isPredefined()
Gets a value specifying if a command is pre-defined or user-defined.
When False, a command is user defined.
public void setChecked(boolean value)
Sets a value used to check or uncheck a command in the commands list.
The result from setting this property depends on the setStyle(java.util.EnumSet
of the command. If it represents a two-state button in the toolbar, setting this property to TRUE will cause the button appear checked. If the two-state button belongs to a group and you set this property to True, any other button that may be checked will be unchecked.
If its a menu item, setting this property to True will check the option in the menu.
Many ChartFX commands should not be checked/unchecked since they show the current status of the chart.
getID()
,
setEnabled(boolean)
,
setStyle(java.util.EnumSet)
,
setText(java.lang.String)
public void setEnabled(boolean value)
Sets a value to enable or disable a command from the commands list.
The result from setting this property depends on the style of the command (setStyle(java.util.EnumSet
Property). If its represented as a toolbar button, setting this property to FALSE will gray out the button. If its a menu item, setting this property to FALSE will gray out the option in the menu.
Many ChartFX commands should not be checked/unchecked since they show the current status of the chart. e.g. Cluster will be disabled if the user changes to a 2d chart regardless of whether the programmer just enabled that command.
Please refer to the Programmer's Guide for a step-by-step guide on how to customize the Chart FX commands list.
getID()
,
setChecked(boolean)
,
setStyle(java.util.EnumSet)
,
setText(java.lang.String)
public void setGeneratePostBack(boolean value)
Sets the value to generate or not Postback events for commands.
public void setImageIndex(int value)
Sets the picture (icon) associated with a command.
The Commands object provides a picture image with many 16x16 icons that you can use to set existing commands or new commands you have added to the commands list.
getID()
,
setEnabled(boolean)
,
setChecked(boolean)
,
setStyle(java.util.EnumSet)
,
setText(java.lang.String)
public void setScript(String value)
Sets the name of a client side JavaScript function to call for a custom command.
When generating charts as images or interactive images (DHTML), this chart may be used to wire user actions to client side JavaScript functions.
public void setStyle(EnumSet<CommandStyles> value)
Allows you to set the style for a command item.
The Style for existing Chart FX internal commands may also be modified giving developers the opportunity to even customize the default commands.
Please refer to the Programmer's Guide for a step-by-step guide on how to customize the Chart FX commands list.
TwoState in a group makes the group to be "possible empty" (You can uncheck the current selection)
To add a new user command to the Toolbar, it will be requried to creae a new ToolBarItem
. The ToolBar.insert(int, com.softwarefx.chartfx.server.ToolBarItem)
method of the ToolBar object is used to insert the new ToolBarItem into the toolbar at the desired index.
getID()
,
setImageIndex(int)
,
setEnabled(boolean)
,
setChecked(boolean)
,
setText(java.lang.String)
,
ToolBar.insert(int, com.softwarefx.chartfx.server.ToolBarItem)
,
ToolBar
public void setText(String value)
Sets the text associated with the command.
The text associated with a command will be used to display a tooltip when the command is displayed in the toolbar, or the text that is shown in the menu bar.
getID()
,
setEnabled(boolean)
,
setChecked(boolean)
,
setStyle(java.util.EnumSet)
,
setImageIndex(int)
,
ToolBar
|
http://www.softwarefx.com | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |