Class LogTextFrame

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--LogTextFrame
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.awt.event.WindowListener

class LogTextFrame
extends java.awt.Frame
implements java.awt.event.ActionListener, java.awt.event.WindowListener

LogTextFrame() - simple text area frame with control buttons Derived from TextFrame.java written by Bob Stephens, ABCC,FCRDC

See Also:
Serialized Form

Inner classes inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Inner classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock
 
Field Summary
(package private)  boolean appendLogDataFlag
          Flag indicating that data is to be appended text area.
(package private)  java.awt.TextArea area
          Text area for displaying the text
(package private)  java.awt.Font button_font
          control button font
(package private)  java.awt.Color buttonBkGrdColor
          background color of buttons
(package private)  java.awt.Button clearButton
          clear button to clear the log and clear the log file is using a file
(package private)  java.awt.GridBagConstraints constraints
          grid bag constraints
(package private)  java.awt.Font default_font
          default font
(package private)  java.awt.Color frameBkGrdColor
          Background color of entire frame
(package private)  java.lang.String fullLogFilePath
          optional full path of log file if it exists.
(package private)  java.awt.Button hideButton
          hide button to hide the Log window.
(package private)  boolean isVisibleFlag
          Visibility flag
(package private)  java.awt.GridBagLayout layout
          GUI layout
private  char[] logDataBuf
          standalone log file data buff
private  int logDataBufSize
          size of standalone log file data buff
(package private)  java.io.File logFile
          optional log file if logging
(package private)  java.lang.String logFileName
          optional log file "maeHistory.log"
(package private)  java.io.FileWriter logFileWriter
          standalone log file writer
(package private)  java.lang.String logTextStr
          text to be written to text area
(package private)  java.awt.Button saveAsButton
          Save Log As button to save the log data as a new named Report/XXXX.txt file
(package private)  java.awt.Font text_font
          text font in TextArea
(package private)  java.awt.Color textBkGrdColor
          background color of text area
(package private)  java.lang.String title
          text to beas popup window title
 
Fields inherited from class java.awt.Frame
base, CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, frameSerializedDataVersion, HAND_CURSOR, icon, ICONIFIED, mbManagement, menuBar, MOVE_CURSOR, N_RESIZE_CURSOR, nameCounter, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, ownedWindows, resizable, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, serialVersionUID, state, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR, weakThis
 
Fields inherited from class java.awt.Window
active, dbg, focusMgr, inputContext, inputContextLock, OPENED, ownedWindowList, showWithParent, warningString, windowListener, windowSerializedDataVersion
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, dispatcher, layoutMgr, listeningBoundsChildren, listeningChildren, maxSize, ncomponents, printing, printingThreads
 
Fields inherited from class java.awt.Component
accessibleContext, actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
(package private) LogTextFrame(java.lang.String title, java.lang.String fullLogFilePath, java.lang.String logFileName, boolean appendLogDataFlag, boolean isVisibleFlag, int optOffset)
          LogTextFrame() - constructor to create popup logging text window
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          actionPerformed() - event handler for button press
private  void addComponent(java.awt.Component obj, int x, int y, int xw, int yw, int xg, int yg)
          addComponent() - add a text component to the frame
(package private)  void appendLog(java.lang.String text)
          appendLog() - save text into log area.
(package private)  void appendLogLn(java.lang.String text)
          appendLogLn() - save text+"\n" into log area.
(package private)  boolean appendToLogFile(java.lang.String text)
          appendToLogFile() - append text to open log file
(package private)  void clearLog()
          clearLog() - clear the log area and delete old log file.
(package private)  void hideWindow()
          hideWindow() - flush the buffer and hide the log window
(package private)  boolean saveAsTxtFile()
          saveAsTxtFile() - save logTextStr data in .txt file logFileName
(package private)  void setLogWindowVisible(boolean isVisibleFlag)
          setLogWindowVisible() - make the popup window visible or invisible
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
          windowClosing() - close the log window
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 
Methods inherited from class java.awt.Frame
, addNotify, addToFrameList, constructComponentName, finalize, getAccessibleContext, getCursorType, getFrames, getIconImage, getMenuBar, getState, getTitle, initIDs, isResizable, paramString, postProcessKeyEvent, readObject, remove, removeFromFrameList, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setState, setTitle, writeObject
 
