|
|||||||||
| Home >> All >> org >> geotools >> gui >> [ swing overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.geotools.gui.swing
Class LoggingPanel

java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.geotools.gui.swing.LoggingPanel
- All Implemented Interfaces:
- javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
- public class LoggingPanel
- extends javax.swing.JPanel
A panel displaying logging messages. The windows displaying Geotools's logging messages can be constructed with the following code:
new LoggingPanel("org.geotools").show 55 (null);
This panel is initially set to listen to messages of level Level.CONFIG>Level.CONFIG 55 or higher.
This level can be changed with getHandler() 55 .setLevel(aLevel).
- Version:
- $Id: LoggingPanel.java,v 1.5 2003/02/09 23:38:11 lbruand Exp $
| Nested Class Summary | |
private class |
LoggingPanel.CellRenderer
Display cell contents. |
| Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
| Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
static java.lang.String |
CVSID
|
private java.util.List |
levelColors
Pairs of foreground and background colors to use for displaying logging messages. |
private int[] |
levelValues
The levels for colors enumerated in levelColors. |
private java.util.logging.Logger |
logger
The logger specified at construction time, or null if none. |
private LoggingTableModel |
model
The model for this component. |
private javax.swing.JTable |
table
The table for displaying logging messages. |
| 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.Container |
|
| 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(java.util.logging.Logger logger)
Constructs a new logging panel and register it to the specified logger. |
|
LoggingPanel(java.lang.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. |
java.awt.Color |
getBackground(java.util.logging.LogRecord record)
Returns the background color for the specified log record. |
int |
getCapacity()
Returns the capacity. |
private java.awt.Color |
getColor(java.util.logging.LogRecord record,
int offset)
Returns the foreground or background color for the specified record. |
java.awt.Color |
getForeground(java.util.logging.LogRecord record)
Returns the foreground color for the specified log record. |
java.util.logging.Handler |
getHandler()
Returns the logging handler. |
void |
setCapacity(int capacity)
Set the capacity. |
void |
setLevelColor(java.util.logging.Level level,
java.awt.Color foreground,
java.awt.Color background)
Set the foreground and background colors for messages of the specified level. |
java.awt.Component |
show(java.awt.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 |
CVSID
public static final java.lang.String CVSID
- See Also:
- Constant Field Values
model
private final LoggingTableModel model
- The model for this component.
table
private final javax.swing.JTable table
- The table for displaying logging messages.
levelValues
private int[] levelValues
- The levels for colors enumerated in
levelColors. This array must be in increasing order. Logging messages of levellevelValues[i]or higher will be displayed with foreground colorlevelColors[i*2]and background colorlevelColors[i*2+1].- See Also:
- Level.intValue()>
Level.intValue()55 ,getForeground(LogRecord)55 ,getBackground(LogRecord)55
levelColors
private final java.util.List levelColors
- Pairs of foreground and background colors to use for displaying logging messages.
Logging messages of level
levelValues[i]or higher will be displayed with foreground colorlevelColors[i*2]and background colorlevelColors[i*2+1].- See Also:
getForeground(LogRecord)55 ,getBackground(LogRecord)55
logger
private java.util.logging.Logger logger
- The logger specified at construction time, or
nullif none.
| Constructor Detail |
LoggingPanel
public LoggingPanel()
- Constructs a new logging panel. This panel is not registered to any logger.
Registration can be done with the following code:
logger.addHandler 55 (
getHandler()55 );
LoggingPanel
public LoggingPanel(java.util.logging.Logger logger)
- Constructs a new logging panel and register it to the specified logger.
LoggingPanel
public LoggingPanel(java.lang.String logger)
- Construct a logging panel and register it to the specified logger.
| Method Detail |
getHandler
public java.util.logging.Handler getHandler()
- Returns the logging handler.
getCapacity
public int getCapacity()
- Returns the capacity. This is the maximum number of java.util.logging.LogRecords the handler
can memorize. If more messages are logged, then the earliest messages will be discarted.
setCapacity
public void setCapacity(int capacity)
- Set the capacity. This is the maximum number of java.util.logging.LogRecords the handler can
memorize. If more messages are logged, then the earliest messages will be discarted.
getForeground
public java.awt.Color getForeground(java.util.logging.LogRecord record)
- Returns the foreground color for the specified log record. This method is invoked at
rendering time for every cell in the table's "message" column. The default implementation
returns a color based on the record's level, using colors set with
setLevelColor(java.util.logging.Level, java.awt.Color, java.awt.Color)55 .
getBackground
public java.awt.Color getBackground(java.util.logging.LogRecord record)
- Returns the background color for the specified log record. This method is invoked at
rendering time for every cell in the table's "message" column. The default implementation
returns a color based on the record's level, using colors set with
setLevelColor(java.util.logging.Level, java.awt.Color, java.awt.Color)55 .
getColor
private java.awt.Color getColor(java.util.logging.LogRecord record, int offset)
- Returns the foreground or background color for the specified record.
setLevelColor
public void setLevelColor(java.util.logging.Level level, java.awt.Color foreground, java.awt.Color background)
- Set the foreground and background colors for messages of the specified level.
The specified colors will apply on any messages of level
levelor greater, up to the next level set with an other call tosetLevelColor(...).
doLayout
public void doLayout()
- Layout this component. This method give all the remaining space, if any,
to the last table's column. This column is usually the one with logging
messages.
show
public java.awt.Component show(java.awt.Component owner)
- Convenience method showing this logging panel into a frame.
Different kinds of frame can be constructed according
ownerclass:- If
owneror one of its parent is aJDesktopPane, thenpanelis added into aJInternalFrame. - If
owneror one of its parent is aFrameor aDialog, thenpanelis added into aJDialog. - Otherwise,
panelis added into aJFrame.
- If
dispose
public void dispose()
- Free any resources used by this
LoggingPanel. If a java.util.logging.Logger was specified at construction time, then this method unregister theLoggingPanel's handler from the specified logger. Next, Handler.close()>Handler.close()55 is invoked.
This method is invoked automatically when the user close the windows created withshow(Component)55 . If thisLoggingPanelis displayed by some other ways (for example if it has been added into a javax.swing.JPanel), then thisdispose()should be invoked explicitely when the container is being discarted.
|
|||||||||
| Home >> All >> org >> geotools >> gui >> [ swing overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC