adams.flow.transformer
Class PixelSelector

java.lang.Object
  extended by adams.core.ConsoleObject
      extended by adams.core.option.AbstractOptionHandler
          extended by adams.flow.core.AbstractActor
              extended by adams.flow.transformer.AbstractTransformer
                  extended by adams.flow.transformer.AbstractInteractiveTransformerDialog
                      extended by adams.flow.transformer.PixelSelector
All Implemented Interfaces:
AdditionalInformationHandler, CleanUpHandler, Debuggable, DebugOutputHandler, Destroyable, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<AbstractActor>, SizeOfHandler, Stoppable, VariableChangeListener, Actor, ErrorHandler, InputConsumer, InteractiveActor, OutputProducer, Serializable, Comparable

public class PixelSelector
extends AbstractInteractiveTransformerDialog

Allows the user to select pixels. How the pixels are interpreted depends on the actions selected.
In addition, overlays that visualize the information stored in the image's report can be selected as well. The overlays offer information on what actions generate the data that is required for proper visualization.

Input/output:
- accepts:
   adams.data.image.AbstractImage
- generates:
   adams.data.image.AbstractImage

Valid options are:

-D <int> (property: debugLevel)
    The greater the number the more additional info the scheme may output to 
    the console (0 = off).
    default: 0
    minimum: 0
 
-name <java.lang.String> (property: name)
    The name of the actor.
    default: PixelSelector
 
-annotation <adams.core.base.BaseText> (property: annotations)
    The annotations to attach to this actor.
    default: 
 
-skip (property: skip)
    If set to true, transformation is skipped and the input token is just forwarded 
    as it is.
 
-stop-flow-on-error (property: stopFlowOnError)
    If set to true, the flow gets stopped in case this actor encounters an error;
     useful for critical actors.
 
-width <int> (property: width)
    The width of the dialog.
    default: 800
    minimum: 1
 
-height <int> (property: height)
    The height of the dialog.
    default: 600
    minimum: 1
 
-x <int> (property: x)
    The X position of the dialog (>=0: absolute, -1: left, -2: center, -3: right
    ).
    default: -1
    minimum: -3
 
-y <int> (property: y)
    The Y position of the dialog (>=0: absolute, -1: top, -2: center, -3: bottom
    ).
    default: -1
    minimum: -3
 
-stop-if-canceled (property: stopFlowIfCanceled)
    If enabled, the flow gets stopped in case the user cancels the dialog.
 
-custom-stop-message <java.lang.String> (property: customStopMessage)
    The custom stop message to use in case a user cancelation stops the flow 
    (default is the full name of the actor)
    default: 
 
-action <adams.flow.transformer.pixelselector.AbstractPixelSelectorAction> [-action ...] (property: actions)
    The overlays available to the user from the popup menu of the viewer.
    default: 
 
-overlay <adams.flow.transformer.pixelselector.AbstractPixelSelectorOverlay> [-overlay ...] (property: overlays)
    The image overlays to use in the viewer.
    default: 
 
-splitter-pos <int> (property: splitterPosition)
    The initial position of the splitter in the viewer panel.
    default: 500
    minimum: 1
 

Version:
$Revision: 5990 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
protected  AbstractPixelSelectorAction[] m_Actions
          the actions that are available from the popup menu.
protected  Boolean m_Approved
          whether the user approved (or canceled) the dialog.
protected  AbstractPixelSelectorOverlay[] m_Overlays
          the overlays to use.
protected  int m_SplitterPosition
          the position of the splitter.
 
Fields inherited from class adams.flow.transformer.AbstractInteractiveTransformerDialog
m_CustomStopMessage, m_Dialog, m_Height, m_Panel, m_ShortTitle, m_StopFlowIfCanceled, m_SuccessfulInteraction, m_Width, m_X, m_Y
 
Fields inherited from class adams.flow.transformer.AbstractTransformer
BACKUP_INPUT, BACKUP_OUTPUT, m_InputToken, m_OutputToken
 
