Class Inspect

  • All Implemented Interfaces:
    AdditionalInformationHandler, CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<Actor>, SizeOfHandler, Stoppable, StoppableWithFeedback, VariablesInspectionHandler, VariableChangeListener, Actor, ErrorHandler, InputConsumer, InteractiveActor, OutputProducer, StopModeSupporter, Serializable, Comparable

    public class Inspect
    extends AbstractInteractiveTransformerDialog
    Allows the user to inspect tokens with the specified viewer.
    Inspection can be done interactively, allowing the user to drop tokens, or non-interactively, with the viewer updating whenever a token passes through.
    Of course, this actor should only be used during development for debugging purposes as can slow down the execution significantly depending on how expensive the view generation is.

    Input/output:
    - accepts:
       java.lang.Object
    - generates:
       java.lang.Object


    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -name <java.lang.String> (property: name)
        The name of the actor.
        default: Inspect
     
    -annotation <adams.core.base.BaseAnnotation> (property: annotations)
        The annotations to attach to this actor.
        default: 
     
    -skip <boolean> (property: skip)
        If set to true, transformation is skipped and the input token is just forwarded 
        as it is.
        default: false
     
    -stop-flow-on-error <boolean> (property: stopFlowOnError)
        If set to true, the flow gets stopped in case this actor encounters an error;
         useful for critical actors.
        default: false
     
    -silent <boolean> (property: silent)
        If enabled, then no errors are output in the console.
        default: false
     
    -short-title <boolean> (property: shortTitle)
        If enabled uses just the name for the title instead of the actor's full 
        name.
        default: false
     
    -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 <boolean> (property: stopFlowIfCanceled)
        If enabled, the flow gets stopped in case the user cancels the dialog.
        default: false
     
    -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: 
     
    -provider <adams.flow.sink.DisplayPanelProvider> (property: panelProvider)
        The actor for generating the viewer.
        default: adams.flow.sink.Display -writer adams.data.io.output.NullWriter
     
    -label-skip <java.lang.String> (property: labelSkip)
        The label to use for the skip button; let '_' precede the character that 
        should trigger the button via 'Alt+<char>' (Windows/Linux).
        default: _Skip
     
    -label-accept <java.lang.String> (property: labelAccept)
        The label to use for the accept button; let '_' precede the character that 
        should trigger the button via 'Alt+<char>' (Windows/Linux).
        default: _Accept
     
    -close-dialog <boolean> (property: closeDialog)
        If enabled, the dialog gets closed after the skip or accept button has been
        clicked.
        default: false
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • TEXT_NONINTERACTIVE

        public static final String TEXT_NONINTERACTIVE
        the non-interactive text for the button.
        See Also:
        Constant Field Values
      • m_PanelProvider

        protected DisplayPanelProvider m_PanelProvider
        the actor to use for generating panels.
      • m_LabelSkip

        protected String m_LabelSkip
        the label for the skip button.
      • m_LabelAccept

        protected String m_LabelAccept
        the label for the accept button.
      • m_CloseDialog

        protected boolean m_CloseDialog
        whether to close the dialog after skipping/accepting.
      • m_ButtonToggle

        protected BaseButton m_ButtonToggle
        the button for turning on/off the interactive state of the viewer.
      • m_ButtonSkip

        protected BaseButton m_ButtonSkip
        the button for skipping the token.
      • m_ButtonAccept

        protected BaseButton m_ButtonAccept
        the button for accepting the token.
      • m_Interactive

        protected boolean m_Interactive
        whether the dialog is interactive.
      • m_Accepted

        protected boolean m_Accepted
        whether the token was accepted.
      • m_Skipped

        protected boolean m_Skipped
        whether the token was skipped.
      • m_Waiting

        protected Boolean m_Waiting
        whether we're currenlty waiting on the user.
    • Constructor Detail

      • Inspect

        public Inspect()
    • Method Detail

      • setPanelProvider

        public void setPanelProvider​(DisplayPanelProvider value)
        Sets the panel provider to use for generating the panels.
        Parameters:
        value - the panel provider to use
      • getPanelProvider

        public DisplayPanelProvider getPanelProvider()
        Returns the panel provider in use for generating the panels.
        Returns:
        the panel provider in use
      • panelProviderTipText

        public String panelProviderTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setLabelSkip

        public void setLabelSkip​(String value)
        Sets the label to use for the skip button ('_' precedes the character to use as accelerator).
        Parameters:
        value - the label
      • getLabelSkip

        public String getLabelSkip()
        Returns the label to use for the skip button ('_' precedes the character to use as accelerator).
        Returns:
        the label
      • labelSkipTipText

        public String labelSkipTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setLabelAccept

        public void setLabelAccept​(String value)
        Sets the label to use for the accept button ('_' precedes the character to use as accelerator).
        Parameters:
        value - the label
      • getLabelAccept

        public String getLabelAccept()
        Returns the label to use for the accept button ('_' precedes the character to use as accelerator).
        Returns:
        the label
      • labelAcceptTipText

        public String labelAcceptTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setCloseDialog

        public void setCloseDialog​(boolean value)
        Sets whether to close the dialog after clicking skip/accept.
        Parameters:
        value - true if to close
      • getCloseDialog

        public boolean getCloseDialog()
        Returns whether to close the dialog after clicking skip/accept.
        Returns:
        true if to close
      • closeDialogTipText

        public String closeDialogTipText()
        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 that the consumer accepts.
        Returns:
        the Class of objects that can be processed
      • forceVariables

        protected void forceVariables​(Variables value)
        Updates the Variables instance in use.

        Use with caution!
        Overrides:
        forceVariables in class AbstractActor
        Parameters:
        value - the instance to use
      • updateButtons

        protected void updateButtons​(boolean beforeDisplay)
        Updates the button state.
        Parameters:
        beforeDisplay - true if token is not yet displayed