Chart FX for Java 6.5

SoftwareFX.ChartFX
Class CommandBar

java.lang.Object
  extended by SoftwareFX.ChartFX.CommandBar

public final class CommandBar
extends java.lang.Object

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

CommandBar

public CommandBar()
Method Detail

addCommand

public Command addCommand(int nID)

Adds a custom command item by specifying a command id.

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

  • Parameters:
    nID - An integer specifying the command id to add.
    See Also:
    getItem(int), addPicture(java.awt.Image), changePicture(int, java.awt.Image), Command, ToolBar

    addPicture

    public int addPicture(java.awt.Image img)

    Appends an image containing one or more icons to the Commands picture.

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

  • Parameters:
    img - The image to add as the command icon.
    See Also:
    Command.setPicture(int), Command.setStyle(int), changePicture(int, java.awt.Image), addCommand(int)

    changePicture

    public void changePicture(int n,
                              java.awt.Image img)

    Replaces all or part of the Commands picture.

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

  • Parameters:
    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.
    See Also:
    Command.setPicture(int), addPicture(java.awt.Image), Command

    getCommandPaintStyle

    public int getCommandPaintStyle()

    Gets the CommandPaintStyle. For more detail see setCommandPaintStyle(int).


    getFont

    public java.awt.Font getFont()

    Gets the Font. For more detail see setFont(java.awt.Font).


    getItem

    public Command getItem(int nID)

    Returns a specific item in the commands list.

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

  • See Also:
    Command.setEnabled(boolean), Command.getID(), Command.setPicture(int), Command.setChecked(boolean), Command.setStyle(int), Command.setText(java.lang.String)

    setCommandPaintStyle

    public void setCommandPaintStyle(int value)

    Used to instruct Chart FX of the style to paint the images for commands in the commands list.

    Values:
    CommandPaintStyle : CommandPaintStyle
    ValueDescription
    CommandPaintStyle.FADEDInstructs 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.ALPHAInstructs Chart FX to paint command images so when they are hoovered over they display a shadow.

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

  • See Also:
    Command

    setFont

    public void setFont(java.awt.Font value)

    Used to set the Font for the text used for the Chart FX MenuBar options.

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

  • See Also:
    Chart.setFont(java.awt.Font), Chart

    http://www.softwarefx.com

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