|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectactionListeners.AxisDisplaySettingsActionListener
public class AxisDisplaySettingsActionListener
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.
Field Summary | |
---|---|
private boolean |
autoFitAxis
Specifies whether Axes should be autofitted. |
private java.awt.Color |
axisColor
The axis color. |
private java.awt.Color |
axisLabelColor
The axis label color. |
private Chart |
chart
The chart for which the settings are edited. |
private Axis |
currentAxis
The Axis currently being edited. |
private javax.swing.JDialog |
dialog
The display settings dialog. |
private boolean |
invertAxis
Specifies whether the Axis is inverted. |
private boolean |
invertFilter
Specifies whether the Filters are inverted. |
private AxisDisplaySettingsPanel |
panel
The panel on which the display settings controls are located. |
(package private) static boolean |
printLog
Flag to enable debug message printing for this class. |
private boolean |
spinnerValueChanged
Remembers when the spinner value was modified. |
private java.awt.Color |
ticLabelColor
The tic label color. |
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. |
private boolean |
isSettingsChanged()
Checks if is settings changed. |
private void |
log(java.lang.String message)
Prints debug information to stdout when printLog is set to true. |
private void |
readSettings()
Read settings from Axis to initialise the settings in the memory. |
void |
setCurrentAxis(Axis currentAxis)
Sets the current axis. |
void |
stateChanged(javax.swing.event.ChangeEvent e)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final boolean printLog
private javax.swing.JDialog dialog
private java.awt.Color axisColor
Axis.getAxisColor()
private java.awt.Color axisLabelColor
Axis.getAxisLabelFontColor()
private java.awt.Color ticLabelColor
Axis.getTicLabelFontSize()
private boolean invertFilter
Filter
,
Axis.isFilterInverted()
private boolean invertAxis
Axis.isAxisInverted()
private boolean autoFitAxis
Axis
private AxisDisplaySettingsPanel panel
Axis.isAutoFit()
private Chart chart
Only applies if constructor AxisDisplaySettingsActionListener(JDialog, AxisDisplaySettingsPanel, Chart)
was used.
private Axis currentAxis
AxisDisplaySettingsActionListener(JDialog, AxisDisplaySettingsPanel, Chart)
was used.
private boolean spinnerValueChanged
This is needed to decide whether settings were modified and require a save operation when the user closes the dialog or changes the Axis to be edited.
Constructor Detail |
---|
public AxisDisplaySettingsActionListener(Main mainWindow, javax.swing.JDialog dialog, AxisDisplaySettingsPanel panel)
mainWindow
- the main windowdialog
- the dialogpanel
- the panelpublic AxisDisplaySettingsActionListener(javax.swing.JDialog dialog, AxisDisplaySettingsPanel panel, Chart chart)
dialog
- the dialogpanel
- the panelchart
- the chartMethod Detail |
---|
private void readSettings()
public void stateChanged(javax.swing.event.ChangeEvent e)
stateChanged
in interface javax.swing.event.ChangeListener
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
private void log(java.lang.String message)
message
- the messagepublic java.awt.Color getAxisColor()
public java.awt.Color getAxisLabelColor()
public boolean isInvertFilter()
public java.awt.Color getTicLabelColor()
public Axis getCurrentAxis()
public void setCurrentAxis(Axis currentAxis)
currentAxis
- the new current axispublic void applySettings(Axis axis)
axis
- the axisprivate boolean isSettingsChanged()
public boolean isInvertAxis()
public boolean isAutoFitAxis()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |