info.monitorenter.gui.chart.controls
Class LayoutFactory

java.lang.Object
  extended by info.monitorenter.gui.chart.controls.LayoutFactory

public final class LayoutFactory
extends Object

Factory that provides creational methods for adding UI controls to Chart2D instances and ITrace2D instances.

Version:
$Revision: 1.27 $
Author:
Achim Westermann

Nested Class Summary
static class LayoutFactory.BasicPropertyAdaptSupport
          Implementation for a PropertyChangeListener that adpapts a wrapped JComponent to the following properties.
static class LayoutFactory.PropertyChangeCheckBoxMenuItem
          A JCheckBoxMenuItem that listens for changes of background color, foreground color and font of the given JComponent and adapts it's own settings.
static class LayoutFactory.PropertyChangeMenuItem
          A JMenuItem that listens for changes of background color, foreground color and font of the given JComponent and adapts it's own settings.
static class LayoutFactory.SelectionPropertyAdaptSupport
          Implementation for a PropertyChangeListener that adpapts a wrapped JComponent to the following properties.
 
Method Summary
protected  JMenuItem createAxisMenuItem(IAxis axis, int axisDimension, boolean adaptUI2Chart)
          Creates a JMenuItem that allows to trigger the features related to AAxis features.
 JMenu createAxisRangePolicyMenu(Chart2D chart, IAxis axis, boolean adaptUI2Chart)
          Creates a radio button menu for choose one the available IRangePolicy implementations to set to it's axis identified by argument axis.
 JMenu createAxisTitleMenu(Chart2D chart, IAxis axis, int axisDimension, boolean adaptUI2Chart)
          Creates a menu for settings related to the axis title of the axis of the given chart that will be identified by argument axisDimension.
 JMenu createAxisTypeMenu(Chart2D chart, IAxis axis, int axisDimension, boolean adaptUI2Chart)
          Creates a radio button menu for choose one the available axis types of the given chart that will be set to it's axis identified by argument axisDimension.
 JMenu createBackgroundColorMenu(Chart2D chart, boolean adaptUI2Chart)
          Creates a menu for choosing the background color of the given chart.
 JLabel createContextMenuLabel(Chart2D chart, ITrace2D trace, boolean adaptUI2Chart)
          Creates a JLabel that is capable of triggering a JPopupMenu for the settings available for the ITrace2D.
 JMenu createErrorBarWizardMenu(Chart2D chart, ITrace2D trace, boolean adaptUI2Chart)
          Creates a menu for showing the wizard for the IErrorBarPolicy instances of the given trace.
 JMenuItem createForegroundColorMenu(Chart2D chart, boolean adaptUI2Chart)
          Creates a menu for choosing the foreground color of the given chart.
 JMenu createGridColorMenu(Chart2D chart, boolean adaptUI2Chart)
          Creates a menu for choosing the grid color of the given chart.
 JMenu createMenu(Chart2D chart, boolean adaptUI2Chart)
          Creates a menu that offers various controls over the given chart.
 JMenuBar createMenuBar(Chart2D chart, boolean adaptUI2Chart)
          Creates a menu bar that offers various controls over the given chart.
 void createPopupMenu(Chart2D chart, boolean adaptUI2Chart)
          Adds a popup menu to the given chart that offers various controls over it.
 JMenu createTraceColorMenu(Chart2D chart, ITrace2D trace, JComponent parent, boolean adaptUI2Chart)
          Creates a menu for choosing the color of the given trace.
 JMenu createTracePainterMenu(Chart2D chart, ITrace2D trace, boolean adaptUI2Chart)
          Creates a menu for choosing the ITracePainter of the given trace.
 JMenu createTraceStrokesMenu(Chart2D chart, ITrace2D trace, boolean adaptUI2Chart)
          Creates a menu for choosing the Stroke of the given trace.
 JMenu createTraceZindexMenu(Chart2D chart, ITrace2D trace, boolean adaptUI2Chart)
          Creates a menu for choosing the z-index of the given trace.
