Copyright 2009,2010, Lapetus Systems Ltd. (All rights reserved)

com.lapetus_ltd.api.db.gui.dialogs
Class TLptsViewLogPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.lapetus_ltd.api.db.gui.dialogs.TLptsViewLogPanel
All Implemented Interfaces:
ILptsCharSetLocaleListener, ILptsLogListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class TLptsViewLogPanel
extends javax.swing.JPanel
implements ILptsLogListener, ILptsCharSetLocaleListener

Class Description : Use this panel in the application to show and control the logs in the logger.

This dialog provides the ability to display logs, filter logs, clear logs, save logs to file and show popups
for the user specified types of logs.


$LastChangedRevision: 1230 $
$LastChangedDate:: 2010-12-09 11:06:40#$

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static int VISIBLE_DEBUG
           
static int VISIBLE_ERROR
           
static int VISIBLE_MESSAGE
           
static int VISIBLE_WARNING
           
 
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
TLptsViewLogPanel()
          Constructor for the Log Panel.
TLptsViewLogPanel(javax.swing.JFrame frame)
          Constructor for the Log Panel.
 
Method Summary
 void closeLogFile()
          Closes the log file.
 boolean getDateFormat()
          Gets the date format.
 java.lang.String getHourFormat()
          Gets the hour format.
 int getVisibility()
          Gets the visibility options of the logs.
 void localeHasChanged(java.lang.String language, java.lang.String country)
          Implementation of the ILptsCharSetLocaleListener.
 void newLogGenerated(TLptsLog log)
          Implements the ILptsLogListener.
 void setDateTimeFormat(boolean dateFormat, java.lang.String hourFormat)
          sets the date and time formats.
 void setParentFrame(javax.swing.JFrame frame)
          Sets the parent frame and takes care of closing the log file.
 void setVisibility(int visibility)
          Set the visibility of the logs.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VISIBLE_DEBUG

public static final int VISIBLE_DEBUG
See Also:
Constant Field Values

VISIBLE_ERROR

public static final int VISIBLE_ERROR
See Also:
Constant Field Values

VISIBLE_MESSAGE

public static final int VISIBLE_MESSAGE
See Also:
Constant Field Values

VISIBLE_WARNING

public static final int VISIBLE_WARNING
See Also:
Constant Field Values
Constructor Detail

TLptsViewLogPanel

public TLptsViewLogPanel()
Constructor for the Log Panel.
When this constructor is used the closeLogFile function must be called by the application when closing this panel.


TLptsViewLogPanel

public TLptsViewLogPanel(javax.swing.JFrame frame)
Constructor for the Log Panel.
This constructor takes care of the closing of the log file (#closeLogFile).
The application does not need to call it.

Parameters:
frame - The frame that is the parent to this panel.
Method Detail

closeLogFile

public void closeLogFile()
Closes the log file.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : No

Notes :
Needs to be performed so that all the contents of the files are written.
A suggested place to put this is in windowClosing of WindowListener (of the main frame).

Example :

 

TLptsViewLogPanel logPanel = new TLptsViewLogPanel(); . . . //later in the code or on exit. logPanel.closeLogFile(); System.exit(0);


getDateFormat

public boolean getDateFormat()
Gets the date format.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : No

Notes : Return true or false

Example :

 

Returns:
true if format is "dd-MM-yy " else "MM-dd-yy " false

getHourFormat

public java.lang.String getHourFormat()
Gets the hour format.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : No

Notes : Return the value to string.

Example :

 

Returns:
Returns a string equivalent to TLptsTimeUtil.TIME_HH_MM_SS_SSS, TLptsTimeUtil.TIME_HH_MM_SS or TLptsTimeUtil.TIME_HH_MM.

getVisibility

public int getVisibility()
Gets the visibility options of the logs.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : N/A

Notes : To check what type of messages are going to be displayed in the log table.

Example :

 

if ((logaPanel.getVisibility() & TLptsViewLogPanel.VISIBLE_ERROR) > 0) System.out.println("We can see Error type logs in this dialog.");

Returns:
the visibility of the logs.

localeHasChanged

public void localeHasChanged(java.lang.String language,
                             java.lang.String country)
Implementation of the ILptsCharSetLocaleListener.

Specified by:
localeHasChanged in interface ILptsCharSetLocaleListener
Parameters:
language - The language code of the newly set locale.
country - The country code of the newly set locale.

newLogGenerated

public void newLogGenerated(TLptsLog log)
Implements the ILptsLogListener.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : No

Notes : This updates the display of the logs in the dialog.

Example :

 

Specified by:
newLogGenerated in interface ILptsLogListener
Parameters:
log - the TLptsLog Generated

setDateTimeFormat

public void setDateTimeFormat(boolean dateFormat,
                              java.lang.String hourFormat)
sets the date and time formats.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : No

Notes : This method automatically refreshes the log table.

Example :

 

Parameters:
dateFormat - set true for "dd-MM-yy" false for "MM-dd-yy ".
hourFormat - values are TLptsTimeUtil.TIME_HH_MM_SS_SSS, TLptsTimeUtil.TIME_HH_MM_SS, TLptsTimeUtil.TIME_HH_MM.

setParentFrame

public void setParentFrame(javax.swing.JFrame frame)
Sets the parent frame and takes care of closing the log file.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : N/A

Notes : After calling this function, the #closeLogFile is automatically called on closing.

Example :

 

Parameters:
frame -

setVisibility

public void setVisibility(int visibility)
Set the visibility of the logs.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : No

Notes : Set what type of messages are going to be displayed in the log table.

Example :

 

logaPanel.setVisibility(TLptsViewLogPanel.VISIBLE_ERROR);

Parameters:
visibility - is the parameter to be visible the logs.


Copyright 2009,2010, Lapetus Systems Ltd. (All rights reserved)