|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--de.qfs.apps.qflog.logview.LogView
This is a complex view for displaying log messages. It is composed of a
LogTableView
, a LogFilterView
and a LogLevelView
and connects those in useful
ways.
A LogView can either be used directly by an application to display its log
messages and change its log levels by calling logToView
,
or it can be used with a log server to handle these tasks over RMI.
The LogView must be initialized by a call to init
after
creation. It uses its own resources for localization, which can be modified
via setResources
.
The Configurator
of the LogView
contains all Configurable
parts of
the subviews as well as the LogView's own configuration. It should be
registered with the Configuration
even when the LogView is not being displayed initially, since it contains
the settings for the log levels of an application.
Inner classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Field Summary | |
protected de.qfs.lib.option.OptionSet |
options
The Options used by the LogView. |
static int |
STATE_CONNECTED
Identifier for view connected to a LogListener. |
static int |
STATE_DISCONNECTED
Identifier for a view disconnected from a former connected LogListener. |
static int |
STATE_FILE
Identifier for a file view. |
static int |
STATE_INTERNAL
Identifier for an internal view. |
static int |
STATE_UNKNOWN
Identifier for an unknown state. |
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 |
Constructor Summary | |
LogView()
Create a new LogView. |
Method Summary | |
void |
cleanup()
Try to remove everything that might prevent the LogView from being garbage collected. |
void |
finalize()
Finalize the LogView. |
java.lang.String |
getClientName()
Get the name of the LogView's client. |
java.io.File |
getConfigurationDirectory()
Get the default directory to save the LogView's configuration in. |
de.qfs.lib.config.Configurator |
getConfigurator()
Get the Configurator for the LogView. |
java.io.File |
getFile()
Get the file of the view. |
LogFilterView |
getFilterView()
Get the filter view part. |
LogFrame |
getFrame()
Get a LogFrame for the view, creating one if necessary. |
LogLevelView |
getLevelView()
Get the level view part. |
int |
getLogCount()
Get the total number of log entries for this LogView, including current and deleted entries. |
de.qfs.lib.option.OptionSet |
getOptions()
Get the options of the LogView. |
de.qfs.lib.util.MapResourceBundle |
getResources()
Get the resources used by the LogView. |
int |
getState()
Get the state of the view. |
de.qfs.lib.gui.StatusLine |
getStatusLine()
Get the StatusLine of the LogView. |
LogTableModel |
getTableModel()
Get the LogTableModel of the LogView. |
LogTableView |
getTableView()
Get the table view part. |
void |
init()
Initialize the components of the view. |
boolean |
isLoggingEnabled()
Query whether logging is enabled for LogView related classes. |
static LogView |
logToView(java.lang.String name)
Convenience method that takes care of everything to create a LogView and install it directly inside an application's logging system. |
javax.swing.JMenu |
makeViewMenu()
Create the view menu for the LogView. |
void |
setClientName(java.lang.String clientName)
Set the name of the LogView's client. |
void |
setConfigurationDirectory(java.io.File dir)
Set the default directory to save the LogView's configuration in. |
void |
setFile(java.io.File file)
Set the file of the view. |
void |
setLoggingEnabled(boolean enable)
Enable or disable logging output caused directly or indirectly by LogView methods. |
void |
setLogLevels(LogLevelTreeModel model)
Set the log level model for the LogView. |
void |
setResources(java.util.ResourceBundle rb)
Override the default resources used by the LogView. |
void |
setState(int state)
Set the state of the view. |
void |
showDetailView(boolean show)
Set whether the detail view should be displayed. |
void |
showFilterView(boolean show)
Set whether the filter view should be displayed. |
void |
showLevelView(boolean show)
Set whether the log levels view should be displayed. |
void |
showStatusLine(boolean show)
Set whether the status line should be displayed. |
void |
startLogging()
Insert the LogView into the Log filter chain. |
void |
startLogging(de.qfs.lib.log.LogSource source)
Add the LogView to the filter chain of a LogSource. |
void |
stopLogging()
Remove the LogView from the Log filer chain. |
void |
stopLogging(de.qfs.lib.log.LogSource source)
Remove the LogView from the filter chain of a LogSource. |
void |
update(java.util.Observable obj,
java.lang.Object arg)
Notify the LogView that one of its Observables has changed. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext,
getUIClassID,
paramString,
updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener,
addNotify,
addPropertyChangeListener,
addPropertyChangeListener,
addVetoableChangeListener,
computeVisibleRect,
contains,
createToolTip,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
fireVetoableChange,
getActionForKeyStroke,
getAlignmentX,
getAlignmentY,
getAutoscrolls,
getBorder,
getBounds,
getClientProperty,
getComponentGraphics,
getConditionForKeyStroke,
getDebugGraphicsOptions,
getGraphics,
getHeight,
getInsets,
getInsets,
getLocation,
getMaximumSize,
getMinimumSize,
getNextFocusableComponent,
getPreferredSize,
getRegisteredKeyStrokes,
getRootPane,
getSize,
getToolTipLocation,
getToolTipText,
getToolTipText,
getTopLevelAncestor,
getVisibleRect,
getWidth,
getX,
getY,
grabFocus,
hasFocus,
isDoubleBuffered,
isFocusCycleRoot,
isFocusTraversable,
isLightweightComponent,
isManagingFocus,
isOpaque,
isOptimizedDrawingEnabled,
isPaintingTile,
isRequestFocusEnabled,
isValidateRoot,
paint,
paintBorder,
paintChildren,
paintComponent,
paintImmediately,
paintImmediately,
processComponentKeyEvent,
processFocusEvent,
processKeyEvent,
processMouseMotionEvent,
putClientProperty,
registerKeyboardAction,
registerKeyboardAction,
removeAncestorListener,
removeNotify,
removePropertyChangeListener,
removePropertyChangeListener,
removeVetoableChangeListener,
repaint,
repaint,
requestDefaultFocus,
requestFocus,
resetKeyboardActions,
reshape,
revalidate,
scrollRectToVisible,
setAlignmentX,
setAlignmentY,
setAutoscrolls,
setBackground,
setBorder,
setDebugGraphicsOptions,
setDoubleBuffered,
setEnabled,
setFont,
setForeground,
setMaximumSize,
setMinimumSize,
setNextFocusableComponent,
setOpaque,
setPreferredSize,
setRequestFocusEnabled,
setToolTipText,
setUI,
setVisible,
unregisterKeyboardAction,
update |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
print,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
removeContainerListener,
setCursor,
setLayout,
validate,
validateTree |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
getBackground,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getInputContext,
getInputMethodRequests,
getLocale,
getLocation,
getLocationOnScreen,
getName,
getParent,
getPeer,
getSize,
getToolkit,
getTreeLock,
gotFocus,
handleEvent,
hide,
imageUpdate,
inside,
isDisplayable,
isEnabled,
isLightweight,
isShowing,
isValid,
isVisible,
keyDown,
keyUp,
list,
list,
list,
location,
lostFocus,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
postEvent,
prepareImage,
prepareImage,
printAll,
processComponentEvent,
processInputMethodEvent,
processMouseEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
repaint,
repaint,
repaint,
resize,
resize,
setBounds,
setBounds,
setComponentOrientation,
setDropTarget,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
show,
show,
size,
toString,
transferFocus |
Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final int STATE_UNKNOWN
public static final int STATE_INTERNAL
public static final int STATE_FILE
public static final int STATE_CONNECTED
public static final int STATE_DISCONNECTED
protected transient de.qfs.lib.option.OptionSet options
Constructor Detail |
public LogView()
Method Detail |
public static LogView logToView(java.lang.String name)
Configuration
, so its state is saved together with the application's
state. To display the LogView, just call
logView.getFrame().show();
.name
- The client name to use for saved log files.public void init()
public javax.swing.JMenu makeViewMenu()
public void cleanup()
public void finalize()
public final int getState()
public final void setState(int state)
state
- The state to set.public final java.lang.String getClientName()
public final void setClientName(java.lang.String clientName)
Configuration
.clientName
- The name to set.public final java.io.File getFile()
public final void setFile(java.io.File file)
file
- The file to set.public boolean isLoggingEnabled()
public final void setLoggingEnabled(boolean enable)
de.qfs.lib.log.Log.excludeThread
.
This is necessary, if the LogFilterTreeModel is used inside the
application whose logs it is supposed to filter. The default value is false.
enable
- True to enable logging, false to disable it.public final de.qfs.lib.util.MapResourceBundle getResources()
public void setResources(java.util.ResourceBundle rb)
The resources are not passed on to the subviews of the LogView.
rb
- ResourceBundle containing the resources to use.public de.qfs.lib.config.Configurator getConfigurator()
public final java.io.File getConfigurationDirectory()
public final void setConfigurationDirectory(java.io.File dir)
dir
- The LogView's configuration save directory.public final LogTableModel getTableModel()
public int getLogCount()
public final de.qfs.lib.option.OptionSet getOptions()
public LogFrame getFrame()
public final LogTableView getTableView()
public final LogFilterView getFilterView()
public final LogLevelView getLevelView()
public de.qfs.lib.gui.StatusLine getStatusLine()
public void setLogLevels(LogLevelTreeModel model)
model
- The LogLevelModel to set.public void showFilterView(boolean show)
show
- True to display the filter view.public void showLevelView(boolean show)
show
- True to display the log levels view.public void showDetailView(boolean show)
show
- True to display the detail view.public void showStatusLine(boolean show)
show
- True to display the status line.public void update(java.util.Observable obj, java.lang.Object arg)
obj
- The Observable that changed.arg
- Details about the change.public void startLogging()
public void stopLogging()
public void startLogging(de.qfs.lib.log.LogSource source)
source
- The LogSource to filter on.public void stopLogging(de.qfs.lib.log.LogSource source)
source
- The LogSource to remove the filter from.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |