actionListeners
Class AxisDisplaySettingsActionListener

java.lang.Object
  extended by actionListeners.AxisDisplaySettingsActionListener
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, javax.swing.event.ChangeListener

public class AxisDisplaySettingsActionListener
extends java.lang.Object
implements java.awt.event.ActionListener, javax.swing.event.ChangeListener

ActionListener that is used for the controls on the AxisDisplaySettingsPanel.

Remembers changes made by the user and applies them when the user confirms by pressing ok on the dialog.

When the Axis that is currently being edited changes the user is asked whether he wants to save the changes to the current Axis. This is a workaround to avoid having to store each setting along with the information for which Axis it was made. Ideally all settings should be memorized and applied when the user closes the dialog with the Ok button.


Constructor Summary
AxisDisplaySettingsActionListener(javax.swing.JDialog dialog, AxisDisplaySettingsPanel panel, Chart chart)
          Instantiates a new axis display settings action listener for a specific Chart.
AxisDisplaySettingsActionListener(Main mainWindow, javax.swing.JDialog dialog, AxisDisplaySettingsPanel panel)
          Instantiates a new axis display settings action listener for editing the default settings.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void applySettings(Axis axis)
          Apply settings.
 java.awt.Color getAxisColor()
          Gets the axis color.
 java.awt.Color getAxisLabelColor()
          Gets the axis label color.
 Axis getCurrentAxis()
          Gets the axis that is currently being edited.
 java.awt.Color getTicLabelColor()
          Gets the tic label color.
 boolean isAutoFitAxis()
          Checks if Axis is autofitted.
 boolean isInvertAxis()
          Checks if is Axis is inverted.
 boolean isInvertFilter()
          Checks if filters are inverted.
 void setCurrentAxis(Axis currentAxis)
          Sets the current axis.
 void stateChanged(javax.swing.event.ChangeEvent e)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AxisDisplaySettingsActionListener

public AxisDisplaySettingsActionListener(Main mainWindow,
                                         javax.swing.JDialog dialog,
                                         AxisDisplaySettingsPanel panel)
Instantiates a new axis display settings action listener for editing the default settings.

Parameters:
mainWindow - the main window
dialog - the dialog
panel - the panel

AxisDisplaySettingsActionListener

public AxisDisplaySettingsActionListener(javax.swing.JDialog dialog,
                                         AxisDisplaySettingsPanel panel,
                                         Chart chart)
Instantiates a new axis display settings action listener for a specific Chart.

Parameters:
dialog - the dialog
panel - the panel
chart - the chart
Method Detail

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent e)
Specified by:
stateChanged in interface javax.swing.event.ChangeListener

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

getAxisColor

public java.awt.Color getAxisColor()
Gets the axis color.

Returns:
the axis color

getAxisLabelColor

public java.awt.Color getAxisLabelColor()
Gets the axis label color.

Returns:
the axis label color

isInvertFilter

public boolean isInvertFilter()
Checks if filters are inverted.

Returns:
true, if filters are inverted.

getTicLabelColor

public java.awt.Color getTicLabelColor()
Gets the tic label color.

Returns:
the tic label color

getCurrentAxis

public Axis getCurrentAxis()
Gets the axis that is currently being edited.

Returns:
the axis that is currently being edited.

setCurrentAxis

public void setCurrentAxis(Axis currentAxis)
Sets the current axis.

Parameters:
currentAxis - the new current axis

applySettings

public void applySettings(Axis axis)
Apply settings.

Parameters:
axis - the axis

isInvertAxis

public boolean isInvertAxis()
Checks if is Axis is inverted.

Returns:
true, if is Axis is inverted.

isAutoFitAxis

public boolean isAutoFitAxis()
Checks if Axis is autofitted.

Returns:
true, if Axis is autofitted