static LayoutFactory getInstance()
          Singleton retrival method.
 boolean isShowAxisXGridMenu()
          Returns wether the chart show x grid menu should be created.
 boolean isShowAxisXMenu()
          Returns whether the axis x menu is shown.
 boolean isShowAxisXRangePolicyMenu()
          Returns whether the axis x range policy menu is shown.
 boolean isShowAxisXTypeMenu()
          Returns whether the axis x type menu is shown.
 boolean isShowAxisYGridMenu()
          Returns whether the axis y show grid menu is shown.
 boolean isShowAxisYMenu()
          Returns whether the axis y menu is shown.
 boolean isShowAxisYRangePolicyMenu()
          Returns whether the axis y range policy menu is shown.
 boolean isShowAxisYTypeMenu()
          Returns whether the axis y type menu is shown.
 boolean isShowChartBackgroundMenu()
          Returns whether the chart set background color menu is shown.
 boolean isShowChartForegroundMenu()
          Returns whether the chart set foreground color menu is shown.
 boolean isShowGridColorMenu()
          Returns whether the chart grid color menu is shown.
protected  boolean isShowPhysicalUnitsMenu()
           
protected  boolean isShowRemoveTraceMenu()
           
 boolean isShowSaveImageMenu()
          Returns whether the save image menu is shown.
 boolean isShowTraceColorMenu()
           
 boolean isShowTraceNameMenu()
           
 boolean isShowTracePainterMenu()
           
 boolean isShowTraceStrokeMenu()
           
 boolean isShowTraceVisibleMenu()
           
 boolean isShowTraceZindexMenu()
           
 boolean isZoomOutMenu()
           
 void setShowAxisXGridMenu(boolean showAxisXGridMenu)
          Set wether the axis x show grid menu should be created.
 void setShowAxisXMenu(boolean showAxisXMenu)
          Set wether the axis x menu should be created.
 void setShowAxisXRangePolicyMenu(boolean showAxisXRangePolicyMenu)
          Set wether the axis x range policy menu should be created.
 void setShowAxisXTypeMenu(boolean showAxisXTypeMenu)
          Set wether the axis x type menu should be created.
 void setShowAxisYGridMenu(boolean showAxisYGridMenu)
          Set wether the axis y show grid menu should be created.
 void setShowAxisYMenu(boolean showAxisYMenu)
          Set wether the axis y menu should be created.
 void setShowAxisYRangePolicyMenu(boolean showAxisYRangePolicyMenu)
          Set wether the axis y range policy menu should be created.
 void setShowAxisYTypeMenu(boolean showAxisYTypeMenu)
          Set wether the axis y type menu should be created.
 void setShowChartBackgroundMenu(boolean showChartBackgroundMenu)
          Set wether the chart set background menu should be created.
 void setShowChartForegroundMenu(boolean showChartForegroundMenu)
          Set wether the chart set foreground menu should be created.
 void setShowGridColorMenu(boolean showGridColorMenu)
          Set wether the chart grid color menu should be created.
protected  void setShowPhysicalUnitsMenu(boolean showPhysicalUnitsMenu)
           
protected  void setShowRemoveTraceMenu(boolean showRemoveTraceMenu)
           
 void setShowSaveImageMenu(boolean showSaveImageMenu)
          Set wether the save to image menu should be created.
 void setShowTraceColorMenu(boolean showTraceColorMenu)
           
 void setShowTraceNameMenu(boolean showTraceNameMenu)
           
 void setShowTracePainterMenu(boolean showTracePainterMenu)
           
 void setShowTraceStrokeMenu(boolean showTraceStrokeMenu)
           
 void setShowTraceVisibleMenu(boolean showTraceVisibleMenu)
           
 void setShowTraceZindexMenu(boolean showTraceZindexMenu)
           
 void setZoomOutMenu(boolean showZoomOutMenu)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static LayoutFactory getInstance()
Singleton retrival method.

Returns:
the single instance of this factory within this VM.

createAxisMenuItem

protected JMenuItem createAxisMenuItem(IAxis axis,
                                       int axisDimension,
                                       boolean adaptUI2Chart)
Creates a JMenuItem that allows to trigger the features related to AAxis features.

