public class Region extends Object
Regions are typically used as a way to identify the Component
s and areas a particular style is to apply to. Synth's file format allows you to bind styles based on the name of a Region
. The name is derived from the field name of the constant:
SPLIT_PANE
Region
you would use SplitPane
. The following shows a custom SynthStyleFactory
that returns a specific style for split panes: public SynthStyle getStyle(JComponent c, Region id) { if (id == Region.SPLIT_PANE) { return splitPaneStyle; } ... }The following xml accomplishes the same thing:
<style id="splitPaneStyle"> ... </style> <bind style="splitPaneStyle" type="region" key="SplitPane"/>
Modifier and Type | Field | Description |
---|---|---|
static final Region |
ARROW_BUTTON |
ArrowButton's are special types of buttons that also render a directional indicator, typically an arrow. |
static final Region |
BUTTON |
Button region. |
static final Region |
CHECK_BOX |
CheckBox region. |
static final Region |
CHECK_BOX_MENU_ITEM |
CheckBoxMenuItem region. |
static final Region |
COLOR_CHOOSER |
ColorChooser region. |
static final Region |
COMBO_BOX |
ComboBox region. |
static final Region |
DESKTOP_ICON |
DesktopIcon region. |
static final Region |
DESKTOP_PANE |
DesktopPane region. |
static final Region |
EDITOR_PANE |
EditorPane region. |
static final Region |
FILE_CHOOSER |
FileChooser region. |
static final Region |
FORMATTED_TEXT_FIELD |
FormattedTextField region. |
static final Region |
INTERNAL_FRAME |
InternalFrame region. |
static final Region |
INTERNAL_FRAME_TITLE_PANE |
TitlePane of an InternalFrame. |
static final Region |
LABEL |
Label region. |
static final Region |
LIST |
List region. |
static final Region |
MENU |
Menu region. |
static final Region |
MENU_BAR |
MenuBar region. |
static final Region |
MENU_ITEM |
MenuItem region. |
static final Region |
MENU_ITEM_ACCELERATOR |
Accelerator region of a MenuItem. |
static final Region |
OPTION_PANE |
OptionPane region. |
static final Region |
PANEL |
Panel region. |
static final Region |
PASSWORD_FIELD |
PasswordField region. |
static final Region |
POPUP_MENU |
PopupMenu region. |
static final Region |
POPUP_MENU_SEPARATOR |
PopupMenuSeparator region. |
static final Region |
PROGRESS_BAR |
ProgressBar region. |
static final Region |
RADIO_BUTTON |
RadioButton region. |
static final Region |
RADIO_BUTTON_MENU_ITEM |
RadioButtonMenuItem region. |
static final Region |
ROOT_PANE |
RootPane region. |
static final Region |
SCROLL_BAR |
ScrollBar region. |
static final Region |
SCROLL_BAR_THUMB |
Thumb of the ScrollBar. |
static final Region |
SCROLL_BAR_TRACK |
Track of the ScrollBar. |
static final Region |
SCROLL_PANE |
ScrollPane region. |
static final Region |
SEPARATOR |
Separator region. |
static final Region |
SLIDER |
Slider region. |
static final Region |
SLIDER_THUMB |
Thumb of the Slider. |
static final Region |
SLIDER_TRACK |
Track of the Slider. |
static final Region |
SPINNER |
Spinner region. |
static final Region |
SPLIT_PANE |
SplitPane region. |
static final Region |
SPLIT_PANE_DIVIDER |
Divider of the SplitPane. |
static final Region |
TABBED_PANE |
TabbedPane region. |
static final Region |
TABBED_PANE_CONTENT |
Region of a TabbedPane containing the content. |
static final Region |
TABBED_PANE_TAB |
Region of a TabbedPane for one tab. |
static final Region |
TABBED_PANE_TAB_AREA |
Region of a TabbedPane containing the tabs. |
static final Region |
TABLE |
Table region. |
static final Region |
TABLE_HEADER |
TableHeader region. |
static final Region |
TEXT_AREA |
TextArea region. |
static final Region |
TEXT_FIELD |
TextField region. |
static final Region |
TEXT_PANE |
TextPane region. |
static final Region |
TOGGLE_BUTTON |
ToggleButton region. |
static final Region |
TOOL_BAR |
ToolBar region. |
static final Region |
TOOL_BAR_CONTENT |
Region of the ToolBar containing the content. |
static final Region |
TOOL_BAR_DRAG_WINDOW |
Region for the Window containing the ToolBar. |
static final Region |
TOOL_BAR_SEPARATOR |
ToolBar separator region. |
static final Region |
TOOL_TIP |
ToolTip region. |
static final Region |
TREE |
Tree region. |
static final Region |
TREE_CELL |
Region of the Tree for one cell. |
static final Region |
VIEWPORT |
Viewport region. |
Modifier | Constructor | Description |
---|---|---|
protected |
Creates a Region with the specified name. |
Modifier and Type | Method | Description |
---|---|---|
String |
getName() |
Returns the name of the region. |
boolean |
isSubregion() |
Returns true if the Region is a subregion of a Component, otherwise false. |
String |
toString() |
Returns the name of the Region. |
public static final Region ARROW_BUTTON
Region
use the name ArrowButton
.public static final Region BUTTON
Region
use the name Button
.public static final Region CHECK_BOX
Region
use the name CheckBox
.public static final Region CHECK_BOX_MENU_ITEM
Region
use the name CheckBoxMenuItem
.public static final Region COLOR_CHOOSER
Region
use the name ColorChooser
.public static final Region COMBO_BOX
Region
use the name ComboBox
.public static final Region DESKTOP_PANE
Region
use the name DesktopPane
.public static final Region DESKTOP_ICON
Region
use the name DesktopIcon
.public static final Region EDITOR_PANE
Region
use the name EditorPane
.public static final Region FILE_CHOOSER
Region
use the name FileChooser
.public static final Region FORMATTED_TEXT_FIELD
Region
use the name FormattedTextField
.public static final Region INTERNAL_FRAME
Region
use the name InternalFrame
.public static final Region INTERNAL_FRAME_TITLE_PANE
Region
use the name InternalFrameTitlePane
.public static final Region LABEL
Region
use the name Label
.public static final Region LIST
Region
use the name List
.public static final Region MENU
Region
use the name Menu
.public static final Region MENU_BAR
Region
use the name MenuBar
.public static final Region MENU_ITEM
Region
use the name MenuItem
.public static final Region MENU_ITEM_ACCELERATOR
Region
use the name MenuItemAccelerator
.public static final Region OPTION_PANE
Region
use the name OptionPane
.public static final Region PANEL
Region
use the name Panel
.public static final Region PASSWORD_FIELD
Region
use the name PasswordField
.public static final Region POPUP_MENU
Region
use the name PopupMenu
.public static final Region POPUP_MENU_SEPARATOR
Region
use the name PopupMenuSeparator
.public static final Region PROGRESS_BAR
Region
use the name ProgressBar
.public static final Region RADIO_BUTTON
Region
use the name RadioButton
.public static final Region RADIO_BUTTON_MENU_ITEM
Region
use the name RadioButtonMenuItem
.public static final Region ROOT_PANE
Region
use the name RootPane
.public static final Region SCROLL_BAR
Region
use the name ScrollBar
.public static final Region SCROLL_BAR_TRACK
Region
use the name ScrollBarTrack
.public static final Region SCROLL_BAR_THUMB
Region
use the name ScrollBarThumb
.public static final Region SCROLL_PANE
Region
use the name ScrollPane
.public static final Region SEPARATOR
Region
use the name Separator
.public static final Region SLIDER
Region
use the name Slider
.public static final Region SLIDER_TRACK
Region
use the name SliderTrack
.public static final Region SLIDER_THUMB
Region
use the name SliderThumb
.public static final Region SPINNER
Region
use the name Spinner
.public static final Region SPLIT_PANE
Region
use the name SplitPane
.public static final Region SPLIT_PANE_DIVIDER
Region
use the name SplitPaneDivider
.public static final Region TABBED_PANE
Region
use the name TabbedPane
.public static final Region TABBED_PANE_TAB
Region
use the name TabbedPaneTab
.public static final Region TABBED_PANE_TAB_AREA
Region
use the name TabbedPaneTabArea
.public static final Region TABBED_PANE_CONTENT
Region
use the name TabbedPaneContent
.public static final Region TABLE
Region
use the name Table
.public static final Region TABLE_HEADER
Region
use the name TableHeader
.public static final Region TEXT_AREA
Region
use the name TextArea
.public static final Region TEXT_FIELD
Region
use the name TextField
.public static final Region TEXT_PANE
Region
use the name TextPane
.public static final Region TOGGLE_BUTTON
Region
use the name ToggleButton
.public static final Region TOOL_BAR
Region
use the name ToolBar
.public static final Region TOOL_BAR_CONTENT
Region
use the name ToolBarContent
.public static final Region TOOL_BAR_DRAG_WINDOW
Region
use the name ToolBarDragWindow
.public static final Region TOOL_TIP
Region
use the name ToolTip
.public static final Region TOOL_BAR_SEPARATOR
Region
use the name ToolBarSeparator
.public static final Region TREE
Region
use the name Tree
.public static final Region TREE_CELL
Region
use the name TreeCell
.public static final Region VIEWPORT
Region
use the name Viewport
.protected Region(String name, String ui, boolean subregion)
JComponent
subclass with a custom ComponentUI
class.name
- Name of the regionui
- String that will be returned from component.getUIClassID
. This will be null if this is a subregion.subregion
- Whether or not this is a subregion.public boolean isSubregion()
Region.BUTTON
corresponds do a Component
so that Region.BUTTON.isSubregion()
returns false.public String getName()
public String toString()
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/javax/swing/plaf/synth/Region.html