Package adams.gui.tools
Class ConsoleOutputAnalyzerPanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- adams.gui.core.BasePanel
-
- adams.gui.tools.ConsoleOutputAnalyzerPanel
-
- All Implemented Interfaces:
MenuBarProvider
,SendToActionSupporter
,ImageObserver
,MenuContainer
,Serializable
,Accessible
public class ConsoleOutputAnalyzerPanel extends BasePanel implements MenuBarProvider, SendToActionSupporter
Frontend for analyzing theConsoleWindow
's output.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ConsoleOutputAnalyzerPanel.ConsoleEntryFilter
For filtering the console output.static class
ConsoleOutputAnalyzerPanel.ConsoleOutput
Class for encapsulating a complete console output.static class
ConsoleOutputAnalyzerPanel.ConsoleOutputEntry
Represents a single line from the console output.-
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
-
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
-
Field Summary
Fields Modifier and Type Field Description protected BaseButton
m_ButtonClearSearch
the button for clearing the search.protected BaseButton
m_ButtonSearch
the button for triggering the search.protected BaseComboBox
m_ComboBoxOrigin
the combobox with all origins.protected BaseComboBox
m_ComboBoxType
the combobox with the types.protected String
m_CurrentEncoding
the current file encoding.protected File
m_CurrentFile
the file the console output was loaded from.protected TextFileChooser
m_FileChooser
the filechooser for loading the files.protected ConsoleOutputAnalyzerPanel.ConsoleOutput
m_Filtered
the filtered console output.protected JMenuBar
m_MenuBar
the menu bar, if used.protected JMenu
m_MenuFileLoadRecent
the "load recent" submenu.protected JMenuItem
m_MenuFileReload
the "reload" menu item.protected ConsoleOutputAnalyzerPanel.ConsoleOutput
m_Original
the original console output.protected ParameterPanel
m_PanelSearch
the panel with the search parameters.protected RecentFilesWithEncodingHandler<JMenu>
m_RecentFilesHandler
the recent files handler.protected BaseSplitPane
m_SplitPane
the split pane to use.protected SpreadSheetTable
m_Table
the table for displaying the output.protected SpreadSheetTableModel
m_TableModel
the table model.protected BaseTextField
m_TextOrigin
the regexp for the origin.protected BaseTextField
m_TextOutput
the regexp for the output.protected TitleGenerator
m_TitleGenerator
for generating the title of the dialog/frame.static String
SESSION_FILE
the file to store the recent directories.-
Fields inherited from class javax.swing.JComponent
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
accessibleContext, 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
Constructors Constructor Description ConsoleOutputAnalyzerPanel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List
addFirstElement(List list, Object first)
Adds the specified object at the head of the list (if not already present) and returns the updated list.protected void
clearSearch(boolean update)
Resets the search fields.protected BasePopupMenu
createCellPopup(MouseEvent e)
Returns a popup menu for the table.protected TextFileChooser
getFileChooser()
Returns the filechooser for opening the files.protected ConsoleOutputAnalyzerPanel.ConsoleEntryFilter
getFilter()
Returns the filter based on the current search parameters.JMenuBar
getMenuBar()
Creates a menu bar (singleton per panel object).Class[]
getSendToClasses()
Returns the classes that the supporter generates.Object
getSendToItem(Class[] cls)
Returns the object to send.boolean
hasSendToItem(Class[] cls)
Checks whether something to send is available.protected void
initGUI()
For initializing the GUI.protected void
initialize()
For initializing members.protected void
open()
Opens a dialog for the user to choose a file containing console output.void
open(File file)
Opens the specified file with the console output, using UTF-8.void
open(File file, String encoding)
Opens the specified file with the console output.protected void
reload()
Reloads the console output from the current file.protected void
search()
Performs the search.protected void
update()
Updating the GUI.protected void
updateMenu()
Updates the menu.protected void
useCurrentOutput()
Uses the currently displayed output.-
Methods inherited from class adams.gui.core.BasePanel
afterHide, afterShow, beforeHide, beforeShow, closeParent, finishInit, getParentChild, getParentDialog, getParentFrame, getParentInternalFrame, getParentTitle, initFileChooser, main, printErrorMessage, printException, saveComponent, setEnabledCascade, setEnabledCascade, setParentTitle, setVisible
-
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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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, 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, 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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
SESSION_FILE
public static final String SESSION_FILE
the file to store the recent directories.- See Also:
- Constant Field Values
-
m_SplitPane
protected BaseSplitPane m_SplitPane
the split pane to use.
-
m_FileChooser
protected transient TextFileChooser m_FileChooser
the filechooser for loading the files.
-
m_TextOrigin
protected BaseTextField m_TextOrigin
the regexp for the origin.
-
m_ComboBoxOrigin
protected BaseComboBox m_ComboBoxOrigin
the combobox with all origins.
-
m_ComboBoxType
protected BaseComboBox m_ComboBoxType
the combobox with the types.
-
m_TextOutput
protected BaseTextField m_TextOutput
the regexp for the output.
-
m_PanelSearch
protected ParameterPanel m_PanelSearch
the panel with the search parameters.
-
m_ButtonSearch
protected BaseButton m_ButtonSearch
the button for triggering the search.
-
m_ButtonClearSearch
protected BaseButton m_ButtonClearSearch
the button for clearing the search.
-
m_Table
protected SpreadSheetTable m_Table
the table for displaying the output.
-
m_TableModel
protected SpreadSheetTableModel m_TableModel
the table model.
-
m_Original
protected ConsoleOutputAnalyzerPanel.ConsoleOutput m_Original
the original console output.
-
m_CurrentFile
protected File m_CurrentFile
the file the console output was loaded from.
-
m_CurrentEncoding
protected String m_CurrentEncoding
the current file encoding.
-
m_Filtered
protected ConsoleOutputAnalyzerPanel.ConsoleOutput m_Filtered
the filtered console output.
-
m_RecentFilesHandler
protected RecentFilesWithEncodingHandler<JMenu> m_RecentFilesHandler
the recent files handler.
-
m_MenuBar
protected JMenuBar m_MenuBar
the menu bar, if used.
-
m_MenuFileLoadRecent
protected JMenu m_MenuFileLoadRecent
the "load recent" submenu.
-
m_MenuFileReload
protected JMenuItem m_MenuFileReload
the "reload" menu item.
-
m_TitleGenerator
protected TitleGenerator m_TitleGenerator
for generating the title of the dialog/frame.
-
-
Method Detail
-
initialize
protected void initialize()
For initializing members.- Overrides:
initialize
in classBasePanel
-
createCellPopup
protected BasePopupMenu createCellPopup(MouseEvent e)
Returns a popup menu for the table.- Parameters:
e
- the event that triggered the call- Returns:
- the popup menu, null if not applicable
-
getFileChooser
protected TextFileChooser getFileChooser()
Returns the filechooser for opening the files.- Returns:
- the filechooser
-
getFilter
protected ConsoleOutputAnalyzerPanel.ConsoleEntryFilter getFilter()
Returns the filter based on the current search parameters.- Returns:
- the filter
-
clearSearch
protected void clearSearch(boolean update)
Resets the search fields.- Parameters:
update
- whether to update the display
-
search
protected void search()
Performs the search.
-
updateMenu
protected void updateMenu()
Updates the menu.
-
getMenuBar
public JMenuBar getMenuBar()
Creates a menu bar (singleton per panel object). Can be used in frames.- Specified by:
getMenuBar
in interfaceMenuBarProvider
- Returns:
- the menu bar
-
open
protected void open()
Opens a dialog for the user to choose a file containing console output.
-
open
public void open(File file)
Opens the specified file with the console output, using UTF-8.- Parameters:
file
- the file to load
-
open
public void open(File file, String encoding)
Opens the specified file with the console output.- Parameters:
file
- the file to loadencoding
- the encoding to use, null for default UTF-8
-
reload
protected void reload()
Reloads the console output from the current file.
-
useCurrentOutput
protected void useCurrentOutput()
Uses the currently displayed output.
-
addFirstElement
protected List addFirstElement(List list, Object first)
Adds the specified object at the head of the list (if not already present) and returns the updated list.- Parameters:
list
- the list to updatefirst
- the element to insert- Returns:
- the (potentially) updated list
-
update
protected void update()
Updating the GUI.
-
getSendToClasses
public Class[] getSendToClasses()
Returns the classes that the supporter generates.- Specified by:
getSendToClasses
in interfaceSendToActionSupporter
- Returns:
- the classes
-
hasSendToItem
public boolean hasSendToItem(Class[] cls)
Checks whether something to send is available.- Specified by:
hasSendToItem
in interfaceSendToActionSupporter
- Parameters:
cls
- the classes to retrieve an item for- Returns:
- true if an object is available for sending
-
getSendToItem
public Object getSendToItem(Class[] cls)
Returns the object to send.- Specified by:
getSendToItem
in interfaceSendToActionSupporter
- Parameters:
cls
- the classes to retrieve an item for- Returns:
- the item to send, null if nothing available at the moment
-
-