de.esprit.common.log

## Class LogFrame

- java.lang.Object
- - java.awt.Component
  - - java.awt.Container
    - - java.awt.Window
      - - java.awt.Frame
        - - javax.swing.JFrame
          - - de.esprit.common.gui.ZFrame
            - - de.esprit.common.log.LogFrame

- All Implemented Interfaces:
    BorderLayoutConstants, Closeable, Exitable, Testable, TextConsole, GridBagConstants, ToolWindow, EnvStorable, Clearable, Dumpable, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

      public class LogFrame
      extends ZFrame
      implements GridBagConstants, Clearable, Exitable, Testable, EnvStorable, TextConsole

  This frame contains a `LogConsole` for printing log messages to the screen. The messages are received from a `LogChannel` and formatted by a `LogPrinter`. This frame provides a GUI for controlling both the message filtering and message formatting.

  Note that this frame contains an Exit button for terminating the application. You may use the method `registerForExit(Exitable)` in order to register any component that should perform the `exit()` call. If none is registered, the frame itself terminates the application.

  Author:
    Rainer Buesch
  See Also:
    `LogConsole`, `LogChannel`, `LogPrinter`, Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class javax.swing.JFrame

      `javax.swing.JFrame.AccessibleJFrame`

    - ### Nested classes/interfaces inherited from class java.awt.Frame

      `java.awt.Frame.AccessibleAWTFrame`

    - ### Nested classes/interfaces inherited from class java.awt.Window

      `java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type`

    - ### Nested classes/interfaces inherited from class java.awt.Container

      `java.awt.Container.AccessibleAWTContainer`

    - ### Nested classes/interfaces inherited from class java.awt.Component

      `java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy`

  - ### Field Summary

    - ### 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 de.esprit.common.gui.gridbag.GridBagConstants

      `BOTH, C, CENTER, E, EAST, HOR, HORIZONTAL, N, NE, NONE, NORTH, NORTHEAST, NORTHWEST, NW, REM, REMAINDER, S, SE, SOUTH, SOUTHEAST, SOUTHWEST, SW, VER, VERTICAL, W, WEST`

    - ### Fields inherited from interface de.esprit.common.gui.comp.BorderLayoutConstants

      `CENTER, EAST, NORTH, SOUTH, WEST`

    - ### 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

    Constructors
    Constructor and Description
    `LogFrame(LogChannel logCh, LogPrinter logPr, java.lang.String title)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addEnvProperties(EnvMap props)` This method is called on the implementing class in order to give it a chance to fill the passed Properties object with key-value pairs that should be saved in the environment properties file.
    `void` | `clear()` Clears the MessageConsole
    `void` | `close()` Overridden to deregister from the underlying LogPrinter
    `boolean` | `exit()` Implements the Exitable interface.
    `protected java.awt.Color` | `getDefaultColorOf(java.lang.String logName)` To be overridden in order to provide a different default color
    `LogConsole` | `getMessageConsole()`
    `void` | `initFromEnvStore(EnvStore envStore)`
    `void` | `popup()` Overridden to register for message notification at the underlying LogPrinter
    `void` | `println()` Implements the TextConsole interface to print into the MessageConsole
    `void` | `println(java.lang.String text)` Implements the TextConsole interface to print into the MessageConsole
    `void` | `registerForExit(Exitable comp)` Register an object for performing the `exit()` call.
    `void` | `setBufferSize(int buffSize)` Sets buffer size of the frame's MessageConsole - thus it's display is limited to the given number of lines.
    `void` | `setLogLevel(LogLevel level)` Sets the current log-level by setting the value in the LogController component, which in turn passes it to the underlying LogPrinter.
    `void` | `test()` This method is called by the `TestButton` on it's registered target.

    - ### Methods inherited from class de.esprit.common.gui.ZFrame

      `closeByIcon, createWindowAdapter, getMinimumHeight, getMinimumWidth, getWindowAdapter, isErrorAttachable, isLocated, isPacked, pack, repack, setIcon, setIcon, setLocation, setLocationRelativeTo, setLocationRelativeTo, setLocationToCenter, setTitle, setVisible, shiftLocation, toDumpString, toDumpString, toString, toString`

    - ### Methods inherited from class javax.swing.JFrame

      `addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update`

    - ### Methods inherited from class java.awt.Frame

      `addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated`

    - ### Methods inherited from class java.awt.Window

      `addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocationByPlatform, setMinimumSize, setModalExclusionType, setSize, setSize, setType, 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, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, 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, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface de.esprit.common.gui.ToolWindow

      `getLocation, getSize, getTitle, getToolkit, setMinimumSize, setPreferredSize`

    - ### Methods inherited from interface java.awt.MenuContainer

      `getFont, postEvent`

- - ### Constructor Detail

    - #### LogFrame

          public LogFrame(LogChannel logCh,
                  LogPrinter logPr,
                  java.lang.String title)

  - ### Method Detail

    - #### initFromEnvStore

          public void initFromEnvStore(EnvStore envStore)

      Specified by:
        `initFromEnvStore` in interface `EnvStorable`

    - #### addEnvProperties

          public void addEnvProperties(EnvMap props)

      Description copied from interface: `EnvStorable`
      This method is called on the implementing class in order to give it a chance to fill the passed Properties object with key-value pairs that should be saved in the environment properties file.
      Specified by:
        `addEnvProperties` in interface `EnvStorable`

    - #### getMessageConsole

          public LogConsole getMessageConsole()

    - #### getDefaultColorOf

          protected java.awt.Color getDefaultColorOf(java.lang.String logName)

      To be overridden in order to provide a different default color

    - #### registerForExit

          public void registerForExit(Exitable comp)

      Register an object for performing the `exit()` call. If no object is registered the frame itself will perform a `System.exit(0)` when the 'Exit' button is clicked.

    - #### setLogLevel

          public void setLogLevel(LogLevel level)

      Sets the current log-level by setting the value in the LogController component, which in turn passes it to the underlying LogPrinter.

    - #### println

          public void println(java.lang.String text)

      Implements the TextConsole interface to print into the MessageConsole
      Specified by:
        `println` in interface `TextConsole`

    - #### println

          public void println()

      Implements the TextConsole interface to print into the MessageConsole
      Specified by:
        `println` in interface `TextConsole`

    - #### clear

          public void clear()

      Clears the MessageConsole
      Specified by:
        `clear` in interface `Clearable`

    - #### close

          public void close()

      Overridden to deregister from the underlying LogPrinter
      Specified by:
        `close` in interface `Closeable`
      Overrides:
        `close` in class `ZFrame`

    - #### popup

          public void popup()

      Overridden to register for message notification at the underlying LogPrinter
      Specified by:
        `popup` in interface `ToolWindow`
      Overrides:
        `popup` in class `ZFrame`

    - #### setBufferSize

          public void setBufferSize(int buffSize)

      Sets buffer size of the frame's MessageConsole - thus it's display is limited to the given number of lines.

    - #### test

          public void test()

      Description copied from interface: `Testable`
      This method is called by the `TestButton` on it's registered target.
      Specified by:
        `test` in interface `Testable`

    - #### exit

          public boolean exit()

      Implements the Exitable interface.
      Specified by:
        `exit` in interface `Exitable`
      Returns:
        false if the exit was actually prevented by any check

Copyright © 2012 EsprIT-Systems. All Rights Reserved.