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 ImageBorder
using the method setChartBorder
.
The following methods of the Chart
return 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);
resetAutoSize
public void setAutoSize(boolean value)
chart1.getDataGrid().setAutoSize(false);
value
- resetAutoSize
public 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));
resetBackColor
public 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
- resetBackColor
public DockBorder getBorder()
chart1.getDataGrid().setChartBorder(DockBorder.EXTERNAL);
resetBorder
public void setBorder(DockBorder value)
chart1.getDataGrid().setChartBorder(DockBorder.EXTERNAL);
value
- resetBorder
public 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);
resetDock
public 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
- resetDock
public 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);
resetHeight
public 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
- resetHeight
public 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);
resetVisible
public 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
- resetVisible
public 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);
resetWidth
public 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
- resetWidth
public int getZOrder()
int zOrderDG; zOrderDG = chart1.getDataGrid().getZOrder();
resetZOrder
public void setZOrder(int value)
int zOrderDG; zOrderDG = chart1.getDataGrid().getZOrder();
value
- resetZOrder
public void resetAutoSize()
isAutoSize
public void resetBackColor()
setBackColor
public void resetBorder()
setBorder
public void resetDock()
setDock
public void resetHeight()
setHeight
public void resetVisible()
isVisible
public void resetWidth()
setWidth
public void resetZOrder()
setZOrder
public 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.