Class AddClassification
- java.lang.Object
-
- javax.swing.AbstractAction
-
- adams.gui.action.AbstractBaseAction
-
- adams.flow.transformer.pixelselector.AbstractPixelSelectorAction
-
- adams.flow.transformer.pixelselector.AddClassification
-
- All Implemented Interfaces:
CleanUpHandler
,Destroyable
,OptionHandler
,BaseAction
,ActionListener
,Serializable
,Cloneable
,EventListener
,Action
public class AddClassification extends AbstractPixelSelectorAction
Allows the user to select a pixel location and add a corresponding classification for it.
Stores the location with prefix 'Pixel.X.' and 'Pixel.Y.' and the classification using 'Classification.' as prefix.
Valid options are:
-label <adams.core.base.BaseString> [-label ...] (property: labels) The labels to offer the user for classifying the pixel. default:
-remember-last-selection (property: rememberLastSelection) If enabled, the last selected label will get selected by default the next time this action is chosen.
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
CLASSIFICATION
the classification prefix.protected BaseString[]
m_Labels
the classification labels to use.protected boolean
m_RememberLastSelection
whether to remember the last selection.static String
PIXEL_X
the pixel location X prefix.static String
PIXEL_Y
the pixel location Y prefix.-
Fields inherited from class adams.flow.transformer.pixelselector.AbstractPixelSelectorAction
m_OptionManager, MOUSE_POSITION, PANEL, PIXEL_POSITION
-
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 AddClassification()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
check()
Performs a check on the setup.void
defineOptions()
Adds options to the internal list of options.protected boolean
doProcessAction(ActionEvent e)
Reacts to the action event.BaseString[]
getLabels()
Returns the available classification labels.protected int
getNextClassificationIndex(Report report)
Returns the next free classification index.boolean
getRememberLastSelection()
Returns whether to remmeber the last selected label.protected String
getTitle()
Returns the title of the action (used as menu item text).String
globalInfo()
Returns a string describing the object.String
labelsTipText()
Returns the tip text for this property.String
rememberLastSelectionTipText()
Returns the tip text for this property.void
setLabels(BaseString[] value)
Sets the available classification labels.void
setRememberLastSelection(boolean value)
Sets whether to remember the last selected label.-
Methods inherited from class adams.flow.transformer.pixelselector.AbstractPixelSelectorAction
cleanUpOptions, destroy, doActionPerformed, finishInit, getMousePosition, getOptionManager, getPanel, getPixelPosition, hasMousePosition, hasPanel, hasPixelPosition, initialize, newOptionManager, reset, setMousePosition, setPanel, setPixelPosition, toCommandLine, toString
-
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
-
PIXEL_X
public static final String PIXEL_X
the pixel location X prefix.- See Also:
- Constant Field Values
-
PIXEL_Y
public static final String PIXEL_Y
the pixel location Y prefix.- See Also:
- Constant Field Values
-
CLASSIFICATION
public static final String CLASSIFICATION
the classification prefix.- See Also:
- Constant Field Values
-
m_Labels
protected BaseString[] m_Labels
the classification labels to use.
-
m_RememberLastSelection
protected boolean m_RememberLastSelection
whether to remember the last selection.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in classAbstractPixelSelectorAction
- Returns:
- a description suitable for displaying in the gui
-
getTitle
protected String getTitle()
Returns the title of the action (used as menu item text).- Specified by:
getTitle
in classAbstractPixelSelectorAction
- Returns:
- the title
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractPixelSelectorAction
-
setLabels
public void setLabels(BaseString[] value)
Sets the available classification labels.- Parameters:
value
- the labels
-
getLabels
public BaseString[] getLabels()
Returns the available classification labels.- Returns:
- the labels
-
labelsTipText
public String labelsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setRememberLastSelection
public void setRememberLastSelection(boolean value)
Sets whether to remember the last selected label.- Parameters:
value
- true if to remember
-
getRememberLastSelection
public boolean getRememberLastSelection()
Returns whether to remmeber the last selected label.- Returns:
- true if remembered
-
rememberLastSelectionTipText
public String rememberLastSelectionTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getNextClassificationIndex
protected int getNextClassificationIndex(Report report)
Returns the next free classification index.- Parameters:
report
- the report to check against- Returns:
- the next free index
-
doProcessAction
protected boolean doProcessAction(ActionEvent e)
Reacts to the action event.- Specified by:
doProcessAction
in classAbstractPixelSelectorAction
- Parameters:
e
- the event- Returns:
- true if to update the report table
-
check
public String check()
Performs a check on the setup.- Overrides:
check
in classAbstractPixelSelectorAction
- Returns:
- null if check passed, otherwise the error message
-
-