|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectComponent
Container
JComponent
LoggingPanel
public class LoggingPanel
A panel displaying logging messages. The windows displaying Geotk's logging messages can be constructed with the following code:
new LoggingPanel("org.geotoolkit").show(null);
This panel initially listens to all messages (Level.ALL). However the messages will
still be filtered according the logger level. If all levels
are really aimed to be reported, then a call to Logger.setLevel(Level.ALL) may be
needed.
Note that a different level can be set specifically to this LoggingPanel with a call
to getHandler().setLevel(aLevel). However this is only for restricting
the logger messages to a higher level than the logger level.
| display/geotk-widgets-swing (download) | View source code for this class |
| Nested Class Summary | |
|---|---|
static class |
LoggingPanel.Column
Enumeration class for columns to be shown in a LoggingPanel. |
| Nested classes/interfaces inherited from class JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
|---|
| Fields inherited from class 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 Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface 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)
Constructs a logging panel and register it to the specified logger. |
|
| Method Summary | |
|---|---|
void |
dispose()
Frees any resources used by this LoggingPanel. |
void |
doLayout()
Layout this component. |
Color |
getBackground(Level level)
Returns the background color for the specified log record. |
int |
getCapacity()
Returns the maximum number of LogRecords the handler can
memorize. |
Color |
getForeground(Level level)
Returns the foreground color for the given level. |
Handler |
getHandler()
Returns the logging handler. |
Font |
getMessageFont()
Returns the font to use for displaying the messages (last table column). |
boolean |
isColumnVisible(LoggingPanel.Column column)
Returns true if the given column is visible. |
void |
setCapacity(int capacity)
Sets the maximum number of LogRecords the handler can memorize. |
void |
setColumnVisible(LoggingPanel.Column column,
boolean visible)
Shows or hide the given column. |
void |
setLevelColor(Level level,
Color foreground,
Color background)
Sets the foreground and background colors for messages of the specified level. |
void |
setMessageFont(Font font)
Sets the font to use for displaying the messages. |
Component |
show(Component owner)
Convenience method showing this logging panel into a frame. |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 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.
true if the given column is visible.
public void setColumnVisible(LoggingPanel.Column column,
boolean visible)
column - The column to show or hide.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 discarded.
public void setCapacity(int capacity)
LogRecords the handler can memorize.
If more messages are logged, then the earliest messages will be discarded.
capacity - The new maximum number of record.public Font getMessageFont()
public void setMessageFont(Font font)
font - The new font for displaying messages.public Color getForeground(Level level)
level - The level for which to get the foreground color.
null for the default color.public Color getBackground(Level level)
setLevelColor(...).
level - The level for which to get the background color.
null for the default color.
public void setLevelColor(Level level,
Color foreground,
Color background)
level or
higher, 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()
doLayout in class Containerpublic 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.
This method is invoked automatically when the user closes the windows created with
show(Component). If this LoggingPanel is displayed by some other ways
(for example if it has been added into a JPanel), then this dispose()
method must be invoked explicitly when the container is being discarded.
dispose in interface Disposable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||