Fields inherited from class adams.flow.core.AbstractActor
m_Annotations, m_BackupState, m_DetectedObjectVariables, m_DetectedVariables, m_ErrorHandler, m_Executed, m_Executing, m_FullName, m_Headless, m_Name, m_Parent, m_Root, m_Self, m_Skip, m_StopFlowOnError, m_StopMessage, m_Stopped, m_StorageHandler, m_VariablesUpdated
 
Fields inherited from class adams.core.option.AbstractOptionHandler
m_DebugLevel, m_OptionManager
 
Fields inherited from interface adams.flow.core.Actor
FILE_EXTENSION, FILE_EXTENSION_GZ
 
Constructor Summary
PixelSelector()
           
 
Method Summary
 Class[] accepts()
          Returns the class that the consumer accepts.
 String actionsTipText()
          Returns the tip text for this property.
 void clearPanel()
          Clears the content of the panel.
 void defineOptions()
          Adds options to the internal list of options.
protected  String doExecute()
          Executes the flow item.
 boolean doInteract()
          Performs the interaction with the user.
 Class[] generates()
          Returns the class of objects that it generates.
 AbstractPixelSelectorAction[] getActions()
          Returns the available popup actions.
protected  int getDefaultSplitterPosition()
          Returns the default position for the splitter.
 AbstractPixelSelectorOverlay[] getOverlays()
          Returns the available image overlays.
 int getSplitterPosition()
          Returns the initial position of the splitter in the viewer panel.
 String globalInfo()
          Returns a string describing the object.
protected  BasePanel newPanel()
          Creates the panel to display in the dialog.
 String overlaysTipText()
          Returns the tip text for this property.
 void setActions(AbstractPixelSelectorAction[] value)
          Sets the available popup actions.
 void setOverlays(AbstractPixelSelectorOverlay[] value)
          Sets the available image overlays.
 void setSplitterPosition(int value)
          Sets the initial position of the splitter in the viewer panel.
 String setUp()
          Initializes the item for flow execution.
 String splitterPositionTipText()
          Returns the tip text for this property.
 void updateProvenance(ProvenanceContainer cont)
          Updates the provenance information in the provided container.
 
Methods inherited from class adams.flow.transformer.AbstractInteractiveTransformerDialog
cleanUp, cleanUpGUI, createDialog, createTitle, customStopMessageTipText, doCreateDialog, getCustomStopMessage, getDefaultHeight, getDefaultWidth, getDefaultX, getDefaultY, getDialog, getHeight, getPanel, getQuickInfo, getShortTitle, getStopFlowIfCanceled, getWidth, getX, getY, heightTipText, initialize, postCreateDialog, preCreateDialog, reset, setCustomStopMessage, setHeight, setShortTitle, setStopFlowIfCanceled, setWidth, setX, setY, shortTitleTipText, stopExecution, stopFlowIfCanceledTipText, widthTipText, xTipText, yTipText
 
Methods inherited from class adams.flow.transformer.AbstractTransformer
backupState, execute, hasPendingOutput, input, output, postExecute, restoreState, wrapUp
 
Methods inherited from class adams.flow.core.AbstractActor
annotationsTipText, canInspectOptions, canPerformSetUpCheck, compareTo, debug, destroy, equals, findVariables, findVariables, findVariables, forceVariables, forCommandLine, forName, getAdditionalInformation, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFlowActors, getFullName, getName, getNextSibling, getParent, getPreviousSibling, getRoot, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, handleException, hasErrorHandler, hasStopMessage, index, isBackedUp, isExecuted, isExecuting, isFinished, isHeadless, isStopped, nameTipText, performSetUpChecks, preExecute, pruneBackup, pruneBackup, setAnnotations, setErrorHandler, setHeadless, setName, setParent, setSkip, setStopFlowOnError, setVariables, shallowCopy, shallowCopy, sizeOf, skipTipText, stopExecution, stopFlowOnErrorTipText, updateDetectedVariables, updatePrefix, updateVariables, variableChanged
 
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, debug, debugLevelTipText, finishInit, getDebugLevel, getOptionManager, isDebugOn, newOptionManager, setDebugLevel, toCommandLine, toString
 
