Package adams.flow.sink
Class AbstractGraphicsGenerator
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.core.AbstractActor
-
- adams.flow.sink.AbstractSink
-
- adams.flow.sink.AbstractGraphicsGenerator
-
- All Implemented Interfaces:
AdditionalInformationHandler
,CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,ShallowCopySupporter<Actor>
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,VariablesInspectionHandler
,VariableChangeListener
,Actor
,ErrorHandler
,InputConsumer
,Serializable
,Comparable
- Direct Known Subclasses:
Screenshot
public abstract class AbstractGraphicsGenerator extends AbstractSink
Ancestor for actors that generate graphics of some kind.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected JComponent
m_Component
the component to create the screenshot from.protected BaseFrame
m_Frame
the frame in use.protected int
m_Height
the height of the dialog.protected PlaceholderFile
m_Output
the file/dir to write to.protected String
m_Suffix
an optional suffix for the filename (before the extension).protected String
m_Title
the title of the dialog.protected int
m_Width
the width of the dialog.protected JComponentWriter
m_Writer
the writer to use.-
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
-
-
Constructor Summary
Constructors Constructor Description AbstractGraphicsGenerator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected void
displayFrame()
Generates and displays the frame.protected void
disposeComponent()
Disposes the generated component again.protected String
doExecute()
Executes the flow item.protected abstract JComponent
generateComponent()
Generates the component to display in the frame.protected abstract PlaceholderFile
generateFilename()
Generates the filename for the output.protected BaseFrame
generateFrame()
Generates a frame with the specified title.protected String
generateOutput()
Generates output for the component, stores it in the specified file.protected abstract int
getDefaultHeight()
Returns the default height for the dialog.protected abstract String
getDefaultTitle()
Returns the default title for the dialog.protected abstract int
getDefaultWidth()
Returns the default width for the dialog.int
getHeight()
Returns the currently set height of the dialog.PlaceholderFile
getOutput()
Returns the output.String
getSuffix()
Returns the currently set suffix for the filename.String
getTitle()
Returns the currently set title of the dialog.int
getWidth()
Returns the currently set width of the dialog.JComponentWriter
getWriter()
Returns the writer.String
heightTipText()
Returns the tip text for this property.protected void
hideFrame()
Hides the frame.abstract String
outputTipText()
Returns the tip text for this property.void
setHeight(int value)
Sets the height of the dialog.void
setOutput(PlaceholderFile value)
Sets the output.void
setSuffix(String value)
Sets the suffix for the filename.void
setTitle(String value)
Sets the title of the dialog.void
setWidth(int value)
Sets the width of the dialog.void
setWriter(JComponentWriter value)
Sets the writer.String
suffixTipText()
Returns the tip text for this property.String
titleTipText()
Returns the tip text for this property.String
widthTipText()
Returns the tip text for this property.String
writerTipText()
Returns the tip text for this property.-
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, globalInfo, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
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.flow.core.InputConsumer
accepts
-
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
-
-
-
-
Field Detail
-
m_Title
protected String m_Title
the title of the dialog.
-
m_Suffix
protected String m_Suffix
an optional suffix for the filename (before the extension).
-
m_Width
protected int m_Width
the width of the dialog.
-
m_Height
protected int m_Height
the height of the dialog.
-
m_Output
protected PlaceholderFile m_Output
the file/dir to write to.
-
m_Writer
protected JComponentWriter m_Writer
the writer to use.
-
m_Component
protected JComponent m_Component
the component to create the screenshot from.
-
m_Frame
protected BaseFrame m_Frame
the frame in use.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractActor
-
getDefaultTitle
protected abstract String getDefaultTitle()
Returns the default title for the dialog.- Returns:
- the default title
-
getDefaultWidth
protected abstract int getDefaultWidth()
Returns the default width for the dialog.- Returns:
- the default width
-
getDefaultHeight
protected abstract int getDefaultHeight()
Returns the default height for the dialog.- Returns:
- the default height
-
setTitle
public void setTitle(String value)
Sets the title of the dialog.- Parameters:
value
- the title
-
getTitle
public String getTitle()
Returns the currently set title of the dialog.- Returns:
- the title
-
titleTipText
public String titleTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setSuffix
public void setSuffix(String value)
Sets the suffix for the filename.- Parameters:
value
- the suffix
-
getSuffix
public String getSuffix()
Returns the currently set suffix for the filename.- Returns:
- the suffix
-
suffixTipText
public String suffixTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setWidth
public void setWidth(int value)
Sets the width of the dialog.- Parameters:
value
- the width
-
getWidth
public int getWidth()
Returns the currently set width of the dialog.- Returns:
- the width
-
widthTipText
public String widthTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setHeight
public void setHeight(int value)
Sets the height of the dialog.- Parameters:
value
- the height
-
getHeight
public int getHeight()
Returns the currently set height of the dialog.- Returns:
- the height
-
heightTipText
public String heightTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setOutput
public void setOutput(PlaceholderFile value)
Sets the output.- Parameters:
value
- the output
-
getOutput
public PlaceholderFile getOutput()
Returns the output.- Returns:
- the output
-
outputTipText
public abstract String outputTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setWriter
public void setWriter(JComponentWriter value)
Sets the writer.- Parameters:
value
- the writer
-
getWriter
public JComponentWriter getWriter()
Returns the writer.- Returns:
- the writer
-
writerTipText
public String writerTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
generateComponent
protected abstract JComponent generateComponent()
Generates the component to display in the frame.- Returns:
- the component
-
generateFilename
protected abstract PlaceholderFile generateFilename()
Generates the filename for the output.- Returns:
- the file
-
generateFrame
protected BaseFrame generateFrame()
Generates a frame with the specified title. Places the component in the CENTER of the frame.- Returns:
- the generated frame
-
displayFrame
protected void displayFrame()
Generates and displays the frame.
-
generateOutput
protected String generateOutput()
Generates output for the component, stores it in the specified file.- Returns:
- null if everything OK, otherwise the error message
-
hideFrame
protected void hideFrame()
Hides the frame.
-
disposeComponent
protected void disposeComponent()
Disposes the generated component again.
-
doExecute
protected String doExecute()
Executes the flow item.- Specified by:
doExecute
in classAbstractActor
- Returns:
- null if everything is fine, otherwise error message
-
-