The org.bzdev.swing package
This package contains additional swing components and various support classes as shown in the following two UML diagrams. The first diagram, the more complex of the two, contains most of the classes and interfaces in this package:
The second diagram shows various "button" classes and transfer handlers that support Drag and Drop (D&D):
*
The classes contained in this package can be grouped as follows:
- classes that display graphics and animations. These classes,
are not swing components, but have a swing component associated
with each instance. The use of these classes for creating
graphics is thread safe. These classes are
AnimatedPanelGraphics
. This class can be used byAnimation2D
to display animations directly without having to first create a series of frames and then use video editors or programs such as ffmpeg to create a standard video format. It implements theISWriterOps
interface, so that it can be used interchangeably withImageSequenceWriter
, which implements the same interface.PanelGraphics
. This class can be used to display a graph directly. It implements theOSGraphicsOps
interface, whichOutputStreamGraphics
also implements. For cases such as simulations with long running times,PanelGraphics
supports incremental updating of graphs by "flushing" a partially completed display.
- classes that help implement transfer handlers to
support D&D with some allowing
JLists to be reordered. These are
-
ExtObjTransferHandler
. This transfer handler can be used to implement a target for drag and drop operations. The objects transferred are identified by file names or by URLs. -
ExtObjListTransferHandler
. This is similar toExtObjTransferHandler
, but the target is a JList, and D&D can be used to reorder that JList. If the objects are defined to be subclasses of ImageIcon, an image can be displayed in the JList. -
ReorderListTransferHandler
. This TransferHandler allows a JList to be reordered, but does not provide support for inserting elements into that JList: insertions have to be handle by another mechanism (e.g. a "new item" button or menu item). -
URLListTransferHandler
. This transfer handler allows URLs and file names to be dragged into a JList and allows that JList to be reordered. -
DebugTransferHandler
. This transfer handler is a wrapper for other transfer handlers and simply adds tracing support for various methods. Experience with some JDK/Desktop implementations has shown that the data flavors in drag and drop operations may be dependent on both the OS, the window system, and the JDK. For debugging purposes, determining what data flavors are actually being used is useful.
-
- classes that provide thread-safe components. These are
-
SimpleJTextPane
. This provides a text pane with simple formatting options (e.g., font colors and a choice of text styles including bold and italic). It is meant for console-like input and can be configured to be thread safe. -
SimpleConsole
. A console that can be displayed on demand and that includes a method for creating a menu item that will make the console visible.
-
- classes that provide components with restricted inputs.
These are
-
VTextField
. A text field that verifies its input and only replaces an old value if the new value is acceptable. -
WholeNumbTextField
. A text field that allows only whole numbers to be entered. -
PortTextField
. A text field whose legal values are the legal values for TCP or UDP port numbers. -
TimeTextField
. A text field representing time intervals and accepting a variety of input formats.
-
- classes to support internationalized menus. These are
-
IMenu
. A menu whose label adjusts to a specified locale. -
IMenuItem
. A whose properties adjust to a specified locale. -
ProxyMenuItem
. A menu item for configuring proxies, with support for internationalization. -
HelpMenuItem
. A menu item for creating simple on-line help with support for internationalization. -
StackTraceMenuItem
. A menu item for turning on and off stack traces when using the ErrorMessage class for printing errors.
-
- classes that provide buttons to open dialog boxes for
inputting text. These are
-
TextAreaButton
. A button that will bring up a text area for input. -
TextFieldButton
. A button that will bring up a text field for input. -
URLTextAreaButton
. A button that will bring up a text field for input possibly obtaining the text by downloading text specified by a URL.
-
- classes that map named JTree entries to objects. These are
-
ObjTocPane
. This component provides a hierarchical table of contents for a set of objects. Action listeners are used to track changes in selections. -
UrlTocPane
. This component extends ObjTocPane by specializing it so that the objects it manages are URLs. It's action listeners can detect which URL was selected and respond in some appropriate way.
-
- a class
HtmlWithTocPane
that combine a JTree with a JEditorPane for displaying HTML document. - A class
AuthenticationPane
for password authentication, with an option of showing text as a password is typed or hiding text. - A class
HtmlPane
for displaying HTML text with navigation controls. - A
SwingErrorMessage
class that can send messages to various destinations including an instance ofSimpleConsole
. System.err, etc., are also supported. - A class
InputTablePane
that provides a simplified API for building tables. - A class
ConfigPropertyEditor
that makes it possible to use stylized Java property files to configure an application. - A class
DarkmodeMonitor
that can detect whether or not dark mode is in effect for systems that support that. - Two chooser-panel classes:
- A class
CSSColorChooserPanel
that provides a panel using CSS named colors that can be added to a color chooser. - A class
ClearableFileChooser
that creates a file chooser with an extra button to distinguish clearing a file (i.e. providing no file) from canceling the request to choose a file.
- A class
- Several cell editors for use in tables or treas:
- A class
CSSCellEditor
that provides a cell editor that uses a color chooser and that represents colors by using CSS color specifications. - A class
FileNameCellEditor
that provides file names by using a file-chooser dialog box. - A class
ITextCellEditor
that provides a cell's value by usingInternationalFormatter
. - A class
TextCellEditor
that represents objects textually when being edited.
- A class
-
org.bzdev.swing.io
. This contains a Reader that can read from instances of java.swing.text.Document. -
org.bzdev.swing.keys
. This contains a class that provides only static methods and that can look up key events by name. -
org.bzdev.swing.table
. This contains a table-cell renderer. -
org.bzdev.swing.text
. This contains a DocumentFilter, and two tread-safe Document classes. -
org.bzdev.swing.proxyconf
. This contains classes for configuring network proxies.