Methods inherited from class adams.core.ConsoleObject
getDebugging, getSystemErr, getSystemOut
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface adams.flow.core.Actor
compareTo, debug, destroy, equals, execute, findVariables, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFullName, getName, getNextSibling, getParent, getPreviousSibling, getRoot, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, hasErrorHandler, hasStopMessage, index, isExecuted, isFinished, isHeadless, isStopped, setAnnotations, setErrorHandler, setHeadless, setName, setParent, setSkip, setStopFlowOnError, setVariables, sizeOf, stopExecution, variableChanged, wrapUp
 
Methods inherited from interface adams.core.AdditionalInformationHandler
getAdditionalInformation
 
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager
 

Field Detail

m_Actions

protected AbstractPixelSelectorAction[] m_Actions
the actions that are available from the popup menu.


m_Overlays

protected AbstractPixelSelectorOverlay[] m_Overlays
the overlays to use.


m_SplitterPosition

protected int m_SplitterPosition
the position of the splitter.


m_Approved

protected Boolean m_Approved
whether the user approved (or canceled) the dialog.

Constructor Detail

PixelSelector

public PixelSelector()
Method Detail

globalInfo

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

Specified by:
globalInfo in class AbstractOptionHandler
Returns:
a description suitable for displaying in the gui

defineOptions

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

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

setActions

public void setActions(AbstractPixelSelectorAction[] value)
Sets the available popup actions.

Parameters:
value - the actions

getActions

public AbstractPixelSelectorAction[] getActions()
Returns the available popup actions.

Returns:
the actions

actionsTipText

public String actionsTipText()
Returns the tip text for this property.

Returns:
tip text for this property suitable for displaying in the GUI or for listing the options.

setOverlays

public void setOverlays(AbstractPixelSelectorOverlay[] value)
Sets the available image overlays.

Parameters:
value - the overlays

getOverlays

public AbstractPixelSelectorOverlay[] getOverlays()
Returns the available image overlays.

Returns:
the overlays

overlaysTipText

public String overlaysTipText()
Returns the tip text for this property.

Returns:
tip text for this property suitable for displaying in the GUI or for listing the options.

getDefaultSplitterPosition

protected int getDefaultSplitterPosition()
Returns the default position for the splitter.


setSplitterPosition

public void setSplitterPosition(int value)
Sets the initial position of the splitter in the viewer panel.

Parameters:
value - the position

getSplitterPosition

public int getSplitterPosition()
Returns the initial position of the splitter in the viewer panel.

Returns:
the position

splitterPositionTipText

public String splitterPositionTipText()
Returns the tip text for this property.

Returns:
tip text for this property suitable for displaying in the GUI or for listing the options.

accepts

public Class[] accepts()
Returns the class that the consumer accepts.

Returns:
the Class of objects that can be processed

generates

public Class[] generates()
Returns the class of objects that it generates.

Returns:
adams.data.image.AbstractImage.class

clearPanel

public void clearPanel()
Clears the content of the panel.

Specified by:
clearPanel in class AbstractInteractiveTransformerDialog

newPanel

protected BasePanel newPanel()
Creates the panel to display in the dialog.

Specified by:
newPanel in class AbstractInteractiveTransformerDialog
Returns:
the panel

setUp

public String setUp()
Initializes the item for flow execution.

Specified by:
setUp in interface Actor
Overrides:
setUp in class AbstractActor
Returns:
null if everything is fine, otherwise error message

doInteract

public boolean doInteract()
Performs the interaction with the user.

Specified by:
doInteract in interface InteractiveActor
Overrides:
doInteract in class AbstractInteractiveTransformerDialog
Returns:
true if successfully interacted

doExecute

protected String doExecute()
Executes the flow item.

Overrides:
doExecute in class AbstractInteractiveTransformerDialog
Returns:
null if everything is fine, otherwise error message

updateProvenance

public void updateProvenance(ProvenanceContainer cont)
Updates the provenance information in the provided container.

Parameters:
cont - the provenance container to update


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