Package jmri.util.swing
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:
jmri.util.swing.sdi
- The traditional JMRI "single-document interface", where there are multiple independent windows
jmri.util.swing.mdi
- A "multi-document interface", where a primary window contains multiple independent sub-windows
jmri.util.swing.multipane
- A "multi-pane" or IDE-style interface", where each window is tiled with inter-related panes
WindowInterface
reference handles the type-specific aspects.
JMRI Swing Usage Structure
JMRI GUI code starts asJmriPanel
classes, which extends the Swing JPanel.
Managing the frames (windows) that enclose them is done automatically when they are
opened via the
JmriAbstractAction
and
JmriNamedPaneAction
action classes.
JmriNamedPaneAction
is preferred because it defers loading of the referenced
panel class until the action is invoked, which can reduce JMRI startup time signficantly.
Generic creation of menus, toolbars and navigation trees from XML definition
files are provided by the
JMenuUtil
, JToolBarUtil
,
JTreeUtil
classes
Related Documentation
For overviews, tutorials, examples, guides, and tool documentation, please see:- The JMRI Swing usage page.
- Wikipedia discussion of MDI and IDE interfaces.
- Since:
- 2.9.4
-
Interface Summary Interface Description JmriMouseListener Replacement forMouseListener
.JmriMouseMotionListener Replacement forMouseMotionListener
.WindowInterface Interface for an object that can arrange for aJmriPanel
to be displayed. -
Class Summary Class Description BeanSelectCreatePanel<E extends NamedBean> BeanSelectPanel<E extends NamedBean> Create a JPanel containing a NamedBeanComboBox.Bundle BusyDialog Creates a simple "indeterminate" busy spinner dialog...ButtonGroupColorChooserPanel Abstract Color Chooser extension that presents the JMRI preset colors in as a Radio Button list with proper internationalization.ButtonSwatchColorChooserPanel Abstract Color Chooser extension that presents a swatch sample of the color and a button to set the color.ColorListPopupMenu Popup menu for displaying recently selected colors along with standard java colors.ComboBoxColorChooserPanel Abstract Color Chooser extension that presents the JMRI preset colors in a Combo Box with proper internationalization.ComboBoxToolTipRenderer Set ToolTips for ComboBox items Steve Young (c) 2019CountingBusyDialog Creates a simple counting progress bar.DefaultMutableTreeNode Facial subclass forDefaultMutableTreeNode
to limit linkage for i.e.DrawSquares Common utility to draw colored rectangular Image.EditableResizableImagePanel ExceptionContext Wraps 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.ExceptionDisplayFrame Static methods to display an Exception Dialog.FontComboUtil This utility class provides methods that initialise and return a JComboBox containing a specific sub-set of fonts installed on a users system.GuiUtilBase Common utility methods for working with GUI itemsGuiUtilBase.CallingAbstractAction ImagePanel Common utility to draw a BufferedImage as background behind a JPanel.JCBHandle<T> Wrap an object for easier null handling in a JComboBox.JComboBoxUtil Common utility methods for working with JComboBoxes.JDialogListener JDialogListener can be used to link JDialog instances with Frames.JFrameInterface A simple WindowInterface for a JFrame.JMenuUtil Common utility methods for working with JMenus.JmriAbstractAction Abstract base for actions that will work with multiple JMRI GUIs.JmriColorChooser Display the Java color chooser that includes a custom JMRI panel.JmriColorChooserPanel Create a custom color chooser panel.JmriJFileChooser JmriJOptionPane JmriJOptionPane provides a set of static methods to display Dialogs and retrieve user input.JmriMouseAdapter Replacement for MouseAdaptor.JmriMouseEvent Adaptor for MouseEvent.JmriNamedPaneAction Action that, when invoked, creates a JmriPanel from its class name and installs it in a given window.JmriPanel JPanel extension to handle automatic creation of window title and help reference.JToolBarUtil Common utility methods for working with JToolBars.JTreeUtil Common utility methods for working with JTrees.MultiLineCellRenderer Renderer to display multiple lines in a JTable cellRegexFormatter From 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*"));ResizableImagePanel A 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)ScrollablePanel JPanel extension to handle the Scrollable interface so it can behave well in a vertical JScrollPaneSearchBar Provides a standard "search bar" for addition to other panels.SplitButtonColorChooserPanel Abstract Color Chooser extension that presents a split button to set the color.StatusBar Status Bar A little status bar widget that can be put at the bottom of a panel.StayOpenCheckBoxItem Default swing behaviour is to close a JCheckBoxMenuItem when clicked.StayOpenCheckBoxMenuItemUI UI for StayOpenCheckBoxItem or JCheckBoxMenuItem.TextAreaFIFO Create 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) 2018TextFilter Text by extension file filter.TriStateJCheckBox JPanel containing Extension of JCheckBox allowing a partial state to be displayed.UnexpectedExceptionContext Extends ExceptionContext class for exceptions that are not expected, and therefore have no suggestions for the user.ValidatedTextField Extends JTextField to provide a data validation function and a colorization function.ValidationNotifications Utilities for displaying Validation Messages.VerticalLabelUI Allows a JLabel to be displayed vertically, with a defined orientation.WrapLayout FlowLayout subclass that fully supports wrapping of components.XTableColumnModel Taken from http://www.stephenkelvin.de/XTableColumnModel/XTableColumnModel
extends the DefaultTableColumnModel . -
Enum Summary Enum Description TriStateJCheckBox.State Enum of TriStateJCheckBox state values.WindowInterface.Hint Suggested location for subsequent panels