adams.flow.transformer.pixelselector
Class AddClassification

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by adams.gui.action.AbstractBaseAction
          extended by adams.flow.transformer.pixelselector.AbstractPixelSelectorAction
              extended by adams.flow.transformer.pixelselector.AddClassification
All Implemented Interfaces:
Destroyable, OptionHandler, 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: 4835 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
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 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
AddClassification()
           
 
Method Summary
 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
actionPerformed, cleanUpOptions, destroy, finishInit, getMousePosition, getOptionManager, getPanel, getPixelPosition, hasMousePosition, hasPanel, hasPixelPosition, initialize, newOptionManager, reset, setMousePosition, setPanel, setPixelPosition, toCommandLine, toString
 
Methods inherited from class adams.gui.action.AbstractBaseAction
getAccelerator, getIcon, getMnemonic, getName, getToolTipText, hasAccelerator, hasMnemonic, hasToolTipText, isSelected, setAccelerator, 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
 

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.

Constructor Detail

AddClassification

public AddClassification()
Method Detail

globalInfo

public String globalInfo()
Returns a string describing the object.

Specified by:
globalInfo in class AbstractPixelSelectorAction
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 class AbstractPixelSelectorAction
Returns:
the title

defineOptions

public void defineOptions()
Adds options to the internal list of options.

Specified by:
defineOptions in interface OptionHandler
Overrides:
defineOptions in class AbstractPixelSelectorAction

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 class AbstractPixelSelectorAction
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 class AbstractPixelSelectorAction
Returns:
null if check passed, otherwise the error message


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.