Parameters:
axis - the axis to control.
axisDimension - Identifies which dimension the axis controls in the chart: either Chart2D.X or Chart2D.Y
adaptUI2Chart - if true the menu will adapt it's basic UI properies (font, foreground and background color) to the given chart.
Returns:
a JMenuItem that allows to trigger the features related to AAxis features.

createAxisRangePolicyMenu

public JMenu createAxisRangePolicyMenu(Chart2D chart,
                                       IAxis axis,
                                       boolean adaptUI2Chart)
Creates a radio button menu for choose one the available IRangePolicy implementations to set to it's axis identified by argument axis.

Parameters:
axis - the axis to control.
adaptUI2Chart - if true the menu will adapt it's basic UI properies (font, foreground and background color) to the given chart.
chart - the component to adapt the UI of this menu if adaption is requested.
Returns:
a radio button menu for choose one the available IRangePolicy implementations to set to it's axis identified by argument axis.

createAxisTitleMenu

public JMenu createAxisTitleMenu(Chart2D chart,
                                 IAxis axis,
                                 int axisDimension,
                                 boolean adaptUI2Chart)
Creates a menu for settings related to the axis title of the axis of the given chart that will be identified by argument axisDimension.

Parameters:
axis - the axis to control.
axisDimension - Identifies which dimension the axis controls in the chart: either Chart2D.X or Chart2D.Y
adaptUI2Chart - if true the menu will adapt it's basic UI properies (font, foreground and background color) to the given chart.
chart - the component to adapt the UI of this menu if adaption is requested.
Returns:
a menu for settings related to the axis title of the axis of the given chart that will be identified by argument axisDimension.

createAxisTypeMenu

public JMenu createAxisTypeMenu(Chart2D chart,
                                IAxis axis,
                                int axisDimension,
                                boolean adaptUI2Chart)
Creates a radio button menu for choose one the available axis types of the given chart that will be set to it's axis identified by argument axisDimension.

Parameters:
axis - the axis to control.
axisDimension - Identifies which dimension the axis controls in the chart: either Chart2D.X or Chart2D.Y
adaptUI2Chart - if true the menu will adapt it's basic UI properies (font, foreground and background color) to the given chart.
chart - the component to adapt the UI of this menu if adaption is requested.
Returns:
a radio button menu for choose one the available axis types of the given chart that will be set to it's axis identified by argument axisDimension.

createBackgroundColorMenu

public JMenu createBackgroundColorMenu(Chart2D chart,
                                       boolean adaptUI2Chart)
Creates a menu for choosing the background color of the given chart.

Parameters:
chart - the chart to set the background color of by the menu to return.
adaptUI2Chart - if true the menu will adapt it's basic UI properies (font, foreground and background color) to the given chart.
Returns:
a menu for choosing the background color of the given chart.

createContextMenuLabel

public JLabel createContextMenuLabel(Chart2D chart,
                                     ITrace2D trace,
                                     boolean adaptUI2Chart)
Creates a JLabel that is capable of triggering a JPopupMenu for the settings available for the ITrace2D.

Parameters:
chart - The chart the given trace is a member of. This will be used for getting a PopupMenu that adapts to layout properties (such as background color).
trace - The trace on which the JPopupMenu of the JLabel will act.
adaptUI2Chart - if true the menu will adapt it's basic UI properies (font, foreground and background color) to the given chart.
Returns:
a label that offers a popup menue with controls for the given trace.

createErrorBarWizardMenu

public JMenu createErrorBarWizardMenu(Chart2D chart,
                                      ITrace2D trace,
                                      boolean adaptUI2Chart)
Creates a menu for showing the wizard for the IErrorBarPolicy instances of the given trace.

Parameters:
chart - needed to adapt the basic ui properties to (font, foreground color, background color).
trace - the trace to show the error bar wizards of.
adaptUI2Chart - if true the menu will adapt it's basic UI properies (font, foreground and background color) to the given chart.
Returns:
a menu that offers to show the ErrorBarWizard dialogs for the given trace.

createForegroundColorMenu

public JMenuItem createForegroundColorMenu(Chart2D chart,
                                           boolean adaptUI2Chart)
Creates a menu for choosing the foreground color of the given chart.

