Package jmri.jmrix
Class AbstractMonPane
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
jmri.util.swing.JmriPanel
jmri.jmrix.AbstractMonPane
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Accessible
- Direct Known Subclasses:
BiDiBMonPane,Dcc4PcMonPane,EcosMonPane,IEEE802154MonPane,JMRIClientMonPane,LocoMonPane,MarklinMonPane,MonitorPane,MonitorPane,MrcMonPanel,Mx1MonPanel,NceMonPanel,NcePacketMonitorPanel,SerialMonPane,SerialMonPane,SRCPMonPane,TamsMonPane,XNetMonPane,XpaMonPane,Z21MonPane
Abstract base class for JPanels displaying communications monitor
information.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescription(package private) Stringprotected JCheckBox(package private) Stringprotected JCheckBoxprotected JButtonprotected JButtonprotected JButtonprotected JTextFieldprotected JTextField(package private) Stringprotected JLabelprotected JToggleButtonprotected JScrollPaneprotected StringBuffer(package private) final JFileChooserprotected TextAreaFIFOprotected JButtonprotected JCheckBox(package private) Stringprotected JToggleButtonprotected JButtonprotected JCheckBox(package private) StringFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddCustomControlPanes(JPanel parent) Expand the display with additional options specific to the hardware.protected voidPut data pane(s) in the GUI.voidprotected voidconfigureDataPane(TextAreaFIFO textPane) Do default configuration of a data pane.voidprotected voidBy default, create just one place (one data pane) to put trace data.voiddispose()voidProvide a help target string which an enclosing frame can provide as a help reference.protected intProvide initial number of lines to display Used to size the initial GUI.protected intProvide initial preferred line length.protected StringgetOpCodeForFilter(String raw) Get hex opcode for filtering.final JTextAreaGet access to the main text area.abstract StringgetTitle()Provide a recommended title for an enclosing frame.protected abstract voidinit()Initialize the data source.void2nd stage of initialization, invoked after the constructor is complete.protected booleanisFiltered(String raw) Default filtering implementation, more of an example than anything else, not clear it really works for any system.voidlogMessage(String messagePrefix, String rawPrefix, Message message) Log an Message derived message with a prefixed label.voidlogMessage(String messagePrefix, Message message) Log an Message derived message.voidlogMessage(Message message) Log an Message derived message.voidvoidnextLineWithTime(Date timestamp, String line, String raw) Handle display of traffic.voidvoidsetFilterText(String text) voidSet the display window to fixed width font, so that e.g. columns line up.voidvoidMethods inherited from class jmri.util.swing.JmriPanel
getMenus, getMinimumDimension, getWindowInterface, initContext, isMultipleInstances, setWindowInterfaceMethods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods 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, setVisible, unregisterKeyboardAction, updateMethods 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, validateTreeMethods 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 Details
-
copyToClipBoardButton
-
clearButton
-
freezeButton
-
jScrollPane1
-
monTextPane
-
startLogButton
-
stopLogButton
-
rawCheckBox
-
timeCheckBox
-
alwaysOnTopCheckBox
-
autoScrollCheckBox
-
filterField
-
filterLabel
-
openFileChooserButton
-
entryField
-
enterButton
-
rawDataCheck
-
timeStampCheck
-
alwaysOnTopCheck
-
autoScrollCheck
-
filterFieldCheck
-
logFileChooser
-
linesBuffer
-
-
Constructor Details
-
AbstractMonPane
public AbstractMonPane()
-
-
Method Details
-
getTitle
Provide a recommended title for an enclosing frame. -
init
Initialize the data source.This is invoked at the end of the GUI initialization phase. Subclass implementations should connect to their data source here.
-
dispose
-
createDataPanes
By default, create just one place (one data pane) to put trace data. -
configureDataPane
Do default configuration of a data pane.- Parameters:
textPane- a TextAreaFIFO into which the data pane will be placed
-
getInitialPreferredLineLength
Provide initial preferred line length. Used to size the initial GUI.- Returns:
- preferred initial number of columns
-
getInitialPreferredLineCount
Provide initial number of lines to display Used to size the initial GUI.- Returns:
- preferred initial number of rows
-
addDataPanes
Put data pane(s) in the GUI. -
initComponents
2nd stage of initialization, invoked after the constructor is complete.- Overrides:
initComponentsin classJmriPanel
-
addCustomControlPanes
Expand the display with additional options specific to the hardware.- Parameters:
parent- a Panel (with vertical BoxLayout); overrides should add a new Panel with horizontal BoxLayout to hold the additional options.
-
setFixedWidthFont
Set the display window to fixed width font, so that e.g. columns line up. -
getHelpTarget
Provide a help target string which an enclosing frame can provide as a help reference.This automatically provides a reference to the usual place for JMRI window-specific help pages that are named for the implementing class, but note this is a Pane class, not a Frame class.
- Overrides:
getHelpTargetin classJmriPanel- Returns:
- the target String
-
logMessage
Log an Message derived message.- Parameters:
message- message object to log.
-
logMessage
Log an Message derived message.- Parameters:
messagePrefix- text to prefix the message with.message- message object to log.
-
logMessage
Log an Message derived message with a prefixed label.- Parameters:
messagePrefix- text to prefix the message with.rawPrefix- label to add to the start of the message.message- message object to log.
-
nextLine
-
nextLineWithTime
Handle display of traffic.- Parameters:
timestamp- timestamp to be pre-pended to the output line (if timestamping is enabled)line- The traffic in normal parsed form, ending with \nraw- The traffic in raw form, ending with \n
-
isFiltered
Default filtering implementation, more of an example than anything else, not clear it really works for any system. Override this in system-specific subclasses to do something useful.- Parameters:
raw- A string containing the raw message hex information, in ASCII encoding, with some "header" information pre-pended.- Returns:
- True if the opcode in the raw message matches one of the "filter" opcodes. False if the opcode does not match any of the "filter" opcodes.
-
getOpCodeForFilter
Get hex opcode for filtering.Reports the "opcode" byte from the string containing the ASCII string representation of the message. Assumes that there is a generic header on string, like "Tx - ", and ignores it.
- Parameters:
raw- a String containing the generic raw hex information, with pre-pended header.- Returns:
- a two character String containing only the hex representation of the opcode from the raw message.
-
clearButtonActionPerformed
-
copyToClipBoardButtonActionPerformed
-
getFilePathAndName
-
startLogButtonActionPerformed
-
stopLogButtonActionPerformed
-
openFileChooserButtonActionPerformed
-
enterButtonActionPerformed
-
getFrameText
-
getTextArea
Get access to the main text area. This is intended for use in e.g. scripting to extend the behavior of the window.- Returns:
- the main text area
-
getFilterText
-
setFilterText
-