Chart FX for Java 6.5

SoftwareFX.ChartFX
Class ToolBar

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

public final class ToolBar
extends java.lang.Object

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

ToolBar

public ToolBar()
Method Detail

clear

public void clear()

Clears all items from a selected toolbar object.

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

  • See Also:
    setItem(int, int), setCommands(SoftwareFX.ChartFX.CommandBar), insertAt(int, int), removeAt(int, int), invalidate(), Command

    getBackColor

    public java.awt.Color getBackColor()

    Gets the BackColor. For more detail see setBackColor(java.awt.Color).


    getCommand

    public Command getCommand(int nID)
    Deprecated. You should use getCommands() instead.


    getCommands

    public CommandBar getCommands()

    Gets the Commands. For more detail see setCommands(SoftwareFX.ChartFX.CommandBar).


    getCommands

    public Command getCommands(int nID)
    Deprecated. You should use getCommands() instead.


    getDocked

    public int getDocked()

    Gets the Docked. For more detail see setDocked(int).


    getHeight

    public int getHeight()

    Gets the Height. For more detail see setHeight(int).


    getItem

    public int getItem(int n)

    Gets the Item. For more detail see setItem(int, int).


    getLength

    public int getLength()

    Gets the total number of items included for a selected toolbar object.

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

  • See Also:
    ChartCore.getToolBarObj(int), ChartCore.getMenuBarObj(int), Chart

    getWidth

    public int getWidth()

    Gets the Width. For more detail see setWidth(int).


    insertAt

    public void insertAt(int nPos,
                         int nItems)

    Allows you to insert space for items in a selected toolbar.

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

  • Parameters:
    nPos - Position in the toolbar to create a toolbar item placeholder.
    nItems - Number of items to insert into the toolbar.
    See Also:
    setItem(int, int), setCommands(SoftwareFX.ChartFX.CommandBar), clear(), removeAt(int, int), Command

    insertAt

    public void insertAt(int nPos)

    Allows you to insert space for items in a selected toolbar.

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

  • Parameters:
    nPos - Position in the toolbar to create a toolbar item placeholder.
    See Also:
    setItem(int, int), setCommands(SoftwareFX.ChartFX.CommandBar), clear(), removeAt(int, int), Command

    invalidate

    public void invalidate()

    Invalidates the selected tool and causes a paint message to be sent to the tool.

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

  • See Also:
    ChartCore.setToolBar(boolean), ChartCore.setMenuBar(boolean), ChartCore.paint(java.awt.Graphics2D, int, int, int, int, int), Chart

    isAutoSize

    public boolean isAutoSize()

    Gets the AutoSize. For more detail see setAutoSize(boolean).


    isShowImages

    public boolean isShowImages()

    Gets the ShowImages. For more detail see setShowImages(boolean).


    isVisible

    public boolean isVisible()

    Gets the Visible. For more detail see setVisible(boolean).


    removeAt

    public void removeAt(int nPos,
                         int nItems)

    Allows you to remove items from a selected toolbar.

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

  • Parameters:
    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.
    See Also:
    setItem(int, int), setCommands(SoftwareFX.ChartFX.CommandBar), clear(), insertAt(int, int), Command

    removeAt

    public void removeAt(int nPos)

    Allows you to remove items from a selected toolbar.

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

  • Parameters:
    nPos - Position of the item in the toolbar you would like to remove.
    See Also:
    setItem(int, int), setCommands(SoftwareFX.ChartFX.CommandBar), clear(), insertAt(int, int), Command

    setAutoSize

    public void setAutoSize(boolean value)

    Allows Chart FX to calculate the best-fit size according to the selected tool position.

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

  • See Also:
    setWidth(int), setHeight(int), ChartCore.getToolBarObj(int), ChartCore.getMenuBarObj(int), DataEditor, LegendBox, ToolBar

    setBackColor

    public void setBackColor(java.awt.Color value)

    Sets the background color for the selected tool.

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

  • See Also:
    ChartCore.getToolBarObj(int), ChartCore.getMenuBarObj(int), Chart

    setCommands

    public void setCommands(CommandBar value)

    Gets or sets a list of commands associated with the selected Chart FX tool object.

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

  • See Also:
    ChartCore.getToolBarObj(int), ChartCore.getMenuBarObj(int), Command

    setDocked

    public void setDocked(int value)

    Used to change the default position the selected tool object.

    Values:
    Docked : Define how to set the selected tool position (docked, floating or fixed).
    ValueDescription
    Docked.TOPDocks the selected tool to the top margin.
    Docked.BOTTOMDocks the selected tool to the bottom margin.
    Docked.LEFTDocks the selected tool to the left margin.
    Docked.RIGHTDocks the selected tool to the right margin.

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

  • See Also:
    setWidth(int), setHeight(int), setAutoSize(boolean), ChartCore.getToolBarObj(int), ChartCore.getMenuBarObj(int), DataEditor, LegendBox

    setHeight

    public void setHeight(int value)

    Sets the height (in pixels) for a selected tool when it is docked or fixed.

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

  • See Also:
    setDocked(int), setAutoSize(boolean), ChartCore.getToolBarObj(int), ChartCore.getMenuBarObj(int), LegendBox, DataEditor

    setItem

    public void setItem(int n,
                        int value)

    Returns a specific item in the selected Chart FX Tool.

    Remarks:
  • This property can be useful in adding commands to the default Chart FX Tools.

  • See Also:
    ChartCore.getToolBarObj(int), Command, Chart

    setShowImages

    public void setShowImages(boolean value)

    Allows to show or hide the images on a selected Chart FX tool.

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

  • See Also:
    ChartCore.getToolBarObj(int), ChartCore.getMenuBarObj(int), Chart

    setVisible

    public void setVisible(boolean value)

    Shows or hides the selected Chart FX tool.

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

  • See Also:
    ChartCore.getToolBarObj(int), ChartCore.getMenuBarObj(int), Chart, DataEditor, LegendBox

    setWidth

    public void setWidth(int value)

    Sets the width for a selected Chart FX tool when it is Docked or Fixed.

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

  • See Also:
    setHeight(int), setDocked(int), setAutoSize(boolean), ChartCore.getToolBarObj(int), ChartCore.getMenuBarObj(int), LegendBox, DataEditor

    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.