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:
Interface Summary Interface Description JmriMouseListenerReplacement for
WindowInterfaceInterface for an object that can arrange for a
JmriPanelto be displayed.
Class Summary Class Description BeanSelectCreatePanel<E extends NamedBean> BeanSelectPanel<E extends NamedBean>Create a JPanel containing a NamedBeanComboBox. 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 DefaultMutableTreeNodeFacial subclass for
DefaultMutableTreeNodeto limit linkage for i.e.
DrawSquaresCommon utility to draw colored rectangular Image. EditableResizableImagePanel 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. JmriColorChooserDisplay the Java color chooser that includes a custom JMRI panel. JmriColorChooserPanelCreate a custom color chooser panel. JmriMouseAdapterReplacement for MouseAdaptor. JmriMouseEventAdaptor for MouseEvent. 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. 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. StayOpenCheckBoxMenuItemUIUI for StayOpenCheckBoxItem or JCheckBoxMenuItem. 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. TriStateJCheckBoxJPanel containing Extension of JCheckBox allowing a partial state to be displayed. 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. WrapLayoutFlowLayout subclass that fully supports wrapping of components. XTableColumnModelTaken from http://www.stephenkelvin.de/XTableColumnModel/
XTableColumnModelextends the DefaultTableColumnModel .
Enum Summary Enum Description TriStateJCheckBox.StateEnum of TriStateJCheckBox state values. WindowInterface.HintSuggested location for subsequent panels