org.ceryle.wiki.event
Class WikiEventMonitor

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by org.ceryle.wiki.event.WikiEventMonitor
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants
Direct Known Subclasses:
AssertionEventMonitor

public class WikiEventMonitor
extends JFrame

Extends JFrame to provide a monitor console for WikiEvents within the WikiEventManager.

An instance of this class is attached to the WikiEventManager by calling setActive(true) (if this is permitted by the compile-time flag WikiEventManager.c_permitMonitor).

Since:
JSPWiki 2.5.40
Author:
Murray Altheim
See Also:
Serialized Form

Nested Class Summary
 class WikiEventMonitor.DialogDisposer
           
 
Nested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  Color COLOR_BASE
          UI Colors.
protected  Color COLOR_BUTTONS
          UI Colors.
protected  Color COLOR_TEXT_BG
          UI Colors.
protected  Color COLOR_TEXT_FG
          UI Colors.
protected  Color COLOR_TEXT_SBG
          UI Colors.
protected  Font FONT_LABEL
           
protected  Font FONT_MSG
           
static String FTS_FORMAT
          Friendly timestamp format "yyyy-MM-dd HH:mm:ss:SSSS", eg., "2007-04-14 14:23:55:0334".
protected  Style m_errorStyle
           
protected  Dimension m_framesize
          Size of the frame, can be set prior to calling initialize().
protected  Style m_noiseStyle
           
protected  Style m_normalStyle
           
protected static int maxOutputChars
          The maximum number of characters to show on display at any time.
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
WikiEventMonitor()
          Creates an event monitor console with default title.
WikiEventMonitor(String title)
          Creates an event monitor console with optional title.
 
Method Summary
protected  void addStylesToDocument(StyledDocument doc)
          Add some Swing Styles to the text area to permit colorized text.
protected  void appendBaseOutput(WikiEvent event, Style style)
          Append the basic output for any WikiEvent.
protected  void appendOutput(String text, Style style)
          Append a string to the output area.
 void borderize(JComponent component, String title)
          A UI utility method that attaches a titled, line border around the JComponent component, using the String title.
protected  void clearMessages()
           
protected  JPanel createCenterPanel()
          Returns the center panel.
 JCheckBox createCheckBox(String name, String tooltip, boolean checked, ItemListener listener)
          A UI utility method that returns a checkbox button provided with its features.
 JButton createDialogButton(String label, String tooltip, ActionListener listener)
          A UI utility method that returns a dialog button provided its parameters.
 JLabel createLabel(String title, String tooltip)
          A UI utility method that returns a label, provided an optional title and optional tooltip text.
protected  JPanel createSouthPanel()
          Returns the southernmost panel containing the close button.
 JPanel createXBoxPanel()
          A UI utility method that returns a JPanel managed by an X axis BoxLayout.
 JPanel createYBoxPanel()
          A UI utility method that returns a JPanel managed by a Y axis BoxLayout.
 void eventFired(WikiEvent event)
          Note that an event has been fired.
protected  String getFriendlyTimeStamp(long when)
          Returns a String representing the provided timestamp in the form "yyyy-MM-dd HH:mm:ss" in UTC.
protected  JPanel getMiscSettingsPanel()
          Return the miscellaneous Settings panel.
protected  JPanel getOptionalSettingsPanel()
          Return any supplemental Settings panel, null if none.
protected  JPanel getSettingsPanel()
          Returns the northernmost panel.
protected  JPanel getWikiEventFiltersPanel()
          Return the wiki event filters panel.
protected  void initialize()
          Initialize the monitor's UI.
 void setActive(boolean active)
          Set the monitor active: listening for events.
 void writeError(String message)
          Write the contents of message to the monitor console as an error message.
 void writeMessage(String message)
          Write the contents of message to the monitor console.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

FTS_FORMAT

public static final String FTS_FORMAT
Friendly timestamp format "yyyy-MM-dd HH:mm:ss:SSSS", eg., "2007-04-14 14:23:55:0334".

See Also:
Constant Field Values

maxOutputChars

protected static int maxOutputChars
The maximum number of characters to show on display at any time. Setting this less than zero will disable the feature. The default is -1.


COLOR_BASE

protected Color COLOR_BASE
UI Colors.


COLOR_TEXT_FG

protected Color COLOR_TEXT_FG
UI Colors.


