public class ErrorModeSelectionModel extends Object implements uk.ac.starlink.ttools.plot.ErrorModeSelection, ComboBoxModel, ActionListener
ErrorMode
values.
Methods are provided for acquiring GUI controls which reflect this model.Constructor and Description |
---|
ErrorModeSelectionModel(int iaxis,
String axisName)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent evt)
Updates model state and informs listeners as required.
|
void |
addActionListener(ActionListener listener)
Adds a listener which will be informed when the selection changes.
|
void |
addListDataListener(ListDataListener listener)
No-op - the list never changes.
|
JMenuItem[] |
createMenuItems()
Returns a set of menu items which allow selection of the state for
this model.
|
AbstractButton |
createOnOffButton()
Returns a normal button which toggles the mode between no error bars
and symmetrical error bars.
|
AbstractButton |
createOnOffToolbarButton()
Returns a toolbar button which toggles the mode between no error bars
and symmetrical error bars.
|
Object |
getElementAt(int index) |
uk.ac.starlink.ttools.plot.ErrorMode |
getErrorMode()
Returns the currently selected mode.
|
Icon |
getIcon(uk.ac.starlink.ttools.plot.ErrorMode mode,
int width,
int height,
int xpad,
int ypad)
Returns an icon which can be used to represent a given error mode.
|
Object |
getSelectedItem() |
int |
getSize() |
boolean |
isEnabled()
Indicates enabledness of this model.
|
void |
removeActionListener(ActionListener listener)
Removes a listener previously added by
addActionListener(java.awt.event.ActionListener) . |
void |
removeListDataListener(ListDataListener listener)
No-op - the list never changes.
|
void |
setEnabled(boolean enabled)
Toggles enabled state of any controls based on this model.
|
void |
setMode(uk.ac.starlink.ttools.plot.ErrorMode mode)
Sets the selected mode.
|
void |
setSelectedItem(Object mode) |
public ErrorModeSelectionModel(int iaxis, String axisName)
iaxis
- index of the axis for which this model selects ErrorModesaxisName
- name of the axispublic uk.ac.starlink.ttools.plot.ErrorMode getErrorMode()
getErrorMode
in interface uk.ac.starlink.ttools.plot.ErrorModeSelection
public void setMode(uk.ac.starlink.ttools.plot.ErrorMode mode)
mode
- new error modepublic void setEnabled(boolean enabled)
enabled
- true iff user should be able to change statepublic boolean isEnabled()
public void actionPerformed(ActionEvent evt)
actionPerformed
in interface ActionListener
evt
- action whose command string names the new modepublic JMenuItem[] createMenuItems()
public AbstractButton createOnOffToolbarButton()
public AbstractButton createOnOffButton()
public Object getElementAt(int index)
getElementAt
in interface ListModel
public Object getSelectedItem()
getSelectedItem
in interface ComboBoxModel
public void setSelectedItem(Object mode)
setSelectedItem
in interface ComboBoxModel
public void addListDataListener(ListDataListener listener)
addListDataListener
in interface ListModel
public void removeListDataListener(ListDataListener listener)
removeListDataListener
in interface ListModel
public void addActionListener(ActionListener listener)
addActionListener
in interface uk.ac.starlink.ttools.plot.ErrorModeSelection
listener
- listenerpublic void removeActionListener(ActionListener listener)
addActionListener(java.awt.event.ActionListener)
.removeActionListener
in interface uk.ac.starlink.ttools.plot.ErrorModeSelection
listener
- listenerpublic Icon getIcon(uk.ac.starlink.ttools.plot.ErrorMode mode, int width, int height, int xpad, int ypad)
mode
- error modewidth
- total width of iconheight
- total height of iconxpad
- internal horizontal padding of iconypad
- internal vertical padding of iconCopyright © 2003-2025 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.