com.azalient.api.b.reporting
Interface IRedirector


public interface IRedirector

This interface provides detailed control of the reporting interface, including the ability to redirect the output to another location. See writer(Writer)


Field Summary
static Font LogFont
           
 
Method Summary
 void clearLog()
          Clear the contents of the log window
 void closeLogs()
          Close the Writer, if one has been assigned, and discard references to it
 void popup(Component parent, String message)
          Display a message in a pop up box, parented by the given component, which can be null.
 void redirectSystem()
          Redirect the system standard output and error streams so that messages are directed to the Log window, or to any Writer that has been installed.
 void report(Throwable errorException)
          Parse the given error or exception, and report it to the user with a pop-up box, and the option to report it to support@azalient.com
 void resetNoMore()
          The API equivalent of clearing the check box in the warning dialog to allow messages to be displayed again.
 void rewind()
          This is fired when the simulation is rewound, which may clear the log window, if that option is enabled
 void saveLogWindowContents(File dir)
          Save the current contents of the log window to the given File
 void setNoMore()
          The API equivalent of ticking the check box in the warning dialog to say no more messages.
 void setTitle(IScenario scenario)
          Sets the title on the log window (running in batch mode) to the given scenario.
 void setVisible(boolean visible)
          Display the log window
 void show()
          Display the log window and clear any warning notifications
 void showLogAsMainWindow(JComponent south, IShutdownListener shl)
          Used to set up batch operation, with the log window as the main window, as there is no graphical window.
 Action showLogWindowAction()
          Returns an Action that raises the log window.
 void shutdown()
          Run any shutdown listeners that were previously registered, see showLogAsMainWindow(JComponent, IShutdownListener)
 void warning(Component parent, String message)
          Display a message in a pop-up box, with options to not display further messages.
 void writer(Writer w)
          Sets an alternative location to which to send the reporting messages.
 

Field Detail

LogFont

static final Font LogFont
Method Detail

show

void show()
Display the log window and clear any warning notifications


setVisible

void setVisible(boolean visible)
Display the log window


report

void report(Throwable errorException)
Parse the given error or exception, and report it to the user with a pop-up box, and the option to report it to support@azalient.com


popup

void popup(Component parent,
           String message)
Display a message in a pop up box, parented by the given component, which can be null. The pop up box has a single OK button, and no other controls.


warning

void warning(Component parent,
             String message)
Display a message in a pop-up box, with options to not display further messages. The options are:

Parameters:
parent - an optional parent component. If this is null, then a default frame will be used as the parent.
message - the text message to display

writer

void writer(Writer w)
Sets an alternative location to which to send the reporting messages. To use this, define a writer, which may write to a file or a stream, or to another user-interface display. If Commuter is being used as a plug-in to another system, this can be used to redirect all output to the logging mechanism on that system.


setNoMore

void setNoMore()
The API equivalent of ticking the check box in the warning dialog to say no more messages. See warning(Component, String)


resetNoMore

void resetNoMore()
The API equivalent of clearing the check box in the warning dialog to allow messages to be displayed again. See warning(Component, String)


redirectSystem

void redirectSystem()
Redirect the system standard output and error streams so that messages are directed to the Log window, or to any Writer that has been installed. This is called automatically when Commuter is started, unless -console is specified on the command line.


closeLogs

void closeLogs()
Close the Writer, if one has been assigned, and discard references to it


showLogWindowAction

Action showLogWindowAction()
Returns an Action that raises the log window. Use this to create an extra button on your user interface that raises the log window.


showLogAsMainWindow

void showLogAsMainWindow(JComponent south,
                         IShutdownListener shl)
Used to set up batch operation, with the log window as the main window, as there is no graphical window.

Internal - Not recommended for use. Public as a side-effect of implementation method

setTitle

void setTitle(IScenario scenario)
Sets the title on the log window (running in batch mode) to the given scenario.

Internal - Not recommended for use. Public as a side-effect of implementation method

saveLogWindowContents

void saveLogWindowContents(File dir)
Save the current contents of the log window to the given File


shutdown

void shutdown()
Run any shutdown listeners that were previously registered, see showLogAsMainWindow(JComponent, IShutdownListener)

Internal - Not recommended for use. Public as a side-effect of implementation method

clearLog

void clearLog()
Clear the contents of the log window


rewind

void rewind()
This is fired when the simulation is rewound, which may clear the log window, if that option is enabled

Internal - Not recommended for use. Public as a side-effect of implementation method