imx.loggui
Class LogMaster

java.lang.Object
  extended by imx.loggui.LogMaster
All Implemented Interfaces:
java.io.Serializable

public final class LogMaster
extends java.lang.Object
implements java.io.Serializable

This is the main class of the logGui. LogMaster contains the configuration of the logGui. It is implemented as a singleton, and is the logGui correspondent to the LogManager. It provides the methods to start the logGui and to configure it.

The simplest way to do this is by calling startLogGui()

See Also:
Serialized Form

Field Summary
 ActiveClassMap classViews
          Here you can register for each object (logger, handler, filter, formatter) a view, so the logGui knows how to represent and edit it.
 ActiveArrayList filterCreatorSet
          Contains all creators that will create a new filter, when selected.
 ActiveArrayList filterSet
          Contains all filter, that can be selected for a logger or handler.
 ActiveArrayList formatterCreatorSet
          contains all creators that will create a new formatter, when selected.
 ActiveArrayList formatterSet
          Contains all formatter, that can be selected for a handler.
 ActiveArrayList handlerCreatorSet
          contains all creators that will create a new handler, when selected.
 ActiveArrayList handlerSet
          Use the static final public Active... variables to register listeners if you want to know, when somebody changes them.
 ActiveArrayList levelSet
          Contains all levels, that can be selected for a logger or handler.
static java.lang.String NAME
           
static java.lang.String VERSION
           
 
Method Summary
 void addFilter(java.util.logging.Filter filter)
          Registers a new filter in the filter selection and configuration list.
 void addFilterCreator(CreatorInterface filterCreator)
          Registers a new filter Creator in the filter Creator selection list.
 void addFormatter(java.util.logging.Formatter formatter)
          Registers a new formatter in the formatter selection and configuration list.
 void addFormatterCreator(CreatorInterface formatterCreator)
          Registers a new formatter Creator in the formatter Creator selection list.
 void addHandler(java.util.logging.Handler handler)
          Registers a new handler in the handler selection and configuration list.
 void addHandlerCreator(CreatorInterface handlerCreator)
          Registers a new handler Creator in the handler Creator selection list.
 void addLoggerListener(ListenerInterface listener)
          This listener will inform you, when the list of loggers has changed.
 void addView(java.lang.Class objectClass, java.awt.Component view)
          If you register a new handler, filter or formatter class, you would probably wish to be able to configure it with a view.
 void configClear()
          Removes all handler, filter and formatter.
 void configDefault()
          Configueres LogMaster to a default configuration.
 void configExternalLHFF()
          Searches for external Levels, Handler, Filter and Formatters used by the loggers and includes them in the selection menues.
static javax.swing.JFrame getLogFrame()
          This function returns the getLogView() packed in an independent window, with additional menu.
static LogMaster getLogMaster()
          returns the LogMaster singleton.
static javax.swing.JPanel getLogView()
          This function returnes the logging configuration gui as a JPanel, so that you can incorporate it into your own programs.
 boolean isFillLoggerNodes()
          If fillLoggerNodes is true, then additional loggers are created, so that the logger become a complete tree, where the loggers are grouped under their parent logger.
 void load(java.io.InputStream in)
          Loads a configuration for this LogMaster from in.
static void main(java.lang.String[] args)
           
 void refresh()
          Refreshes the list of loggers.
 void removeLoggerListener(ListenerInterface listener)
           
 void save(java.io.OutputStream out)
          Saves this LogMasters configuration to out.
 void setFillLoggerNodes(boolean b)
           
static void startLogGui()
          configures and shows the logGui Window.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values

VERSION

public static final java.lang.String VERSION
See Also:
Constant Field Values

handlerSet

public final ActiveArrayList handlerSet
Use the static final public Active... variables to register listeners if you want to know, when somebody changes them. To modify their contents you should use the methods from the public config interface, because they are more type save. handlerSet contains all handler, that can be selected for loggers.


handlerCreatorSet

public final ActiveArrayList handlerCreatorSet
contains all creators that will create a new handler, when selected. This creators are showed, when the new button of the handler list is selected.


filterSet

public final ActiveArrayList filterSet
Contains all filter, that can be selected for a logger or handler.


filterCreatorSet

