Package uk.ac.starlink.topcat
Class TopcatWindowAction<W extends JFrame>
java.lang.Object
javax.swing.AbstractAction
uk.ac.starlink.topcat.BasicAction
uk.ac.starlink.topcat.TopcatWindowAction<W>
- All Implemented Interfaces:
ActionListener
,Serializable
,Cloneable
,EventListener
,Action
,TopcatToolAction
TopcatToolAction implementation that instantiates a window of a given
class when invoked. The window will be instantiated via a constructor
taking a single
Component
argument;
such a constructor must therefore exist.
This parent component is just used to position the window,
it's permissible, though not encouraged, to just ignore that argument.- Since:
- 24 Jul 2013
- Author:
- Mark Taylor
- See Also:
-
Field Summary
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Performs the action.protected W
Creates an instance of the window class used by this action.void
Sets the parent component to use for initialising windows created by this action.Methods inherited from class uk.ac.starlink.topcat.BasicAction
getEventWindow
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.swing.Action
accept, addPropertyChangeListener, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Constructor Details
-
TopcatWindowAction
Constructor.- Parameters:
name
- action nameicon
- action iconshortdesc
- action short descriptionwinClazz
- class of window to instantiate; must have a constructor that takes a java.awt.Component giving the window parent
-
-
Method Details
-
createWindow
Creates an instance of the window class used by this action.- Returns:
- window initialised with parent component
-
actionPerformed
Performs the action. The default immplementation just callscreateWindow()
and sets it visible. This may be overridden.- Specified by:
actionPerformed
in interfaceActionListener
-
setParent
Sets the parent component to use for initialising windows created by this action.- Specified by:
setParent
in interfaceTopcatToolAction
- Parameters:
parent
- parent component
-