java.lang.Object | |
↳ | javax.swing.plaf.synth.Region |
A distinct rendering area of a Swing component. A component may support one or more regions. Specific component regions are defined by the typesafe enumeration in this class.
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"/>
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ARROW_BUTTON | ArrowButton's are special types of buttons that also render a directional indicator, typically an arrow. | ||||||||||
BUTTON | Button region. | ||||||||||
CHECK_BOX | CheckBox region. | ||||||||||
CHECK_BOX_MENU_ITEM | CheckBoxMenuItem region. | ||||||||||
COLOR_CHOOSER | ColorChooser region. | ||||||||||
COMBO_BOX | ComboBox region. | ||||||||||
DESKTOP_ICON | DesktopIcon region. | ||||||||||
DESKTOP_PANE | DesktopPane region. | ||||||||||
EDITOR_PANE | EditorPane region. | ||||||||||
FILE_CHOOSER | FileChooser region. | ||||||||||
FORMATTED_TEXT_FIELD | FormattedTextField region. | ||||||||||
INTERNAL_FRAME | InternalFrame region. | ||||||||||
INTERNAL_FRAME_TITLE_PANE | TitlePane of an InternalFrame. | ||||||||||
LABEL | Label region. | ||||||||||
LIST | List region. | ||||||||||
MENU | Menu region. | ||||||||||
MENU_BAR | MenuBar region. | ||||||||||
MENU_ITEM | MenuItem region. | ||||||||||
MENU_ITEM_ACCELERATOR | Accelerator region of a MenuItem. | ||||||||||
OPTION_PANE | OptionPane region. | ||||||||||
PANEL | Panel region. | ||||||||||
PASSWORD_FIELD | PasswordField region. | ||||||||||
POPUP_MENU | PopupMenu region. | ||||||||||
POPUP_MENU_SEPARATOR | PopupMenuSeparator region. | ||||||||||
PROGRESS_BAR | ProgressBar region. | ||||||||||
RADIO_BUTTON | RadioButton region. | ||||||||||
RADIO_BUTTON_MENU_ITEM | RegionButtonMenuItem region. | ||||||||||
ROOT_PANE | RootPane region. | ||||||||||
SCROLL_BAR | ScrollBar region. | ||||||||||
SCROLL_BAR_THUMB | Thumb of the ScrollBar. | ||||||||||
SCROLL_BAR_TRACK | Track of the ScrollBar. | ||||||||||
SCROLL_PANE | ScrollPane region. | ||||||||||
SEPARATOR | Separator region. | ||||||||||
SLIDER | Slider region. | ||||||||||
SLIDER_THUMB | Thumb of the Slider. | ||||||||||
SLIDER_TRACK | Track of the Slider. | ||||||||||
SPINNER | Spinner region. | ||||||||||
SPLIT_PANE | SplitPane region. | ||||||||||
SPLIT_PANE_DIVIDER | Divider of the SplitPane. | ||||||||||
TABBED_PANE | TabbedPane region. | ||||||||||
TABBED_PANE_CONTENT | Region of a TabbedPane containing the content. | ||||||||||
TABBED_PANE_TAB | Region of a TabbedPane for one tab. | ||||||||||
TABBED_PANE_TAB_AREA | Region of a TabbedPane containing the tabs. | ||||||||||
TABLE | Table region. | ||||||||||
TABLE_HEADER | TableHeader region. | ||||||||||
TEXT_AREA | TextArea region. | ||||||||||
TEXT_FIELD | TextField region. | ||||||||||
TEXT_PANE | TextPane region. | ||||||||||
TOGGLE_BUTTON | ToggleButton region. | ||||||||||
TOOL_BAR | ToolBar region. | ||||||||||
TOOL_BAR_CONTENT | Region of the ToolBar containing the content. | ||||||||||
TOOL_BAR_DRAG_WINDOW | Region for the Window containing the ToolBar. | ||||||||||
TOOL_BAR_SEPARATOR | ToolBar separator region. | ||||||||||
TOOL_TIP | ToolTip region. | ||||||||||
TREE | Tree region. | ||||||||||
TREE_CELL | Region of the Tree for one cell. | ||||||||||
VIEWPORT | Viewport region. |
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a Region with the specified name.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the name of the region.
| |||||||||||
Returns true if the Region is a subregion of a Component, otherwise
false.
| |||||||||||
Returns the name of the Region.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
ArrowButton's are special types of buttons that also render a
directional indicator, typically an arrow. ArrowButtons are used by
composite components, for example ScrollBar's contain ArrowButtons.
To bind a style to this Region
use the name
ArrowButton
.
Button region. To bind a style to this Region
use the name
Button
.
CheckBox region. To bind a style to this Region
use the name
CheckBox
.
CheckBoxMenuItem region. To bind a style to this Region
use
the name CheckBoxMenuItem
.
ColorChooser region. To bind a style to this Region
use
the name ColorChooser
.
ComboBox region. To bind a style to this Region
use
the name ComboBox
.
DesktopIcon region. To bind a style to this Region
use
the name DesktopIcon
.
DesktopPane region. To bind a style to this Region
use
the name DesktopPane
.
EditorPane region. To bind a style to this Region
use
the name EditorPane
.
FileChooser region. To bind a style to this Region
use
the name FileChooser
.
FormattedTextField region. To bind a style to this Region
use
the name FormattedTextField
.
InternalFrame region. To bind a style to this Region
use
the name InternalFrame
.
TitlePane of an InternalFrame. The TitlePane typically
shows a menu, title, widgets to manipulate the internal frame.
To bind a style to this Region
use the name
InternalFrameTitlePane
.
MenuBar region. To bind a style to this Region
use the name
MenuBar
.
MenuItem region. To bind a style to this Region
use the name
MenuItem
.
Accelerator region of a MenuItem. To bind a style to this
Region
use the name MenuItemAccelerator
.
OptionPane region. To bind a style to this Region
use
the name OptionPane
.
PasswordField region. To bind a style to this Region
use
the name PasswordField
.
PopupMenu region. To bind a style to this Region
use
the name PopupMenu
.
PopupMenuSeparator region. To bind a style to this Region
use the name PopupMenuSeparator
.
ProgressBar region. To bind a style to this Region
use the name ProgressBar
.
RadioButton region. To bind a style to this Region
use the name RadioButton
.
RegionButtonMenuItem region. To bind a style to this Region
use the name RadioButtonMenuItem
.
RootPane region. To bind a style to this Region
use
the name RootPane
.
ScrollBar region. To bind a style to this Region
use
the name ScrollBar
.
Thumb of the ScrollBar. The thumb is the region of the ScrollBar
that gives a graphical depiction of what percentage of the View is
currently visible. To bind a style to this Region
use
the name ScrollBarThumb
.
Track of the ScrollBar. To bind a style to this Region
use
the name ScrollBarTrack
.
ScrollPane region. To bind a style to this Region
use
the name ScrollPane
.
Separator region. To bind a style to this Region
use
the name Separator
.
Slider region. To bind a style to this Region
use
the name Slider
.
Thumb of the Slider. The thumb of the Slider identifies the current
value. To bind a style to this Region
use the name
SliderThumb
.
Track of the Slider. To bind a style to this Region
use
the name SliderTrack
.
Spinner region. To bind a style to this Region
use the name
Spinner
.
SplitPane region. To bind a style to this Region
use the name
SplitPane
.
Divider of the SplitPane. To bind a style to this Region
use the name SplitPaneDivider
.
TabbedPane region. To bind a style to this Region
use
the name TabbedPane
.
Region of a TabbedPane containing the content. To bind a style to this
Region
use the name TabbedPaneContent
.
Region of a TabbedPane for one tab. To bind a style to this
Region
use the name TabbedPaneTab
.
Region of a TabbedPane containing the tabs. To bind a style to this
Region
use the name TabbedPaneTabArea
.
TableHeader region. To bind a style to this Region
use
the name TableHeader
.
TextArea region. To bind a style to this Region
use
the name TextArea
.
TextField region. To bind a style to this Region
use
the name TextField
.
TextPane region. To bind a style to this Region
use
the name TextPane
.
ToggleButton region. To bind a style to this Region
use
the name ToggleButton
.
ToolBar region. To bind a style to this Region
use
the name ToolBar
.
Region of the ToolBar containing the content. To bind a style to this
Region
use the name ToolBarContent
.
Region for the Window containing the ToolBar. To bind a style to this
Region
use the name ToolBarDragWindow
.
ToolBar separator region. To bind a style to this Region
use
the name ToolBarSeparator
.
ToolTip region. To bind a style to this Region
use
the name ToolTip
.
Region of the Tree for one cell. To bind a style to this
Region
use the name TreeCell
.
Viewport region. To bind a style to this Region
use
the name Viewport
.
Creates a Region with the specified name. This should only be
used if you are creating your own JComponent
subclass
with a custom ComponentUI
class.
name | Name of the region |
---|---|
ui | 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. |
Returns true if the Region is a subregion of a Component, otherwise
false. For example, Region.BUTTON
corresponds do a
Component
so that Region.BUTTON.isSubregion()
returns false.