|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.biojava.spice.gui.logging.LoggingPanel
THis class is taken from the LGPL package Geotools. A panel displaying logging messages. The windows displaying Geotools's logging messages can be constructed with the following code:
new LoggingPanel("org.biojava.spice").show(null);
This panel is initially set to listen to messages of level Level.CONFIG or higher.
This level can be changed with getHandler().setLevel(aLevel).
| Nested Class Summary | |
static class |
LoggingPanel.Column
Enumeration class for columns to be shown in a LoggingPanel. |
| Nested classes inherited from class javax.swing.JPanel |
JPanel.AccessibleJPanel |
| Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
static LoggingPanel.Column |
CLASS
Constant for setColumnVisible(org.biojava.spice.gui.logging.LoggingPanel.Column, boolean). |
static LoggingPanel.Column |
LEVEL
Constant for setColumnVisible(org.biojava.spice.gui.logging.LoggingPanel.Column, boolean). |
static LoggingPanel.Column |
LOGGER
Constant for setColumnVisible(org.biojava.spice.gui.logging.LoggingPanel.Column, boolean). |
static LoggingPanel.Column |
MESSAGE
Constant for setColumnVisible(org.biojava.spice.gui.logging.LoggingPanel.Column, boolean). |
static LoggingPanel.Column |
METHOD
Constant for setColumnVisible(org.biojava.spice.gui.logging.LoggingPanel.Column, boolean). |
static LoggingPanel.Column |
TIME_OF_DAY
Constant for setColumnVisible(org.biojava.spice.gui.logging.LoggingPanel.Column, boolean). |
| Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
LoggingPanel()
Constructs a new logging panel. |
|
LoggingPanel(Logger logger)
Constructs a new logging panel and register it to the specified logger. |
|
LoggingPanel(String logger)
Construct a logging panel and register it to the specified logger. |
|
| Method Summary | |
void |
dispose()
Free any resources used by this LoggingPanel. |
void |
doLayout()
Layout this component. |
Color |
getBackground(LogRecord record)
Returns the background color for the specified log record. |
int |
getCapacity()
Returns the capacity. |
Color |
getForeground(LogRecord record)
Returns the foreground color for the specified log record. |
Handler |
getHandler()
Returns the logging handler. |
boolean |
isColumnVisible(LoggingPanel.Column column)
Returns true if the given column is visible. |
void |
setCapacity(int capacity)
Set the capacity. |
void |
setColumnVisible(LoggingPanel.Column column,
boolean visible)
Show or hide the given column. |
void |
setLevelColor(Level level,
Color foreground,
Color background)
Set the foreground and background colors for messages of the specified level. |
Component |
show(Component owner)
Convenience method showing this logging panel into a frame. |
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final LoggingPanel.Column LOGGER
setColumnVisible(org.biojava.spice.gui.logging.LoggingPanel.Column, boolean).
public static final LoggingPanel.Column CLASS
setColumnVisible(org.biojava.spice.gui.logging.LoggingPanel.Column, boolean).
public static final LoggingPanel.Column METHOD
setColumnVisible(org.biojava.spice.gui.logging.LoggingPanel.Column, boolean).
public static final LoggingPanel.Column TIME_OF_DAY
setColumnVisible(org.biojava.spice.gui.logging.LoggingPanel.Column, boolean).
public static final LoggingPanel.Column LEVEL
setColumnVisible(org.biojava.spice.gui.logging.LoggingPanel.Column, boolean).
public static final LoggingPanel.Column MESSAGE
setColumnVisible(org.biojava.spice.gui.logging.LoggingPanel.Column, boolean).
| Constructor Detail |
public LoggingPanel()
logger.addHandler(getHandler());
public LoggingPanel(Logger logger)
logger - The logger to listen to, or null for the root logger.public LoggingPanel(String logger)
logger - The logger name to listen to, or null for the root logger.| Method Detail |
public Handler getHandler()
public boolean isColumnVisible(LoggingPanel.Column column)
true if the given column is visible.
column - The column to show or hide. May be one of LOGGER, CLASS,
METHOD, TIME_OF_DAY, LEVEL or MESSAGE.
public void setColumnVisible(LoggingPanel.Column column,
boolean visible)
column - The column to show or hide. May be one of LOGGER, CLASS,
METHOD, TIME_OF_DAY, LEVEL or MESSAGE.visible - The visible state for the specified column.public int getCapacity()
LogRecords the handler
can memorize. If more messages are logged, then the earliest messages will be discarted.
public void setCapacity(int capacity)
LogRecords the handler can
memorize. If more messages are logged, then the earliest messages will be discarted.
capacity - the max number of LogRecords that can be usedpublic Color getForeground(LogRecord record)
setLevelColor(java.util.logging.Level, java.awt.Color, java.awt.Color).
record - The record to get the foreground color.
null for the default color.public Color getBackground(LogRecord record)
setLevelColor(java.util.logging.Level, java.awt.Color, java.awt.Color).
record - The record to get the background color.
null for the default color.
public void setLevelColor(Level level,
Color foreground,
Color background)
level or
greater, up to the next level set with an other call to setLevelColor(...).
level - The minimal level to set color for.foreground - The foreground color, or null for the default color.background - The background color, or null for the default color.public void doLayout()
public Component show(Component owner)
owner class:
owner or one of its parent is a JDesktopPane,
then panel is added into a JInternalFrame.owner or one of its parent is a Frame or a Dialog,
then panel is added into a JDialog.panel is added into a JFrame.
owner - The owner, or null to show
this logging panel in a top-level window.
JInternalFrame,
a JDialog or a JFrame.public void dispose()
LoggingPanel. If a Logger was
specified at construction time, then this method unregister the LoggingPanel's
handler from the specified logger. Next, Handler.close() is invoked.
show(Component). If this LoggingPanel is displayed
by some other ways (for example if it has been added into a JPanel),
then this dispose() should be invoked explicitely when the container
is being discarted.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||