Class SpectrumImageWriter

  • All Implemented Interfaces:
    adams.core.AdditionalInformationHandler, adams.core.CleanUpHandler, adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.QuickInfoSupporter, adams.core.ShallowCopySupporter<adams.flow.core.Actor>, adams.core.SizeOfHandler, adams.core.Stoppable, adams.core.StoppableWithFeedback, adams.core.VariablesInspectionHandler, adams.event.VariableChangeListener, adams.flow.core.Actor, adams.flow.core.ErrorHandler, adams.flow.core.InputConsumer, Serializable, Comparable

    public class SpectrumImageWriter
    extends adams.flow.sink.AbstractGraphicsGenerator
    Actor that takes screenshots of spectra.

    Input/output:
    - accepts:
       knir.data.spectrum.Spectrum
       knir.data.spectrum.Spectrum[]


    Valid options are:

    -D (property: debug)
             If set to true, scheme may output additional info to the console.
     
    -name <java.lang.String> (property: name)
             The name of the actor.
             default: SpectrumImageWriter
     
    -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.
     
    -title <java.lang.String> (property: title)
             The title of the dialog.
             default: Spectrum
     
    -suffix <java.lang.String> (property: suffix)
             An optional suffix for the filename, inserted before the extension.
             default:
     
    -width <int> (property: width)
             The width of the dialog.
             default: 800
     
    -height <int> (property: height)
             The height of the dialog.
             default: 600
     
    -output <adams.core.io.PlaceholderFile> (property: output)
             The output directory.
             default: .
     
    -writer <adams.gui.print.JComponentWriter [options]> (property: writer)
             The writer to use for generating the graphics output.
             default: adams.gui.print.NullWriter -file . -scale-x 1.0 -scale-y 1.0 -custom-width -1 -custom-height -1
     
    Default options for adams.gui.print.NullWriter (-writer/writer):
    -D (property: debug)
             If set to true, scheme may output additional info to the console.
     
    -file <adams.core.io.PlaceholderFile> (property: file)
             The file to save the image to.
             default: .
     
    -scaling (property: scalingEnabled)
             If set to true, then scaling will be used.
     
    -scale-x <double> (property: XScale)
             The scaling factor for the X-axis.
             default: 1.0
     
    -scale-y <double> (property: YScale)
             The scaling factor for the Y axis.
             default: 1.0
     
    -custom-dimensions (property: useCustomDimensions)
             Whether to use custom dimensions or use the component's ones.
     
    -custom-width <int> (property: customWidth)
             The custom width.
             default: -1
     
    -custom-height <int> (property: customHeight)
             The custom height.
             default: -1
     
    Version:
    $Revision: 2242 $
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class adams.flow.sink.AbstractGraphicsGenerator

        m_Component, m_Frame, m_Height, m_Output, m_Suffix, m_Title, m_Width, m_Writer
      • Fields inherited from class adams.flow.sink.AbstractSink

        BACKUP_INPUT, m_InputToken
      • Fields inherited from class adams.flow.core.AbstractActor

        m_Annotations, m_BackupState, m_DetectedObjectVariables, m_DetectedVariables, m_ErrorHandler, m_Executed, m_Executing, m_ExecutionListeningSupporter, m_FullName, m_LoggingPrefix, m_Name, m_Parent, m_ScopeHandler, m_Self, m_Silent, m_Skip, m_StopFlowOnError, m_StopMessage, m_Stopped, m_StorageHandler, m_VariablesUpdated
      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
      • Fields inherited from interface adams.flow.core.Actor

        FILE_EXTENSION, FILE_EXTENSION_GZ
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Class[] accepts()
      Returns the class that the consumer accepts.
      protected void disposeComponent()
      Disposes the generated component again.
      protected JComponent generateComponent()
      Generates the component to display in the frame.
      protected adams.core.io.PlaceholderFile generateFilename()
      Generates the filename for the output.
      protected int getDefaultHeight()
      Returns the default height for the dialog.
      protected String getDefaultTitle()
      Returns the default title for the dialog.
      protected int getDefaultWidth()
      Returns the default width for the dialog.
      String globalInfo()
      Returns a string describing the object.
      String outputTipText()
      Returns the tip text for this property.
      • Methods inherited from class adams.flow.sink.AbstractGraphicsGenerator

        defineOptions, displayFrame, doExecute, generateFrame, generateOutput, getHeight, getOutput, getSuffix, getTitle, getWidth, getWriter, heightTipText, hideFrame, setHeight, setOutput, setSuffix, setTitle, setWidth, setWriter, suffixTipText, titleTipText, widthTipText, writerTipText
      • Methods inherited from class adams.flow.sink.AbstractSink

        backupState, currentInput, hasInput, input, postExecute, restoreState, wrapUp
      • Methods inherited from class adams.flow.core.AbstractActor

        annotationsTipText, canInspectOptions, canPerformSetUpCheck, cleanUp, compareTo, configureLogger, destroy, equals, execute, finalUpdateVariables, findVariables, findVariables, forceVariables, forCommandLine, forName, forName, getAdditionalInformation, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFlowActors, getFlowExecutionListeningSupporter, getFullName, getName, getNextSibling, getParent, getParentComponent, getPreviousSibling, getQuickInfo, getRoot, getScopeHandler, getSilent, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, handleException, hasErrorHandler, hasStopMessage, index, initialize, isBackedUp, isExecuted, isExecuting, isFinished, isHeadless, isStopped, nameTipText, performSetUpChecks, performVariableChecks, preExecute, pruneBackup, pruneBackup, reset, setAnnotations, setErrorHandler, setName, setParent, setSilent, setSkip, setStopFlowOnError, setUp, setVariables, shallowCopy, shallowCopy, silentTipText, sizeOf, skipTipText, stopExecution, stopExecution, stopFlowOnErrorTipText, updateDetectedVariables, updatePrefix, updateVariables, variableChanged
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
      • Methods inherited from class adams.core.logging.LoggingObject

        getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled
      • Methods inherited from interface adams.flow.core.Actor

        cleanUp, compareTo, destroy, equals, execute, findVariables, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFlowExecutionListeningSupporter, getFullName, getName, getNextSibling, getParent, getParentComponent, getPreviousSibling, getQuickInfo, getRoot, getScopeHandler, getSilent, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, hasErrorHandler, hasStopMessage, index, isExecuted, isFinished, isHeadless, isStopped, setAnnotations, setErrorHandler, setName, setParent, setSilent, setSkip, setStopFlowOnError, setUp, setVariables, shallowCopy, shallowCopy, sizeOf, stopExecution, stopExecution, toCommandLine, variableChanged
      • Methods inherited from interface adams.core.AdditionalInformationHandler

        getAdditionalInformation
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel, setLoggingLevel
      • Methods inherited from interface adams.core.logging.LoggingSupporter

        getLogger, isLoggingEnabled
      • Methods inherited from interface adams.core.option.OptionHandler

        cleanUpOptions, getOptionManager
      • Methods inherited from interface adams.core.VariablesInspectionHandler

        canInspectOptions
    • Constructor Detail

      • SpectrumImageWriter

        public SpectrumImageWriter()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.core.option.AbstractOptionHandler
        Returns:
        a description suitable for displaying in the gui
      • getDefaultTitle

        protected String getDefaultTitle()
        Returns the default title for the dialog.
        Specified by:
        getDefaultTitle in class adams.flow.sink.AbstractGraphicsGenerator
        Returns:
        the default title
      • getDefaultWidth

        protected int getDefaultWidth()
        Returns the default width for the dialog.
        Specified by:
        getDefaultWidth in class adams.flow.sink.AbstractGraphicsGenerator
        Returns:
        the default width
      • getDefaultHeight

        protected int getDefaultHeight()
        Returns the default height for the dialog.
        Specified by:
        getDefaultHeight in class adams.flow.sink.AbstractGraphicsGenerator
        Returns:
        the default height
      • outputTipText

        public String outputTipText()
        Returns the tip text for this property.
        Specified by:
        outputTipText in class adams.flow.sink.AbstractGraphicsGenerator
        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:
        knir.data.spectrum.Spectrum.class, knir.data.spectrum.Spectrum[].class
      • generateFilename

        protected adams.core.io.PlaceholderFile generateFilename()
        Generates the filename for the output.
        Specified by:
        generateFilename in class adams.flow.sink.AbstractGraphicsGenerator
        Returns:
        the filename
      • generateComponent

        protected JComponent generateComponent()
        Generates the component to display in the frame.
        Specified by:
        generateComponent in class adams.flow.sink.AbstractGraphicsGenerator
        Returns:
        the component
      • disposeComponent

        protected void disposeComponent()
        Disposes the generated component again.
        Overrides:
        disposeComponent in class adams.flow.sink.AbstractGraphicsGenerator