Class LogBrokerMonitor


  • public class LogBrokerMonitor
    extends Object
    LogBrokerMonitor .
    Author:
    Michael J. Sikorsky, Robert Shaw, Brad Marlborough, Richard Wan, Brent Sprecher, Richard Hurst
    • Field Detail

      • _logMonitorFrame

        protected JFrame _logMonitorFrame
      • _logMonitorFrameWidth

        protected int _logMonitorFrameWidth
      • _logMonitorFrameHeight

        protected int _logMonitorFrameHeight
      • _searchText

        protected String _searchText
      • _NDCTextFilter

        protected String _NDCTextFilter
      • _leastSevereDisplayedLogLevel

        protected LogLevel _leastSevereDisplayedLogLevel
      • _logTableScrollPane

        protected JScrollPane _logTableScrollPane
      • _statusLabel

        protected JLabel _statusLabel
      • _lock

        protected Object _lock
      • _fontSizeCombo

        protected JComboBox _fontSizeCombo
      • _fontSize

        protected int _fontSize
      • _fontName

        protected String _fontName
      • _currentView

        protected String _currentView
      • _loadSystemFonts

        protected boolean _loadSystemFonts
      • _trackTableScrollPane

        protected boolean _trackTableScrollPane
      • _lastTableViewportSize

        protected Dimension _lastTableViewportSize
      • _callSystemExitOnClose

        protected boolean _callSystemExitOnClose
      • _displayedLogBrokerProperties

        protected List _displayedLogBrokerProperties
      • _logLevelMenuItems

        protected Map _logLevelMenuItems
      • _logTableColumnMenuItems

        protected Map _logTableColumnMenuItems
      • _levels

        protected List _levels
      • _columns

        protected List _columns
      • _isDisposed

        protected boolean _isDisposed
      • _fileLocation

        protected File _fileLocation
    • Constructor Detail

      • LogBrokerMonitor

        public LogBrokerMonitor​(List logLevels)
        Construct a LogBrokerMonitor.
    • Method Detail

      • show

        public void show​(int delay)
        Show the frame for the LogBrokerMonitor. Dispatched to the swing thread.
      • show

        public void show()
      • dispose

        public void dispose()
        Dispose of the frame for the LogBrokerMonitor.
      • hide

        public void hide()
        Hide the frame for the LogBrokerMonitor.
      • getDateFormatManager

        public DateFormatManager getDateFormatManager()
        Get the DateFormatManager for formatting dates.
      • setDateFormatManager

        public void setDateFormatManager​(DateFormatManager dfm)
        Set the date format manager for formatting dates.
      • getCallSystemExitOnClose

        public boolean getCallSystemExitOnClose()
        Get the value of whether or not System.exit() will be called when the LogBrokerMonitor is closed.
      • setCallSystemExitOnClose

        public void setCallSystemExitOnClose​(boolean callSystemExitOnClose)
        Set the value of whether or not System.exit() will be called when the LogBrokerMonitor is closed.
      • addMessage

        public void addMessage​(LogRecord lr)
        Add a log record message to be displayed in the LogTable. This method is thread-safe as it posts requests to the SwingThread rather than processing directly.
      • setMaxNumberOfLogRecords

        public void setMaxNumberOfLogRecords​(int maxNumberOfLogRecords)
      • getBaseFrame

        public JFrame getBaseFrame()
      • setTitle

        public void setTitle​(String title)
      • setFrameSize

        public void setFrameSize​(int width,
                                 int height)
      • setFontSize

        public void setFontSize​(int fontSize)
      • addDisplayedProperty

        public void addDisplayedProperty​(Object messageLine)
      • getLogLevelMenuItems

        public Map getLogLevelMenuItems()
      • getLogTableColumnMenuItems

        public Map getLogTableColumnMenuItems()
      • getNDCTextFilter

        public String getNDCTextFilter()
      • setNDCLogRecordFilter

        public void setNDCLogRecordFilter​(String textFilter)
      • setSearchText

        protected void setSearchText​(String text)
      • setNDCTextFilter

        protected void setNDCTextFilter​(String text)
      • sortByNDC

        protected void sortByNDC()
      • findSearchText

        protected void findSearchText()
      • getFirstSelectedRow

        protected int getFirstSelectedRow()
      • selectRow

        protected void selectRow​(int foundRow)
      • findRecord

        protected int findRecord​(int startRow,
                                 String searchText,
                                 List records)
      • matches

        protected boolean matches​(LogRecord record,
                                  String text)
        Check to see if the any records contain the search string. Searching now supports NDC messages and date.
      • refresh

        protected void refresh​(JTextArea textArea)
        When the fontsize of a JTextArea is changed, the word-wrapped lines may become garbled. This method clears and resets the text of the text area.
      • refreshDetailTextArea

        protected void refreshDetailTextArea()
      • clearDetailTextArea

        protected void clearDetailTextArea()
      • changeFontSizeCombo

        protected int changeFontSizeCombo​(JComboBox box,
                                          int requestedSize)
        Changes the font selection in the combo box and returns the size actually selected.
        Returns:
        -1 if unable to select an appropriate font
      • setFontSizeSilently

        protected void setFontSizeSilently​(int fontSize)
        Does not update gui or cause any events to be fired.
      • setFontSize

        protected void setFontSize​(Component component,
                                   int fontSize)
      • updateFrameSize

        protected void updateFrameSize()
      • pause

        protected void pause​(int millis)
      • initComponents

        protected void initComponents()
      • createLogRecordFilter

        protected LogRecordFilter createLogRecordFilter()
      • updateStatusLabel

        protected void updateStatusLabel()
      • getRecordsDisplayedMessage

        protected String getRecordsDisplayedMessage()
      • addTableModelProperties

        protected void addTableModelProperties()
      • getStatusText

        protected String getStatusText​(int displayedRows,
                                       int totalRows)
      • makeLogTableListenToCategoryExplorer

        protected void makeLogTableListenToCategoryExplorer()
      • createStatusArea

        protected JPanel createStatusArea()
      • createDetailTextArea

        protected JTextArea createDetailTextArea()
      • createMenuBar

        protected JMenuBar createMenuBar()
      • createLogLevelMenu

        protected JMenu createLogLevelMenu()
      • createAllLogLevelsMenuItem

        protected JMenuItem createAllLogLevelsMenuItem()
      • createNoLogLevelsMenuItem

        protected JMenuItem createNoLogLevelsMenuItem()
      • createLogLevelColorMenu

        protected JMenu createLogLevelColorMenu()
      • createResetLogLevelColorMenuItem

        protected JMenuItem createResetLogLevelColorMenuItem()
      • selectAllLogLevels

        protected void selectAllLogLevels​(boolean selected)
      • showLogLevelColorChangeDialog

        protected void showLogLevelColorChangeDialog​(JMenuItem result,
                                                     LogLevel level)
      • createViewMenu

        protected JMenu createViewMenu()
      • updateView

        protected List updateView()
      • createAllLogTableColumnsMenuItem

        protected JMenuItem createAllLogTableColumnsMenuItem()
      • createNoLogTableColumnsMenuItem

        protected JMenuItem createNoLogTableColumnsMenuItem()
      • selectAllLogTableColumns

        protected void selectAllLogTableColumns​(boolean selected)
      • createFileMenu

        protected JMenu createFileMenu()
      • createOpenMI

        protected JMenuItem createOpenMI()
        Menu item added to allow log files to be opened with the LF5 GUI.
      • createOpenURLMI

        protected JMenuItem createOpenURLMI()
        Menu item added to allow log files loaded from a URL to be opened by the LF5 GUI.
      • createCloseMI

        protected JMenuItem createCloseMI()
      • createMRUFileListMI

        protected void createMRUFileListMI​(JMenu menu)
        Creates a Most Recently Used file list to be displayed in the File menu
      • createExitMI

        protected JMenuItem createExitMI()
      • createConfigureMenu

        protected JMenu createConfigureMenu()
      • createConfigureSave

        protected JMenuItem createConfigureSave()
      • createConfigureReset

        protected JMenuItem createConfigureReset()
      • createConfigureMaxRecords

        protected JMenuItem createConfigureMaxRecords()
      • saveConfiguration

        protected void saveConfiguration()
      • resetConfiguration

        protected void resetConfiguration()
      • setMaxRecordConfiguration

        protected void setMaxRecordConfiguration()
      • createHelpMenu

        protected JMenu createHelpMenu()
      • createHelpProperties

        protected JMenuItem createHelpProperties()
      • showPropertiesDialog

        protected void showPropertiesDialog​(String title)
      • createEditMenu

        protected JMenu createEditMenu()
      • createEditFindNextMI

        protected JMenuItem createEditFindNextMI()
      • createEditFindMI

        protected JMenuItem createEditFindMI()
      • createEditSortNDCMI

        protected JMenuItem createEditSortNDCMI()
      • createEditRestoreAllNDCMI

        protected JMenuItem createEditRestoreAllNDCMI()
      • createToolBar

        protected JToolBar createToolBar()
      • setView

        protected void setView​(String viewString,
                               LogTable table)
      • createLogLevelCombo

        protected JComboBox createLogLevelCombo()
      • setLeastSevereDisplayedLogLevel

        protected void setLeastSevereDisplayedLogLevel​(LogLevel level)
      • trackTableScrollPane

        protected void trackTableScrollPane()
        Deprecated.
        tracking is now done automatically.
        Ensures that the Table's ScrollPane Viewport will "track" with updates to the Table. When the vertical scroll bar is at its bottom anchor and tracking is enabled then viewport will stay at the bottom most point of the component. The purpose of this feature is to allow a developer to watch the table as messages arrive and not have to scroll after each new message arrives. When the vertical scroll bar is at any other location, then no tracking will happen.
      • centerFrame

        protected void centerFrame​(JFrame frame)
      • requestOpen

        protected void requestOpen()
        Uses a JFileChooser to select a file to opened with the LF5 GUI.
      • requestOpenURL

        protected void requestOpenURL()
        Uses a Dialog box to accept a URL to a file to be opened with the LF5 GUI.
      • updateMRUList

        protected void updateMRUList()
        Removes old file list and creates a new file list with the updated MRU list.
      • requestClose

        protected void requestClose()
      • requestOpenMRU

        protected void requestOpenMRU​(ActionEvent e)
        Opens a file in the MRU list.
      • requestExit

        protected void requestExit()
      • closeAfterConfirm

        protected void closeAfterConfirm()
      • getLogLevels

        protected Iterator getLogLevels()
      • getLogTableColumns

        protected Iterator getLogTableColumns()
      • loadLogFile

        protected boolean loadLogFile​(File file)
        Loads and parses a log file.
      • loadLogFile

        protected boolean loadLogFile​(URL url)
        Loads a parses a log file running on a server.