Class AbstractPixelSelectorAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- adams.gui.action.AbstractBaseAction
-
- adams.flow.transformer.pixelselector.AbstractPixelSelectorAction
-
- All Implemented Interfaces:
CleanUpHandler,Destroyable,OptionHandler,BaseAction,ActionListener,Serializable,Cloneable,EventListener,Action
- Direct Known Subclasses:
AddClassification,BottomRightCorner,SimpleSelect,TopLeftCorner
public abstract class AbstractPixelSelectorAction extends AbstractBaseAction implements OptionHandler
Ancestor for actions for thePixelSelectorinteractive transformer.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected OptionManagerm_OptionManagerfor managing the available options.static StringMOUSE_POSITIONthe mouse position key.static StringPANELthe panel this action is for.static StringPIXEL_POSITIONthe pixel position key.-
Fields inherited from class adams.gui.action.AbstractBaseAction
ASYNCHRONOUS
-
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 Constructor Description AbstractPixelSelectorAction()Initializes the object.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Stringcheck()Performs a check on the setup.voidcleanUpOptions()Cleans up the options.voiddefineOptions()Adds options to the internal list of options.voiddestroy()Frees up memory in a "destructive" non-reversible way.protected voiddoActionPerformed(ActionEvent e)Invoked when an action occurs.protected abstract booleandoProcessAction(ActionEvent e)Reacts to the action event.protected voidfinishInit()Finishes the initialization in the constructor.PointgetMousePosition()Returns the mouse position, if available.OptionManagergetOptionManager()Returns the option manager.PixelSelectorPanelgetPanel()Returns the panel, if available.PointgetPixelPosition()Returns the pixel position, if available.protected abstract StringgetTitle()Returns the title of the action (used as menu item text).abstract StringglobalInfo()Returns a string describing the object.booleanhasMousePosition()Checks whether a mouse position is available.booleanhasPanel()Checks whether a panel is available.booleanhasPixelPosition()Checks whether a pixel position is available.protected voidinitialize()Initializes the members.protected OptionManagernewOptionManager()Returns a new instance of the option manager.protected voidreset()Resets the scheme.voidsetMousePosition(Point value)Stores the mouse position in the action.voidsetPanel(PixelSelectorPanel value)Stores the panel in the action.voidsetPixelPosition(Point value)Stores the pixel position in the action.StringtoCommandLine()Returns the commandline string.StringtoString()Returns a string representation of the options.-
Methods inherited from class adams.gui.action.AbstractBaseAction
actionPerformed, cleanUp, getAccelerator, getIcon, getMnemonic, getName, getToolTipText, hasAccelerator, hasIcon, hasMnemonic, hasToolTipText, isAsynchronous, isSelected, postActionPerformed, preActionPerformed, setAccelerator, setAsynchronous, setIcon, setIcon, setMnemonic, setName, setSelected, setToolTipText
-
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, wait, wait, wait
-
Methods inherited from interface javax.swing.Action
accept, addPropertyChangeListener, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
MOUSE_POSITION
public static final String MOUSE_POSITION
the mouse position key.- See Also:
- Constant Field Values
-
PIXEL_POSITION
public static final String PIXEL_POSITION
the pixel position key.- See Also:
- Constant Field Values
-
PANEL
public static final String PANEL
the panel this action is for.- See Also:
- Constant Field Values
-
m_OptionManager
protected OptionManager m_OptionManager
for managing the available options.
-
-
Method Detail
-
globalInfo
public abstract String globalInfo()
Returns a string describing the object.- Returns:
- a description suitable for displaying in the gui
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein classAbstractBaseAction
-
getTitle
protected abstract String getTitle()
Returns the title of the action (used as menu item text).- Returns:
- the title
-
reset
protected void reset()
Resets the scheme.
-
newOptionManager
protected OptionManager newOptionManager()
Returns a new instance of the option manager.- Returns:
- the manager to use
-
defineOptions
public void defineOptions()
Adds options to the internal list of options. Derived classes must override this method to add additional options.- Specified by:
defineOptionsin interfaceOptionHandler
-
finishInit
protected void finishInit()
Finishes the initialization in the constructor.
Default implementation does nothing.
-
getOptionManager
public OptionManager getOptionManager()
Returns the option manager.- Specified by:
getOptionManagerin interfaceOptionHandler- Returns:
- the manager
-
cleanUpOptions
public void cleanUpOptions()
Cleans up the options.- Specified by:
cleanUpOptionsin interfaceOptionHandler
-
destroy
public void destroy()
Frees up memory in a "destructive" non-reversible way.
Cleans up the options.- Specified by:
destroyin interfaceDestroyable- See Also:
cleanUpOptions()
-
toString
public String toString()
Returns a string representation of the options.
-
toCommandLine
public String toCommandLine()
Returns the commandline string.- Specified by:
toCommandLinein interfaceOptionHandler- Returns:
- the commandline
-
setMousePosition
public void setMousePosition(Point value)
Stores the mouse position in the action.- Parameters:
value- the current mouse position, null to remove it
-
hasMousePosition
public boolean hasMousePosition()
Checks whether a mouse position is available.- Returns:
- true if position is available
-
getMousePosition
public Point getMousePosition()
Returns the mouse position, if available.- Returns:
- the position, null if not availabel
-
setPixelPosition
public void setPixelPosition(Point value)
Stores the pixel position in the action.- Parameters:
value- the current pixel position, null to remove it
-
hasPixelPosition
public boolean hasPixelPosition()
Checks whether a pixel position is available.- Returns:
- true if position is available
-
getPixelPosition
public Point getPixelPosition()
Returns the pixel position, if available.- Returns:
- the position, null if not availabel
-
setPanel
public void setPanel(PixelSelectorPanel value)
Stores the panel in the action.- Parameters:
value- the panel, null to remove it
-
hasPanel
public boolean hasPanel()
Checks whether a panel is available.- Returns:
- true if panel is available
-
getPanel
public PixelSelectorPanel getPanel()
Returns the panel, if available.- Returns:
- the panel, null if not availabel
-
doProcessAction
protected abstract boolean doProcessAction(ActionEvent e)
Reacts to the action event.- Parameters:
e- the event- Returns:
- true if to update the report table
-
doActionPerformed
protected void doActionPerformed(ActionEvent e)
Invoked when an action occurs.- Specified by:
doActionPerformedin classAbstractBaseAction- Parameters:
e- the action- See Also:
doProcessAction(ActionEvent)
-
check
public String check()
Performs a check on the setup.
Default implementation always returns null.- Returns:
- null if check passed, otherwise the error message
-
-