Tools and utilities for doing a systematic reworking of the JMRI GUI.
The goal is to allow various GUI types to be available. Subpackages provide key implementation pieces:
- The traditional JMRI "single-document interface", where there are multiple independent windows
- A "multi-document interface", where a primary window contains multiple independent sub-windows
- A "multi-pane" or IDE-style interface", where each window is tiled with inter-related panes
WindowInterfacereference handles the type-specific aspects.
JMRI Swing Usage StructureJMRI GUI code starts as
JmriPanelclasses, which extends the Swing JPanel. Managing the frames (windows) that enclose them is done automatically when they are opened via the
JmriNamedPaneActionis preferred because it defers loading of the referenced panel class until the action is invoked, which can reduce JMRI startup time signficantly.
Related DocumentationFor overviews, tutorials, examples, guides, and tool documentation, please see:
Class Summary Class Description BeanSelectCreatePanel<E extends NamedBean> Bundle BusyDialogCreates a simple "indeterminate" busy spinner dialog... ButtonGroupColorChooserPanelAbstract Color Chooser extension that presents the JMRI preset colors in as a Radio Button list with proper internationalization. ButtonSwatchColorChooserPanelAbstract Color Chooser extension that presents a swatch sample of the color and a button to set the color. ColorListPopupMenuPopup menu for displaying recently selected colors along with standard java colors. ComboBoxColorChooserPanelAbstract Color Chooser extension that presents the JMRI preset colors in a Combo Box with proper internationalization. ComboBoxToolTipRendererSet ToolTips for ComboBox items Steve Young (c) 2019 DedupingPropertyChangeListener Deprecated.since 4.17.1; use
DefaultMutableTreeNodeFacial subclass for
DefaultMutableTreeNodeto limit linkage for i.e.
DrawSquaresCommon utility to draw colored rectangular Image. EditableResizableImagePanel EditableResizableImagePanel.MyMouseAdapter ExceptionContextWraps an Exception and allows extra contextual information to be added, such as what was happening at the time of the Exception, and a hint as to what the user might do to correct the problem. ExceptionDisplayFrameDialog to display the details of an Exception. FontComboUtilThis utility class provides methods that initialise and return a JComboBox containing a specific sub-set of fonts installed on a users system. GuiUtilBaseCommon utility methods for working with GUI items GuiUtilBase.CallingAbstractAction ImagePanelCommon utility to draw a BufferedImage as background behind a JPanel. JCBHandle<T>Wrap an object for easier null handling in a JComboBox. JComboBoxUtilCommon utility methods for working with JComboBoxes. JFrameInterfaceA simple WindowInterface for a JFrame. JMenuUtilCommon utility methods for working with JMenus. JmriAbstractActionAbstract base for actions that will work with multiple JMRI GUIs. JmriBeanComboBox Deprecated.since 4.17.1; use
JmriBeanComboBox.BeanSelectionManager JmriBeanComboBox.EnabledComboBoxRenderer JmriColorChooserDisplay the Java color chooser that includes a custom JMRI panel. JmriColorChooserPanelCreate a custom color chooser panel. JmriNamedPaneActionAction that, when invoked, creates a JmriPanel from its class name and installs it in a given window. JmriPanelJPanel extension to handle automatic creation of window title and help reference. JToolBarUtilCommon utility methods for working with JToolBars. JTreeUtilCommon utility methods for working with JTrees. RegexFormatterFrom an early Java example, later at http://www.oracle.com/technetwork/java/reftf-138955.html# Example: new JFormattedTextField(new jmri.util.swing.RegexFormatter("[A-Za-z]\\d*")); ResizableImagePanelA class extending JPanels to have a image display in a panel, supports drag'n drop of image file can resize container can scale content to size respect aspect ratio by default (when resizing content) (overrides paintComponent for performances) ScrollablePanelJPanel extension to handle the Scrollable interface so it can behave well in a vertical JScrollPane SearchBarProvides a standard "search bar" for addition to other panels. SliderSnap Deprecated.since 4.21.1 without direct replacement as uses illegal reflective access SplitButtonColorChooserPanelAbstract Color Chooser extension that presents a split button to set the color. StatusBarStatus Bar A little status bar widget that can be put at the bottom of a panel. StayOpenCheckBoxItemDefault swing behaviour is to close a JCheckBoxMenuItem when clicked. SwingSettings Deprecated.since 4.19.6; use
TextAreaFIFOCreate a new TextAreaFIFO, an extended JTextArea Keeps message log windows to a reasonable length Scrolls down to last line of textarea by default Originally based on https://community.oracle.com/thread/1373400 Modified for JMRI by Steve Young (c) 2018 TextFilterText by extension file filter. ToggleOrPressButtonModelToggleOrPressButtonModel handles the storage and maintenance of the state of the button. UnexpectedExceptionContextExtends ExceptionContext class for exceptions that are not expected, and therefore have no suggestions for the user. ValidatedTextFieldExtends JTextField to provide a data validation function and a colorization function. ValidationNotificationsUtilities for displaying Validation Messages. VerticalLabelUIAllows a JLabel to be displayed vertically, with a defined orientation. XTableColumnModelTaken from http://www.stephenkelvin.de/XTableColumnModel/
XTableColumnModelextends the DefaultTableColumnModel .