Parameters:
chart - the chart to set the foreground color of by the menu to return.
adaptUI2Chart - if true the menu will adapt it's basic UI properies (font, foreground and background color) to the given chart.
Returns:
a menu for choosing the foreground color of the given chart.

createGridColorMenu

public JMenu createGridColorMenu(Chart2D chart,
                                 boolean adaptUI2Chart)
Creates a menu for choosing the grid color of the given chart.

Parameters:
chart - the chart to set the grid color of by the menu to return.
adaptUI2Chart - if true the menu will adapt it's basic UI properies (font, foreground and background color) to the given chart.
Returns:
a menu for choosing the grid color of the given chart.

createMenu

public JMenu createMenu(Chart2D chart,
                        boolean adaptUI2Chart)
Creates a menu that offers various controls over the given chart.

Parameters:
chart - the chart to access.
adaptUI2Chart - if true the menu will adapt it's basic UI properies (font, foreground and background color) to the given chart.
Returns:
a menu that offers various controls over the given chart.

createMenuBar

public JMenuBar createMenuBar(Chart2D chart,
                              boolean adaptUI2Chart)
Creates a menu bar that offers various controls over the given chart.

Parameters:
chart - the chart to access.
adaptUI2Chart - if true the menu will adapt it's basic UI properies (font, foreground and background color) to the given chart.
Returns:
a menu bar that offers various controls over the given chart.

createPopupMenu

public void createPopupMenu(Chart2D chart,
                            boolean adaptUI2Chart)
Adds a popup menu to the given chart that offers various controls over it.

Parameters:
chart - the chart to add the popup menue to.
adaptUI2Chart - if true the menu will adapt it's basic UI properies (font, foreground and background color) to the given chart.

createTraceColorMenu

public JMenu createTraceColorMenu(Chart2D chart,
                                  ITrace2D trace,
                                  JComponent parent,
                                  boolean adaptUI2Chart)
Creates a menu for choosing the color of the given trace.

Parameters:
chart - needed to adapt the basic ui properties to (font, foreground color, background color).
trace - the trace to set the color of.
parent - needed for a modal dialog for custom color as parent component.
adaptUI2Chart - if true the menu will adapt it's basic UI properies (font, foreground and background color) to the given chart.
Returns:
a menu for choosing the color of the given trace.

createTracePainterMenu

public JMenu createTracePainterMenu(Chart2D chart,
                                    ITrace2D trace,
                                    boolean adaptUI2Chart)
Creates a menu for choosing the ITracePainter of the given trace.

Parameters:
chart - needed to adapt the basic ui properties to (font, foreground color, background color).
trace - the trace to set the painter of.
adaptUI2Chart - if true the menu will adapt it's basic UI properies (font, foreground and background color) to the given chart.
Returns:
a menu for choosing the ITracePainter of the given trace.

createTraceStrokesMenu

public JMenu createTraceStrokesMenu(Chart2D chart,
                                    ITrace2D trace,
                                    boolean adaptUI2Chart)
Creates a menu for choosing the Stroke of the given trace.

Parameters:
chart - needed to adapt the basic ui properties to (font, foreground color, background color).
trace - the trace to set the stroke of.
adaptUI2Chart - if true the menu will adapt it's basic UI properies (font, foreground and background color) to the given chart.
Returns:
a menu for choosing the stroke of the given trace.

createTraceZindexMenu

public JMenu createTraceZindexMenu(Chart2D chart,
                                   ITrace2D trace,
                                   boolean adaptUI2Chart)
Creates a menu for choosing the z-index of the given trace.

Parameters:
chart - needed to adapt the basic ui properties to (font, foreground color, background color).
trace - the trace to set the z-index of.
adaptUI2Chart - if true the menu will adapt it's basic UI properies (font, foreground and background color) to the given chart.
Returns:
a menu for choosing the z-index of the given trace.

isShowAxisXGridMenu

public final boolean isShowAxisXGridMenu()
Returns wether the chart show x grid menu should be created.

Returns:
the showAxisXGridMenu.

isShowAxisXMenu

public final boolean isShowAxisXMenu()
Returns whether the axis x menu is shown.

Returns:
the showAxisXMenu.

