Package adams.flow.sink
Class LogViewer
-
- All Implemented Interfaces:
AdditionalInformationHandler,CleanUpHandler,Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,QuickInfoSupporter,ShallowCopySupporter<Actor>,SizeOfHandler,Stoppable,StoppableWithFeedback,VariablesInspectionHandler,VariableChangeListener,Actor,DisplayTypeSupporter,ErrorHandler,HeadlessExecutionSupporter,InputConsumer,Serializable,Comparable
public class LogViewer extends AbstractDisplay
Actor that displays LogEntry objects, but doesn't store them in the database.
Input/output:
- accepts:
adams.db.LogEntry
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: LogViewer
-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.
-short-title (property: shortTitle) If enabled uses just the name for the title instead of the actor's full name.
-width <int> (property: width) The width of the dialog. default: 600 minimum: 1
-height <int> (property: height) The height of the dialog. default: 400 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
-dialog <adams.flow.sink.logview.AbstractLogEntryDialog> (property: dialog) The dialog to use for displaying the log entries. default: adams.flow.sink.logview.DefaultLogEntryDialog
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected BaseFileChooserm_BaseFileChooserthe base file chooser for saving the log entries.protected BaseButtonm_ButtonDisplaythe button for displaying the message details.protected BaseButtonm_ButtonSavethe button for saving the selected entries (or all if none selected).protected AbstractLogEntryDialogm_Dialogthe dialog for displaying the message details.protected ArrayList<BaseDialog>m_Dialogsthe dialogs displayed so far.protected BaseTableWithButtonsm_TableEntriesthe table with the entries.-
Fields inherited from class adams.flow.core.AbstractDisplay
BACKUP_INPUT, m_CreateFrame, m_DisplayType, m_Frame, m_Height, m_InputToken, m_KeepOpen, m_Panel, m_ResetGUIWaiting, m_ShortTitle, m_Updating, m_Width, m_X, m_Y
-
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 LogViewer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class[]accepts()Returns the class that the consumer accepts.protected voidcleanUpGUI()Removes all graphical components.voidclearPanel()Clears the content of the panel.voiddefineOptions()Adds options to the internal list of options.StringdialogTipText()Returns the tip text for this property.protected voiddisplay(Token token)Displays the token (the panel and dialog have already been created at this stage).protected voiddisplayMessage(LogEntry entry)Displays the message of the given entry in a separate window.protected BaseFileChoosergetBaseFileChooser()Returns (and initializes if necessary) the file chooser.protected intgetDefaultHeight()Returns the default height for the dialog.protected intgetDefaultWidth()Returns the default width for the dialog.AbstractLogEntryDialoggetDialog()Returns the dialog to use.StringgetQuickInfo()Returns a quick info about the actor, which will be displayed in the GUI.StringglobalInfo()Returns a string describing the object.protected voidinitialize()Initializes the members.protected BasePanelnewPanel()Creates the panel to display in the dialog.voidsetDialog(AbstractLogEntryDialog value)Sets the dialog to use.-
Methods inherited from class adams.flow.sink.AbstractDisplay
newDisplayRunnable, postDisplay, preDisplay
-
Methods inherited from class adams.flow.core.AbstractDisplay
backupState, cleanUp, cleanUpGUIKeepOpen, closeDisplay, createFrame, createTitle, currentInput, deregisterInWrapUp, deregisterWindow, deregisterWithEditor, displayTypeTipText, doCreateFrame, doExecute, doExecuteHeadless, getCreateFrame, getDefaultDisplayType, getDefaultShortTitle, getDefaultX, getDefaultY, getDisplayType, getFrame, getFrameDefaultCloseOperation, getHeight, getKeepOpen, getPanel, getShortTitle, getWidth, getX, getY, hasInput, heightTipText, input, postCreateFrame, preCreateFrame, registerWindow, registerWithEditor, reset, restoreState, setCreateFrame, setDisplayType, setHeight, setKeepOpen, setShortTitle, setWidth, setX, setY, shortTitleTipText, stopExecution, supportsHeadlessExecution, widthTipText, wrapUp, xTipText, yTipText
-
Methods inherited from class adams.flow.core.AbstractActor
annotationsTipText, canInspectOptions, canPerformSetUpCheck, 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, getRoot, getScopeHandler, getSilent, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, handleException, hasErrorHandler, hasStopMessage, index, isBackedUp, isExecuted, isExecuting, isFinished, isHeadless, isStopped, nameTipText, performSetUpChecks, performVariableChecks, postExecute, preExecute, pruneBackup, pruneBackup, setAnnotations, setErrorHandler, setName, setParent, setSilent, setSkip, setStopFlowOnError, setUp, setVariables, shallowCopy, shallowCopy, silentTipText, sizeOf, skipTipText, 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 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, 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, wrapUp
-
Methods inherited from interface adams.core.AdditionalInformationHandler
getAdditionalInformation
-
Methods inherited from interface adams.flow.core.InputConsumer
currentInput, hasInput, input
-
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_TableEntries
protected BaseTableWithButtons m_TableEntries
the table with the entries.
-
m_ButtonDisplay
protected BaseButton m_ButtonDisplay
the button for displaying the message details.
-
m_ButtonSave
protected BaseButton m_ButtonSave
the button for saving the selected entries (or all if none selected).
-
m_Dialog
protected AbstractLogEntryDialog m_Dialog
the dialog for displaying the message details.
-
m_BaseFileChooser
protected transient BaseFileChooser m_BaseFileChooser
the base file chooser for saving the log entries.
-
m_Dialogs
protected ArrayList<BaseDialog> m_Dialogs
the dialogs displayed so far.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractDisplay
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein classAbstractDisplay
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfoin interfaceActor- Specified by:
getQuickInfoin interfaceQuickInfoSupporter- Overrides:
getQuickInfoin classAbstractDisplay- Returns:
- null if no info available, otherwise short string
-
setDialog
public void setDialog(AbstractLogEntryDialog value)
Sets the dialog to use.- Parameters:
value- the dialog
-
getDialog
public AbstractLogEntryDialog getDialog()
Returns the dialog to use.- Returns:
- the dialog
-
dialogTipText
public String dialogTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getDefaultWidth
protected int getDefaultWidth()
Returns the default width for the dialog.- Overrides:
getDefaultWidthin classAbstractDisplay- Returns:
- the default width
-
getDefaultHeight
protected int getDefaultHeight()
Returns the default height for the dialog.- Overrides:
getDefaultHeightin classAbstractDisplay- Returns:
- the default height
-
accepts
public Class[] accepts()
Returns the class that the consumer accepts.- Returns:
- adams.db.LogEntry.class
-
clearPanel
public void clearPanel()
Clears the content of the panel.- Specified by:
clearPanelin classAbstractDisplay
-
displayMessage
protected void displayMessage(LogEntry entry)
Displays the message of the given entry in a separate window.- Parameters:
entry- the entry to display
-
newPanel
protected BasePanel newPanel()
Creates the panel to display in the dialog.- Specified by:
newPanelin classAbstractDisplay- Returns:
- the panel
-
getBaseFileChooser
protected BaseFileChooser getBaseFileChooser()
Returns (and initializes if necessary) the file chooser.- Returns:
- the file chooser
-
display
protected void display(Token token)
Displays the token (the panel and dialog have already been created at this stage).- Specified by:
displayin classAbstractDisplay- Parameters:
token- the token to display
-
cleanUpGUI
protected void cleanUpGUI()
Removes all graphical components.- Overrides:
cleanUpGUIin classAbstractDisplay
-
-