public final ActiveArrayList filterCreatorSet
Contains all creators that will create a new filter, when selected. This creators are showed, when the new button of the filter list is selected.


formatterSet

public final ActiveArrayList formatterSet
Contains all formatter, that can be selected for a handler.


formatterCreatorSet

public final ActiveArrayList formatterCreatorSet
contains all creators that will create a new formatter, when selected. This creators are showed, when the new button of the formatter list is selected.


levelSet

public final ActiveArrayList levelSet
Contains all levels, that can be selected for a logger or handler.


classViews

public final ActiveClassMap classViews
Here you can register for each object (logger, handler, filter, formatter) a view, so the logGui knows how to represent and edit it.

Method Detail

main

public static void main(java.lang.String[] args)

getLogMaster

public static LogMaster getLogMaster()
returns the LogMaster singleton.

Returns:
the global LogMaster

startLogGui

public static void startLogGui()
configures and shows the logGui Window.


getLogView

public static javax.swing.JPanel getLogView()
This function returnes the logging configuration gui as a JPanel, so that you can incorporate it into your own programs. The gui is implemented as a singleton.


getLogFrame

public static javax.swing.JFrame getLogFrame()
This function returns the getLogView() packed in an independent window, with additional menu.

Returns:
the logging configuration GUI JFrame
See Also:
getLogView()

configDefault

public void configDefault()
Configueres LogMaster to a default configuration.


configExternalLHFF

public void configExternalLHFF()
Searches for external Levels, Handler, Filter and Formatters used by the loggers and includes them in the selection menues. If you combine this method with configDefault() call configDefault() first.


configClear

public void configClear()
Removes all handler, filter and formatter.


addLoggerListener

public void addLoggerListener(ListenerInterface listener)
This listener will inform you, when the list of loggers has changed. Currently there is no way in the java.util.logger api to know this, so it is only triggered when the LogMaster is refreshed.

See Also:
refresh()

removeLoggerListener

public void removeLoggerListener(ListenerInterface listener)

addHandler

public void addHandler(java.util.logging.Handler handler)
Registers a new handler in the handler selection and configuration list. The new handler should implement the Serializable interface.


addHandlerCreator

public void addHandlerCreator(CreatorInterface handlerCreator)
Registers a new handler Creator in the handler Creator selection list. This will allow the user to create new handlers on the fly.


addFilter

public void addFilter(java.util.logging.Filter filter)
Registers a new filter in the filter selection and configuration list.


addFilterCreator

public void addFilterCreator(CreatorInterface filterCreator)
Registers a new filter Creator in the filter Creator selection list. This will allow the user to create new filters on the fly.


addFormatter

public void addFormatter(java.util.logging.Formatter formatter)
Registers a new formatter in the formatter selection and configuration list.


addFormatterCreator

public void addFormatterCreator(CreatorInterface formatterCreator)
Registers a new formatter Creator in the formatter Creator selection list. This will allow the user to create new formatters on the fly.


addView

public void addView(java.lang.Class objectClass,
                    java.awt.Component view)
If you register a new handler, filter or formatter class, you would probably wish to be able to configure it with a view. With this method you can register for each class a view object which then should be able to do this. All registered views must implement the ListenerInterface and be able to handle objects passed in its update() method, which will be of type objectClass.

Parameters:
objectClass - The class of objects, that view can configure
view - The view that can represent and/or configure objectClass objects

isFillLoggerNodes

public boolean isFillLoggerNodes()
If fillLoggerNodes is true, then additional loggers are created, so that the logger become a complete tree, where the loggers are grouped under their parent logger.


setFillLoggerNodes

public void setFillLoggerNodes(boolean b)
See Also:
isFillLoggerNodes()

refresh

public void refresh()
Refreshes the list of loggers. This must be done manualy. There is no way, to now, when a new Logger is added to LogManager.


save

public void save(java.io.OutputStream out)
          throws java.io.IOException
Saves this LogMasters configuration to out. All handler, filter and formatter, that are not serializable, will not be saved!

Throws:
java.io.IOException

load

public void load(java.io.InputStream in)
          throws java.io.IOException,
                 java.lang.ClassNotFoundException
Loads a configuration for this LogMaster from in.

Parameters:
in -
Throws:
java.io.IOException
java.lang.ClassNotFoundException