isShowAxisXRangePolicyMenu

public final boolean isShowAxisXRangePolicyMenu()
Returns whether the axis x range policy menu is shown.

Returns:
the showAxisXRangePolicyMenu.

isShowAxisXTypeMenu

public final boolean isShowAxisXTypeMenu()
Returns whether the axis x type menu is shown.

Returns:
the showAxisXTypeMenu.

isShowAxisYGridMenu

public final boolean isShowAxisYGridMenu()
Returns whether the axis y show grid menu is shown.

Returns:
the showAxisYGridMenu.

isShowAxisYMenu

public final boolean isShowAxisYMenu()
Returns whether the axis y menu is shown.

Returns:
the showAxisYMenu.

isShowAxisYRangePolicyMenu

public final boolean isShowAxisYRangePolicyMenu()
Returns whether the axis y range policy menu is shown.

Returns:
the showAxisYRangePolicyMenu.

isShowAxisYTypeMenu

public final boolean isShowAxisYTypeMenu()
Returns whether the axis y type menu is shown.

Returns:
the showAxisYTypeMenu.

isShowChartBackgroundMenu

public final boolean isShowChartBackgroundMenu()
Returns whether the chart set background color menu is shown.

Returns:
the showChartBackgroundMenu.

isShowChartForegroundMenu

public final boolean isShowChartForegroundMenu()
Returns whether the chart set foreground color menu is shown.

Returns:
the showChartForegroundMenu.

isShowGridColorMenu

public final boolean isShowGridColorMenu()
Returns whether the chart grid color menu is shown.

Returns:
the showGridColorMenu.

isShowPhysicalUnitsMenu

protected final boolean isShowPhysicalUnitsMenu()
Returns:
the showPhysicalUnitsMenu.

isShowRemoveTraceMenu

protected final boolean isShowRemoveTraceMenu()
Returns:
the showRemoveTraceMenu.

isShowSaveImageMenu

public final boolean isShowSaveImageMenu()
Returns whether the save image menu is shown.

Returns:
the showSaveImageMenu.

isShowTraceColorMenu

public final boolean isShowTraceColorMenu()
Returns:
the showTraceColorMenu.

isShowTraceNameMenu

public final boolean isShowTraceNameMenu()
Returns:
the showTraceNameMenu.

isShowTracePainterMenu

public final boolean isShowTracePainterMenu()
Returns:
the showTracePainterMenu.

isShowTraceStrokeMenu

public final boolean isShowTraceStrokeMenu()
Returns:
the showTraceStrokeMenu.

isShowTraceVisibleMenu

public final boolean isShowTraceVisibleMenu()
Returns:
the showTraceVisibleMenu.

isShowTraceZindexMenu

public final boolean isShowTraceZindexMenu()
Returns:
the showTraceZindexMenu.

isZoomOutMenu

public final boolean isZoomOutMenu()
Returns:
the showZoomOutMenu.

setShowAxisXGridMenu

public final void setShowAxisXGridMenu(boolean showAxisXGridMenu)
Set wether the axis x show grid menu should be created.

Configure this before using any instance of ChartPanel or it will be useless.

Parameters:
showAxisXGridMenu - The showAxisXGridMenu to set.

setShowAxisXMenu

public final void setShowAxisXMenu(boolean showAxisXMenu)
Set wether the axis x menu should be created.

Configure this before using any instance of ChartPanel or it will be useless.

Parameters:
showAxisXMenu - The showAxisXMenu to set.

setShowAxisXRangePolicyMenu

public final void setShowAxisXRangePolicyMenu(boolean showAxisXRangePolicyMenu)
Set wether the axis x range policy menu should be created.

Configure this before using any instance of ChartPanel or it will be useless.

Parameters:
showAxisXRangePolicyMenu - The showAxisXRangePolicyMenu to set.

setShowAxisXTypeMenu

public final void setShowAxisXTypeMenu(boolean showAxisXTypeMenu)
Set wether the axis x type menu should be created.

Configure this before using any instance of ChartPanel or it will be useless.

Parameters:
showAxisXTypeMenu - The showAxisXTypeMenu to set.

setShowAxisYGridMenu

