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 StringCLASSIFICATIONthe classification prefix.protected BaseString[]m_Labelsthe classification labels to use.protected booleanm_RememberLastSelectionwhether to remember the last selection.static StringPIXEL_Xthe pixel location X prefix.static StringPIXEL_Ythe 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 Stringcheck()Performs a check on the setup.voiddefineOptions()Adds options to the internal list of options.protected booleandoProcessAction(ActionEvent e)Reacts to the action event.BaseString[]getLabels()Returns the available classification labels.protected intgetNextClassificationIndex(Report report)Returns the next free classification index.booleangetRememberLastSelection()Returns whether to remmeber the last selected label.protected StringgetTitle()Returns the title of the action (used as menu item text).StringglobalInfo()Returns a string describing the object.StringlabelsTipText()Returns the tip text for this property.StringrememberLastSelectionTipText()Returns the tip text for this property.voidsetLabels(BaseString[] value)Sets the available classification labels.voidsetRememberLastSelection(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:
globalInfoin 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:
getTitlein classAbstractPixelSelectorAction- Returns:
- the title
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin 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:
doProcessActionin classAbstractPixelSelectorAction- Parameters:
e- the event- Returns:
- true if to update the report table
-
check
public String check()
Performs a check on the setup.- Overrides:
checkin classAbstractPixelSelectorAction- Returns:
- null if check passed, otherwise the error message
-
-