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 JComponentm_Componentthe component to create the screenshot from.protected BaseFramem_Framethe frame in use.protected intm_Heightthe height of the dialog.protected PlaceholderFilem_Outputthe file/dir to write to.protected Stringm_Suffixan optional suffix for the filename (before the extension).protected Stringm_Titlethe title of the dialog.protected intm_Widththe width of the dialog.protected JComponentWriterm_Writerthe 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 voiddefineOptions()Adds options to the internal list of options.protected voiddisplayFrame()Generates and displays the frame.protected voiddisposeComponent()Disposes the generated component again.protected StringdoExecute()Executes the flow item.protected abstract JComponentgenerateComponent()Generates the component to display in the frame.protected abstract PlaceholderFilegenerateFilename()Generates the filename for the output.protected BaseFramegenerateFrame()Generates a frame with the specified title.protected StringgenerateOutput()Generates output for the component, stores it in the specified file.protected abstract intgetDefaultHeight()Returns the default height for the dialog.protected abstract StringgetDefaultTitle()Returns the default title for the dialog.protected abstract intgetDefaultWidth()Returns the default width for the dialog.intgetHeight()Returns the currently set height of the dialog.PlaceholderFilegetOutput()Returns the output.StringgetSuffix()Returns the currently set suffix for the filename.StringgetTitle()Returns the currently set title of the dialog.intgetWidth()Returns the currently set width of the dialog.JComponentWritergetWriter()Returns the writer.StringheightTipText()Returns the tip text for this property.protected voidhideFrame()Hides the frame.abstract StringoutputTipText()Returns the tip text for this property.voidsetHeight(int value)Sets the height of the dialog.voidsetOutput(PlaceholderFile value)Sets the output.voidsetSuffix(String value)Sets the suffix for the filename.voidsetTitle(String value)Sets the title of the dialog.voidsetWidth(int value)Sets the width of the dialog.voidsetWriter(JComponentWriter value)Sets the writer.StringsuffixTipText()Returns the tip text for this property.StringtitleTipText()Returns the tip text for this property.StringwidthTipText()Returns the tip text for this property.StringwriterTipText()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:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin 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:
doExecutein classAbstractActor- Returns:
- null if everything is fine, otherwise error message
-
-