public final void setShowAxisYGridMenu(boolean showAxisYGridMenu)
Set wether the axis y show grid menu should be created.

Configure this before using any instance of ChartPanel or it will be useless.

Parameters:
showAxisYGridMenu - The showAxisYGridMenu to set.

setShowAxisYMenu

public final void setShowAxisYMenu(boolean showAxisYMenu)
Set wether the axis y menu should be created.

Configure this before using any instance of ChartPanel or it will be useless.

Parameters:
showAxisYMenu - The showAxisYMenu to set.

setShowAxisYRangePolicyMenu

public final void setShowAxisYRangePolicyMenu(boolean showAxisYRangePolicyMenu)
Set wether the axis y range policy menu should be created.

Configure this before using any instance of ChartPanel or it will be useless.

Parameters:
showAxisYRangePolicyMenu - The showAxisYRangePolicyMenu to set.

setShowAxisYTypeMenu

public final void setShowAxisYTypeMenu(boolean showAxisYTypeMenu)
Set wether the axis y type menu should be created.

Configure this before using any instance of ChartPanel or it will be useless.

Parameters:
showAxisYTypeMenu - The showAxisYTypeMenu to set.

setShowChartBackgroundMenu

public final void setShowChartBackgroundMenu(boolean showChartBackgroundMenu)
Set wether the chart set background menu should be created.

Configure this before using any instance of ChartPanel or it will be useless.

Parameters:
showChartBackgroundMenu - The showChartBackgroundMenu to set.

setShowChartForegroundMenu

public final void setShowChartForegroundMenu(boolean showChartForegroundMenu)
Set wether the chart set foreground menu should be created.

Configure this before using any instance of ChartPanel or it will be useless.

Parameters:
showChartForegroundMenu - The showChartForegroundMenu to set.

setShowGridColorMenu

public final void setShowGridColorMenu(boolean showGridColorMenu)
Set wether the chart grid color menu should be created.

Configure this before using any instance of ChartPanel or it will be useless.

Parameters:
showGridColorMenu - The showGridColorMenu to set.

setShowPhysicalUnitsMenu

protected final void setShowPhysicalUnitsMenu(boolean showPhysicalUnitsMenu)
Parameters:
showPhysicalUnitsMenu - The showPhysicalUnitsMenu to set.

setShowRemoveTraceMenu

protected final void setShowRemoveTraceMenu(boolean showRemoveTraceMenu)
Parameters:
showRemoveTraceMenu - The showRemoveTraceMenu to set.

setShowSaveImageMenu

public final void setShowSaveImageMenu(boolean showSaveImageMenu)
Set wether the save to image menu should be created.

Configure this before using any instance of ChartPanel or it will be useless.

Parameters:
showSaveImageMenu - The showSaveImageMenu to set.

setShowTraceColorMenu

public final void setShowTraceColorMenu(boolean showTraceColorMenu)
Parameters:
showTraceColorMenu - The showTraceColorMenu to set.

setShowTraceNameMenu

public final void setShowTraceNameMenu(boolean showTraceNameMenu)
Parameters:
showTraceNameMenu - The showTraceNameMenu to set.

setShowTracePainterMenu

public final void setShowTracePainterMenu(boolean showTracePainterMenu)
Parameters:
showTracePainterMenu - The showTracePainterMenu to set.

setShowTraceStrokeMenu

public final void setShowTraceStrokeMenu(boolean showTraceStrokeMenu)
Parameters:
showTraceStrokeMenu - The showTraceStrokeMenu to set.

setShowTraceVisibleMenu

public final void setShowTraceVisibleMenu(boolean showTraceVisibleMenu)
Parameters:
showTraceVisibleMenu - The showTraceVisibleMenu to set.

setShowTraceZindexMenu

public final void setShowTraceZindexMenu(boolean showTraceZindexMenu)
Parameters:
showTraceZindexMenu - The showTraceZindexMenu to set.

setZoomOutMenu

public final void setZoomOutMenu(boolean showZoomOutMenu)
Parameters:
showZoomOutMenu - The showZoomOutMenu to set.


Copyright © 2001 - 2007 LGPL, All Rights Footloose.