lt.monarch.chart.plugins.toolbar
Class ChartObjectPropertiesEditor

java.lang.Object
  extended by lt.monarch.chart.plugins.toolbar.ChartObjectPropertiesEditor

public class ChartObjectPropertiesEditor
extends java.lang.Object

Chart toolbar for style editing. Works only with JChartPanel.
To enables default toolbar use JChartPanel.enableChartObjectPropertiesEditor().
To enable a specific toolbar use JChartPanel.enableChartObjectPropertiesEditor(ChartObjectPropertiesEditor).
Enabled toolbar becomes visible after right clicking a chart.
You can enable specific toolbar elements with setElementsEnabled(EnumSet) and listen to events with addToolbarEventListener(ToolbarEventListener).


Field Summary
Modifier and Type Field and Description
protected  java.util.ArrayList<ToolbarEventListener> listeners
          Toolbar event listeners.
 
Constructor Summary
Constructor and Description
ChartObjectPropertiesEditor(JChartPanel container)
          Constructor.
 
Method Summary
Modifier and Type Method and Description
 void addToolbarEventListener(ToolbarEventListener listener)
          Add a toolbar event listener
protected  ToolbarDialog createFloatingWindow()
          Creates a floating window on which toolbar component will be added
 void drawSelectedObjectBounds(AbstractGraphics g)
          Draw bound of selected and rolled over objects
protected  javax.swing.JPopupMenu getOpenFileChoosePopupMenu()
          Lazily initializes "open file" menu.
protected  java.awt.Color getRolloverOutlineColor()
          Gets color for rolled over object outline
protected  java.awt.Stroke getRolloverOutlineStroke()
          Gets stroke for rolled over object outline
protected  javax.swing.JPopupMenu getSaveFileChoosePopupMenu()
          Lazily initializes "save file" menu.
protected  java.awt.Color getSelectionOutlineColor()
          Gets color for selected object outline
protected  java.awt.Stroke getSelectionOutlineStroke()
          Gets stroke for selected object outline
 void hideToolbar()
          Hides the toolbar.
 void installListeners()
          Installs listeners.
 boolean isElementEnabled(ToolbarElements element)
          Can toolbar element become visible.
 void removeToolbarEventListener(ToolbarEventListener listener)
          Remove a toolbar event listener
 void setElementEnabled(ToolbarElements element, boolean enabled)
          Set if element can become visible.
 void setElementsEnabled(java.util.EnumSet<ToolbarElements> elements)
          Set which toolbar elements can become visible.
protected  void setupToolBar(javax.swing.JDialog dialog)
          Adds toolbar components to a dialog.
protected  javax.swing.JPanel setupToolsPanel()
          Creates a panel with toolbar controls.
 void showToolbar(java.awt.Point location)
          Makes the toolbar visible at a specified location
 void uninstallListeners()
          Uninstalls listeners.
protected  void updateToolBarGUIState()
          Sets toolbar GUI component states.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listeners

protected java.util.ArrayList<ToolbarEventListener> listeners
Toolbar event listeners.

Constructor Detail

ChartObjectPropertiesEditor

public ChartObjectPropertiesEditor(JChartPanel container)
Constructor.

Parameters:
container - parent view container
Method Detail

getSelectionOutlineColor

protected java.awt.Color getSelectionOutlineColor()
Gets color for selected object outline

Returns:
color for selected object outline

getRolloverOutlineColor

protected java.awt.Color getRolloverOutlineColor()
Gets color for rolled over object outline

Returns:
color for rolled over object outline

getSelectionOutlineStroke

protected java.awt.Stroke getSelectionOutlineStroke()
Gets stroke for selected object outline

Returns:
stroke for selected object outline

getRolloverOutlineStroke

protected java.awt.Stroke getRolloverOutlineStroke()
Gets stroke for rolled over object outline

Returns:
stroke for rolled over object outline

showToolbar

public void showToolbar(java.awt.Point location)
Makes the toolbar visible at a specified location

Parameters:
location - toolbar location

createFloatingWindow

protected ToolbarDialog createFloatingWindow()
Creates a floating window on which toolbar component will be added

Returns:
a dialog for toolbar components.

updateToolBarGUIState

protected void updateToolBarGUIState()
Sets toolbar GUI component states. This method is called after all style changes.


setupToolsPanel

protected javax.swing.JPanel setupToolsPanel()
Creates a panel with toolbar controls.

Returns:
panel with toolbar controls.

setupToolBar

protected void setupToolBar(javax.swing.JDialog dialog)
Adds toolbar components to a dialog.

Parameters:
dialog - toolbar dialog.

drawSelectedObjectBounds

public void drawSelectedObjectBounds(AbstractGraphics g)
Draw bound of selected and rolled over objects

Parameters:
g - graphics on which to draw

installListeners

public void installListeners()
Installs listeners. This occurs when a toolbar is enabled. Internal API. DO NOT CALL.


uninstallListeners

public void uninstallListeners()
Uninstalls listeners. This occurs when a toolbar is disabled. Internal API. DO NOT CALL.


hideToolbar

public void hideToolbar()
Hides the toolbar.


getOpenFileChoosePopupMenu

protected javax.swing.JPopupMenu getOpenFileChoosePopupMenu()
Lazily initializes "open file" menu.

Returns:
"open file" menu.

getSaveFileChoosePopupMenu

protected javax.swing.JPopupMenu getSaveFileChoosePopupMenu()
Lazily initializes "save file" menu.

Returns:
"save file" menu.

isElementEnabled

public boolean isElementEnabled(ToolbarElements element)
Can toolbar element become visible.

Parameters:
element - toolbar element
Returns:
can element become visible

setElementEnabled

public void setElementEnabled(ToolbarElements element,
                              boolean enabled)
Set if element can become visible.

Parameters:
element - toolbar element
enabled - can element become visible

setElementsEnabled

public void setElementsEnabled(java.util.EnumSet<ToolbarElements> elements)
Set which toolbar elements can become visible.

Parameters:
elements - elements which can become visible

addToolbarEventListener

public void addToolbarEventListener(ToolbarEventListener listener)
Add a toolbar event listener

Parameters:
listener - toolbar event listener

removeToolbarEventListener

public void removeToolbarEventListener(ToolbarEventListener listener)
Remove a toolbar event listener

Parameters:
listener - toolbar event listener