Methods inherited from class java.awt.Window
addOwnedWindow, addWindowListener, adjustListeningChildren, applyResourceBundle, applyResourceBundle, connectOwnedWindow, dispatchEventImpl, dispose, eventEnabled, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isActive, isShowing, nextFocus, ownedInit, pack, postEvent, postWindowEvent, preProcessKeyEvent, processEvent, processWindowEvent, removeOwnedWindow, removeWindowListener, resetGC, setCursor, setFocusOwner, setWarningString, show, toBack, toFront, transferFocus
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventToSelf, doLayout, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, numListening, paint, paintComponents, paintHeavyweightComponents, postsOldMouseEvents, preferredSize, print, printComponents, printHeavyweightComponents, processContainerEvent, proxyEnableEvents, proxyRequestFocus, remove, remove, removeAll, removeContainerListener, setFont, setLayout, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

frameBkGrdColor

java.awt.Color frameBkGrdColor
Background color of entire frame

textBkGrdColor

java.awt.Color textBkGrdColor
background color of text area

buttonBkGrdColor

java.awt.Color buttonBkGrdColor
background color of buttons

area

java.awt.TextArea area
Text area for displaying the text

hideButton

java.awt.Button hideButton
hide button to hide the Log window. You need to issue a command from the MAExplorer menu to get it back).

saveAsButton

java.awt.Button saveAsButton
Save Log As button to save the log data as a new named Report/XXXX.txt file

clearButton

java.awt.Button clearButton
clear button to clear the log and clear the log file is using a file

layout

java.awt.GridBagLayout layout
GUI layout

constraints

java.awt.GridBagConstraints constraints
grid bag constraints

default_font

java.awt.Font default_font
default font

button_font

java.awt.Font button_font
control button font

text_font

java.awt.Font text_font
text font in TextArea

title

java.lang.String title
text to beas popup window title

logTextStr

java.lang.String logTextStr
text to be written to text area

appendLogDataFlag

boolean appendLogDataFlag
Flag indicating that data is to be appended text area. If it is not being appended to text area, it is at least appended to the logTextStr.

isVisibleFlag

boolean isVisibleFlag
Visibility flag

logFile

java.io.File logFile
optional log file if logging

logFileName

java.lang.String logFileName
optional log file "maeHistory.log"

fullLogFilePath

java.lang.String fullLogFilePath
optional full path of log file if it exists.

logFileWriter

java.io.FileWriter logFileWriter
standalone log file writer

logDataBuf

private char[] logDataBuf
standalone log file data buff

logDataBufSize

private int logDataBufSize
size of standalone log file data buff
Constructor Detail

LogTextFrame

LogTextFrame(java.lang.String title,
             java.lang.String fullLogFilePath,
             java.lang.String logFileName,
             boolean appendLogDataFlag,
             boolean isVisibleFlag,
             int optOffset)
LogTextFrame() - constructor to create popup logging text window
Parameters:
title - of window
fullLogFilePath - file path to save file
logFileName - name of log file
appendLogDataFlag - determines if new file or append to old file
isVisibleFlag - if visible when created
optOffset -  
See Also:
Component.repaint()
Method Detail

saveAsTxtFile

boolean saveAsTxtFile()
saveAsTxtFile() - save logTextStr data in .txt file logFileName
Returns:
true if succeed
See Also:
EventMenu.promptFileName(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean, boolean), FileIO.writeFileToDisk(java.lang.String, java.lang.String), Util.dateStr(), Util.showMsg(java.lang.String)

addComponent

private void addComponent(java.awt.Component obj,
                          int x,
                          int y,
                          int xw,
                          int yw,
                          int xg,
                          int yg)
addComponent() - add a text component to the frame

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed() - event handler for button press
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - is button press event
See Also:
hideWindow(), saveAsTxtFile()

setLogWindowVisible

void setLogWindowVisible(boolean isVisibleFlag)
setLogWindowVisible() - make the popup window visible or invisible
Parameters:
isVisibleFlag - to set whether the window is visible or not
See Also:
Component.repaint()

appendLog

void appendLog(java.lang.String text)
appendLog() - save text into log area.
Parameters:
text - to append to log

appendLogLn

void appendLogLn(java.lang.String text)
appendLogLn() - save text+"\n" into log area.
Parameters:
text - to append to log
See Also:
appendLog(java.lang.String)

appendToLogFile

boolean appendToLogFile(java.lang.String text)
appendToLogFile() - append text to open log file
Parameters:
text - to append to log
Returns:
true if succeed

clearLog

void clearLog()
clearLog() - clear the log area and delete old log file.

hideWindow

void hideWindow()
hideWindow() - flush the buffer and hide the log window

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
windowClosing() - close the log window
Specified by:
windowClosing in interface java.awt.event.WindowListener
Parameters:
e - is window closing event
See Also:
hideWindow()

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Specified by:
windowClosed in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Specified by:
windowIconified in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Specified by:
windowOpened in interface java.awt.event.WindowListener