COLOR_TEXT_BG

protected Color COLOR_TEXT_BG
UI Colors.


COLOR_TEXT_SBG

protected Color COLOR_TEXT_SBG
UI Colors.


COLOR_BUTTONS

protected Color COLOR_BUTTONS
UI Colors.


FONT_LABEL

protected Font FONT_LABEL

FONT_MSG

protected Font FONT_MSG

m_framesize

protected Dimension m_framesize
Size of the frame, can be set prior to calling initialize().


m_normalStyle

protected Style m_normalStyle

m_noiseStyle

protected Style m_noiseStyle

m_errorStyle

protected Style m_errorStyle
Constructor Detail

WikiEventMonitor

public WikiEventMonitor()
Creates an event monitor console with default title.


WikiEventMonitor

public WikiEventMonitor(String title)
Creates an event monitor console with optional title.

Method Detail

initialize

protected void initialize()
Initialize the monitor's UI.


setActive

public void setActive(boolean active)
Set the monitor active: listening for events.


writeMessage

public void writeMessage(String message)
Write the contents of message to the monitor console. Note that this will add a newline to the end of the message.

Parameters:
message - the message to write

writeError

public void writeError(String message)
Write the contents of message to the monitor console as an error message. Note that this will add a newline to the end of the message.

Parameters:
message - the error message to write

eventFired

public void eventFired(WikiEvent event)
Note that an event has been fired. This handles WikiEngineEvent, WikiPageEvent, WikiSecurityEvent, and WorkflowEvent, and may be overridden for other event types.

Parameters:
event - the event fired

appendBaseOutput

protected void appendBaseOutput(WikiEvent event,
                                Style style)
Append the basic output for any WikiEvent.


getFriendlyTimeStamp

protected String getFriendlyTimeStamp(long when)
Returns a String representing the provided timestamp in the form "yyyy-MM-dd HH:mm:ss" in UTC.


clearMessages

protected void clearMessages()

appendOutput

protected void appendOutput(String text,
                            Style style)
Append a string to the output area.


getSettingsPanel

protected JPanel getSettingsPanel()
Returns the northernmost panel. This is build from getWikiEventFiltersPanel(), getMiscSettingsPanel(), and getOptionalSettingsPanel(), the latter optional (null is permitted).


getWikiEventFiltersPanel

protected JPanel getWikiEventFiltersPanel()
Return the wiki event filters panel. This is a YBox panel that permits components to be added at the bottom. If you want to add anything to this panel, call it prior to initialize(), which finishes it off with some bottom vertical glue.


getMiscSettingsPanel

protected JPanel getMiscSettingsPanel()
Return the miscellaneous Settings panel. This is a YBox panel that permits components to be added at the bottom.


getOptionalSettingsPanel

protected JPanel getOptionalSettingsPanel()
Return any supplemental Settings panel, null if none. This is an optional panel shown at the bottom (south) of the settings area.


createCenterPanel

protected JPanel createCenterPanel()
Returns the center panel.


createSouthPanel

protected JPanel createSouthPanel()
Returns the southernmost panel containing the close button.


addStylesToDocument

protected void addStylesToDocument(StyledDocument doc)
Add some Swing Styles to the text area to permit colorized text.


createXBoxPanel

public JPanel createXBoxPanel()
A UI utility method that returns a JPanel managed by an X axis BoxLayout.


createYBoxPanel

public JPanel createYBoxPanel()
A UI utility method that returns a JPanel managed by a Y axis BoxLayout.


borderize

public void borderize(JComponent component,
                      String title)
A UI utility method that attaches a titled, line border around the JComponent component, using the String title.

Parameters:
component - the component to which to add the border
title - the title to add

createCheckBox

public JCheckBox createCheckBox(String name,
                                String tooltip,
                                boolean checked,
                                ItemListener listener)
A UI utility method that returns a checkbox button provided with its features.

Parameters:
name - the menu item mnemonic identifier
tooltip - the optional tool tip text
checked - the initial checked state
listener - the item listener used to respond to activity

createDialogButton

public JButton createDialogButton(String label,
                                  String tooltip,
                                  ActionListener listener)
A UI utility method that returns a dialog button provided its parameters. tooltip, and listener are optional.


createLabel

public JLabel createLabel(String title,
                          String tooltip)
A UI utility method that returns a label, provided an optional title and optional tooltip text.



The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.