Chart FX 7 for Java Server

com.softwarefx.chartfx.server
Class Command

java.lang.Object
  extended by com.softwarefx.chartfx.server.Command

public class Command
extends Object

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

Command

public Command(int id)
Method Detail

getID

public int getID()

Gets the unique identifier of the command item.

(Read only)

Remarks:
  • Each command has a unique identifier and you can not change it. Please refer to the Commands List available in Chart FX.

  • See Also:
    setEnabled(boolean), setChecked(boolean), setStyle(java.util.EnumSet), setText(java.lang.String)

    getImageIndex

    public int getImageIndex()

    Gets the ImageIndex. For more detail see setImageIndex(int).


    getScript

    public String getScript()

    Gets the Script. For more detail see setScript(java.lang.String).


    getStyle

    public EnumSet<CommandStyles> getStyle()

    Gets the Style. For more detail see setStyle(java.util.EnumSet).


    getSubCommands

    public SubCommandCollection getSubCommands()

    Returns the SubCommandCollection for a command.

    Remarks:
  • 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.

  • See Also:
    Chart.getCommands(), Chart

    getText

    public String getText()

    Gets the Text. For more detail see setText(java.lang.String).


    isChecked

    public boolean isChecked()

    Gets the Checked. For more detail see setChecked(boolean).


    isEnabled

    public boolean isEnabled()

    Gets the Enabled. For more detail see setEnabled(boolean).


    isGeneratePostBack

    public boolean isGeneratePostBack()

    Gets the GeneratePostBack. For more detail see setGeneratePostBack(boolean).


    isPredefined

    public boolean isPredefined()

    Gets a value specifying if a command is pre-defined or user-defined.

    Remarks:
  • When False, a command is user defined.


  • setChecked

    public void setChecked(boolean value)

    Sets a value used to check or uncheck a command in the commands list.

    Remarks:
  • 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.

  • See Also:
    getID(), setEnabled(boolean), setStyle(java.util.EnumSet), setText(java.lang.String)

    setEnabled

    public void setEnabled(boolean value)

    Sets a value to enable or disable a command from the commands list.

    Remarks:
  • 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.

  • See Also:
    getID(), setChecked(boolean), setStyle(java.util.EnumSet), setText(java.lang.String)

    setGeneratePostBack

    public void setGeneratePostBack(boolean value)

    Sets the value to generate or not Postback events for commands.


    setImageIndex

    public void setImageIndex(int value)

    Sets the picture (icon) associated with a command.

    Remarks:
  • 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.

  • See Also:
    getID(), setEnabled(boolean), setChecked(boolean), setStyle(java.util.EnumSet), setText(java.lang.String)

    setScript

    public void setScript(String value)

    Sets the name of a client side JavaScript function to call for a custom command.

    Remarks:
  • When generating charts as images or interactive images (DHTML), this chart may be used to wire user actions to client side JavaScript functions.


  • setStyle

    public void setStyle(EnumSet<CommandStyles> value)

    Allows you to set the style for a command item.

    Remarks:
  • 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.

  • See Also:
    getID(), setImageIndex(int), setEnabled(boolean), setChecked(boolean), setText(java.lang.String), ToolBar.insert(int, com.softwarefx.chartfx.server.ToolBarItem), ToolBar

    setText

    public void setText(String value)

    Sets the text associated with the command.

    Remarks:
  • 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.

  • See Also:
    getID(), setEnabled(boolean), setChecked(boolean), setStyle(java.util.EnumSet), setImageIndex(int), ToolBar

    http://www.softwarefx.com

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