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 classConsoleOutputAnalyzerPanel.ConsoleEntryFilterFor filtering the console output.static classConsoleOutputAnalyzerPanel.ConsoleOutputClass for encapsulating a complete console output.static classConsoleOutputAnalyzerPanel.ConsoleOutputEntryRepresents 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 BaseButtonm_ButtonClearSearchthe button for clearing the search.protected BaseButtonm_ButtonSearchthe button for triggering the search.protected BaseComboBoxm_ComboBoxOriginthe combobox with all origins.protected BaseComboBoxm_ComboBoxTypethe combobox with the types.protected Stringm_CurrentEncodingthe current file encoding.protected Filem_CurrentFilethe file the console output was loaded from.protected TextFileChooserm_FileChooserthe filechooser for loading the files.protected ConsoleOutputAnalyzerPanel.ConsoleOutputm_Filteredthe filtered console output.protected JMenuBarm_MenuBarthe menu bar, if used.protected JMenum_MenuFileLoadRecentthe "load recent" submenu.protected JMenuItemm_MenuFileReloadthe "reload" menu item.protected ConsoleOutputAnalyzerPanel.ConsoleOutputm_Originalthe original console output.protected ParameterPanelm_PanelSearchthe panel with the search parameters.protected RecentFilesWithEncodingHandler<JMenu>m_RecentFilesHandlerthe recent files handler.protected BaseSplitPanem_SplitPanethe split pane to use.protected SpreadSheetTablem_Tablethe table for displaying the output.protected SpreadSheetTableModelm_TableModelthe table model.protected BaseTextFieldm_TextOriginthe regexp for the origin.protected BaseTextFieldm_TextOutputthe regexp for the output.protected TitleGeneratorm_TitleGeneratorfor generating the title of the dialog/frame.static StringSESSION_FILEthe 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 ListaddFirstElement(List list, Object first)Adds the specified object at the head of the list (if not already present) and returns the updated list.protected voidclearSearch(boolean update)Resets the search fields.protected BasePopupMenucreateCellPopup(MouseEvent e)Returns a popup menu for the table.protected TextFileChoosergetFileChooser()Returns the filechooser for opening the files.protected ConsoleOutputAnalyzerPanel.ConsoleEntryFiltergetFilter()Returns the filter based on the current search parameters.JMenuBargetMenuBar()Creates a menu bar (singleton per panel object).Class[]getSendToClasses()Returns the classes that the supporter generates.ObjectgetSendToItem(Class[] cls)Returns the object to send.booleanhasSendToItem(Class[] cls)Checks whether something to send is available.protected voidinitGUI()For initializing the GUI.protected voidinitialize()For initializing members.protected voidopen()Opens a dialog for the user to choose a file containing console output.voidopen(File file)Opens the specified file with the console output, using UTF-8.voidopen(File file, String encoding)Opens the specified file with the console output.protected voidreload()Reloads the console output from the current file.protected voidsearch()Performs the search.protected voidupdate()Updating the GUI.protected voidupdateMenu()Updates the menu.protected voiduseCurrentOutput()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:
initializein 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:
getMenuBarin 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:
getSendToClassesin interfaceSendToActionSupporter- Returns:
- the classes
-
hasSendToItem
public boolean hasSendToItem(Class[] cls)
Checks whether something to send is available.- Specified by:
hasSendToItemin 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:
getSendToItemin interfaceSendToActionSupporter- Parameters:
cls- the classes to retrieve an item for- Returns:
- the item to send, null if nothing available at the moment
-
-