public class DockableBar
extends java.lang.Object
Provides access to the DockableBar object, which is the parent class of objects such as the LegendBox, the ToolBar, and the DataGrid.
The background color may be modified using the setBackColor method.
Using the setDock method, you can dock the bar in different areas of the Chart.
You must make the bar isVisible in order to see any of the visual attributes configured using the methods of the class.
The border of the bar can the set by using a pre-defined object such as SimpleBorder, or ImageBorderusing the method setChartBorder.
The following methods of the Chartreturn objects inheriting from DockableBar: setLegendBox, setToolBar, setMenuBar, and setDataGrid.
Dragging the legend box (end user) is not supported but may be positioned in the chart area using the setDock method. Functionality has been added to the legends to enhance the appearance in a docked position (left, right, top or bottom). For example, you can include borders around a legend or leave them in the default compacted view. By modifying visual attributes, the legend box appears to be floating but it is attached to a logical position that will change as the chart size changes.
| Constructor and Description |
|---|
DockableBar() |
| Modifier and Type | Method and Description |
|---|---|
void |
addVisibleChangedListener(EventListener value)
Adds a VisibleChangedListener to the listener list.
|
java.awt.Color |
getBackColor()
Gets or sets a value for the background color of a dockable bar.
|
DockBorder |
getBorder()
Allows the developer to specify the border style.
|
DockArea |
getDock()
Sets the position of the data grid.
|
int |
getHeight()
Gets or sets the height of the dockable bar in pixels.
|
int |
getWidth()
Sets the height in pixels.
|
int |
getZOrder()
Gets or sets the z-order for a dockable bar.
|
boolean |
isAutoSize()
Allows Chart FX to calculate the best size according to the tool position.
|
boolean |
isVisible()
Gets or sets a value indicating the Dockablebar object should be shown or not.
|
void |
removeVisibleChangedListener(EventListener value)
Removes a VisibleChangedListener from the listener list.
|
void |
resetAutoSize()
Set the property AutoSize to its default value.
|
void |
resetBackColor()
Set the property BackColor to its default value.
|
void |
resetBorder()
Set the property Border to its default value.
|
void |
resetDock()
Set the property Dock to its default value.
|
void |
resetHeight()
Set the property Height to its default value.
|
void |
resetVisible()
Set the property Visible to its default value.
|
void |
resetWidth()
Set the property Width to its default value.
|
void |
resetZOrder()
Set the property ZOrder to its default value.
|
void |
setAutoSize(boolean value)
Allows Chart FX to calculate the best size according to the tool position.
|
void |
setBackColor(java.awt.Color value)
Gets or sets a value for the background color of a dockable bar.
|
void |
setBorder(DockBorder value)
Allows the developer to specify the border style.
|
void |
setDock(DockArea value)
Sets the position of the data grid.
|
void |
setHeight(int value)
Gets or sets the height of the dockable bar in pixels.
|
void |
setVisible(boolean value)
Gets or sets a value indicating the Dockablebar object should be shown or not.
|
void |
setWidth(int value)
Sets the height in pixels.
|
void |
setZOrder(int value)
Gets or sets the z-order for a dockable bar.
|
public boolean isAutoSize()
chart1.getDataGrid().setAutoSize(false);
resetAutoSizepublic void setAutoSize(boolean value)
chart1.getDataGrid().setAutoSize(false);
value - resetAutoSizepublic java.awt.Color getBackColor()
Gets or sets a value for the background color of a dockable bar.
The effect of this method is to change the background behind any dockable bar object such as the DataGrid.
Named color are supported (e.g. Red), to use Hex notation you have to use quotes (e.g. "#FF00FF").
For more information regarding the Color type, please refer to the Java Documentation.
To change the background color of the data grid to red:
chart1.getDataGrid().setBackColor(new java.awt.Color(255,0,0,255));
resetBackColorpublic void setBackColor(java.awt.Color value)
Gets or sets a value for the background color of a dockable bar.
The effect of this method is to change the background behind any dockable bar object such as the DataGrid.
Named color are supported (e.g. Red), to use Hex notation you have to use quotes (e.g. "#FF00FF").
For more information regarding the Color type, please refer to the Java Documentation.
To change the background color of the data grid to red:
chart1.getDataGrid().setBackColor(new java.awt.Color(255,0,0,255));
value - resetBackColorpublic DockBorder getBorder()
chart1.getDataGrid().setChartBorder(DockBorder.EXTERNAL);
resetBorderpublic void setBorder(DockBorder value)
chart1.getDataGrid().setChartBorder(DockBorder.EXTERNAL);
value - resetBorderpublic DockArea getDock()
Sets the position of the data grid.
All tools in Chart FX are created (by default) with the isAutoSize method set to True. When this method is set to True and the end user moves a Dockable Bar to another position, Chart FX will calculate the appropriate width and height.
To dock the DataGrid to the right margin:
chart1.getDataGrid().setDock(DockArea.RIGHT);
resetDockpublic void setDock(DockArea value)
Sets the position of the data grid.
All tools in Chart FX are created (by default) with the isAutoSize method set to True. When this method is set to True and the end user moves a Dockable Bar to another position, Chart FX will calculate the appropriate width and height.
To dock the DataGrid to the right margin:
chart1.getDataGrid().setDock(DockArea.RIGHT);
value - resetDockpublic int getHeight()
Gets or sets the height of the dockable bar in pixels.
When you modify the height, the isAutoSize method will be set to False.
Use the Height method to configure the height for the dockable bar object.
To set the height for the data grid to 300 pixels:
chart1.getDataGrid().setHeight(300);
resetHeightpublic void setHeight(int value)
Gets or sets the height of the dockable bar in pixels.
When you modify the height, the isAutoSize method will be set to False.
Use the Height method to configure the height for the dockable bar object.
To set the height for the data grid to 300 pixels:
chart1.getDataGrid().setHeight(300);
value - resetHeightpublic boolean isVisible()
Gets or sets a value indicating the Dockablebar object should be shown or not.
Hiding a DockableBar object not destroy or lose previous settings assigned by other methods.
To hide the data grid:
chart1.getDataGrid().setVisible(false);
resetVisiblepublic void setVisible(boolean value)
Gets or sets a value indicating the Dockablebar object should be shown or not.
Hiding a DockableBar object not destroy or lose previous settings assigned by other methods.
To hide the data grid:
chart1.getDataGrid().setVisible(false);
value - resetVisiblepublic int getWidth()
Sets the height in pixels.
When you modify the width, the isAutoSize method will be set to False.
To set the width for the data grid to 300 pixels:
chart1.getDataGrid().setWidth((short)300);
resetWidthpublic void setWidth(int value)
Sets the height in pixels.
When you modify the width, the isAutoSize method will be set to False.
To set the width for the data grid to 300 pixels:
chart1.getDataGrid().setWidth((short)300);
value - resetWidthpublic int getZOrder()
int zOrderDG; zOrderDG = chart1.getDataGrid().getZOrder();
resetZOrderpublic void setZOrder(int value)
int zOrderDG; zOrderDG = chart1.getDataGrid().getZOrder();
value - resetZOrderpublic void resetAutoSize()
isAutoSizepublic void resetBackColor()
setBackColorpublic void resetBorder()
setBorderpublic void resetDock()
setDockpublic void resetHeight()
setHeightpublic void resetVisible()
isVisiblepublic void resetWidth()
setWidthpublic void resetZOrder()
setZOrderpublic void addVisibleChangedListener(EventListener value)
value - public void removeVisibleChangedListener(EventListener value)
value - 2014 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.