APIdia Launch Partner
Top Description Fields Constructors Methods
javax.swing.plaf.synth

public Class Region

extends Object
Class Inheritance
Known Direct Subclasses
com.sun.java.swing.plaf.gtk.GTKEngine.CustomRegion, com.sun.java.swing.plaf.gtk.GTKRegion
Imports
java.util.HashMap, .Locale, .Map, javax.swing.JComponent, .UIDefaults

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 Components 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:

  1. Map all characters to lowercase.
  2. Map the first character to uppercase.
  3. Map the first character after underscores to uppercase.
  4. Remove all underscores.
For example, to identify the 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"/>
Author
Scott Violet
Since
1.5

Field Summary

Modifier and TypeField and Description
public static final Region
ARROW_BUTTON

ArrowButton's are special types of buttons that also render a directional indicator, typically an arrow.

public static final Region
BUTTON

Button region.

public static final Region
CHECK_BOX

CheckBox region.

public static final Region
CHECK_BOX_MENU_ITEM

CheckBoxMenuItem region.

public static final Region
COLOR_CHOOSER

ColorChooser region.

public static final Region
COMBO_BOX

ComboBox region.

public static final Region
DESKTOP_ICON

DesktopIcon region.

public static final Region
DESKTOP_PANE

DesktopPane region.

public static final Region
EDITOR_PANE

EditorPane region.

public static final Region
FILE_CHOOSER

FileChooser region.

public static final Region
FORMATTED_TEXT_FIELD

FormattedTextField region.

public static final Region
INTERNAL_FRAME

InternalFrame region.

public static final Region
INTERNAL_FRAME_TITLE_PANE

TitlePane of an InternalFrame.

public static final Region
LABEL

Label region.

private static Map<Region, String>
public static final Region
LIST

List region.

private final String
public static final Region
OPTION_PANE

OptionPane region.

public static final Region
PANEL

Panel region.

public static final Region
PASSWORD_FIELD

PasswordField region.

public static final Region
PROGRESS_BAR

ProgressBar region.

public static final Region
RADIO_BUTTON

RadioButton region.

public static final Region
RADIO_BUTTON_MENU_ITEM

RadioButtonMenuItem region.

private static Map<String, Region>
public static final Region
ROOT_PANE

RootPane region.

public static final Region
SCROLL_BAR

ScrollBar region.

public static final Region
SCROLL_BAR_THUMB

Thumb of the ScrollBar.

public static final Region
SCROLL_BAR_TRACK

Track of the ScrollBar.

public static final Region
SCROLL_PANE

ScrollPane region.

public static final Region
SEPARATOR

Separator region.

public static final Region
SLIDER

Slider region.

public static final Region
SLIDER_THUMB

Thumb of the Slider.

public static final Region
SLIDER_TRACK

Track of the Slider.

public static final Region
SPINNER

Spinner region.

public static final Region
SPLIT_PANE

SplitPane region.

public static final Region
SPLIT_PANE_DIVIDER

Divider of the SplitPane.

private final boolean
public static final Region
TABBED_PANE

TabbedPane region.

public static final Region
TABBED_PANE_CONTENT

Region of a TabbedPane containing the content.

public static final Region
TABBED_PANE_TAB

Region of a TabbedPane for one tab.

public static final Region
TABBED_PANE_TAB_AREA

Region of a TabbedPane containing the tabs.

public static final Region
TABLE

Table region.

public static final Region
TABLE_HEADER

TableHeader region.

public static final Region
TEXT_AREA

TextArea region.

public static final Region
TEXT_FIELD

TextField region.

public static final Region
TEXT_PANE

TextPane region.

public static final Region
TOGGLE_BUTTON

ToggleButton region.

public static final Region
TOOL_BAR

ToolBar region.

public static final Region
TOOL_BAR_CONTENT

Region of the ToolBar containing the content.

public static final Region
TOOL_BAR_DRAG_WINDOW

Region for the Window containing the ToolBar.

public static final Region
TOOL_BAR_SEPARATOR

ToolBar separator region.

public static final Region
TOOL_TIP

ToolTip region.

public static final Region
TREE

Tree region.

public static final Region
TREE_CELL

Region of the Tree for one cell.

public static final Region
VIEWPORT

Viewport region.

Constructor Summary

AccessConstructor and Description
private
Region(String name, boolean subregion)

protected
Region(String
Name of the region
name
,
String
String that will be returned from component.getUIClassID. This will be null if this is a subregion.
ui
,
boolean
Whether or not this is a subregion.
subregion
)

Creates a Region with the specified name.

Method Summary

Modifier and TypeMethod and Description
pack-priv String

Returns:

lower case representation of the name of the Region
getLowerCaseName
()

Returns the name, in lowercase.

private static synchronized Map<Region, String>
public String

Returns:

name of the Region.
getName
()

Returns the name of the region.

pack-priv static Region
private static synchronized Map<String, Region>
public boolean

Returns:

true if the Region is a subregion of a Component.
isSubregion
()

Returns true if the Region is a subregion of a Component, otherwise false.

pack-priv static void
public String

Returns:

name of the Region.
toString
()

Overrides java.lang.Object.toString.

Returns the name of the Region.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

ARROW_BUTTONback to summary
public static final Region ARROW_BUTTON

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.

BUTTONback to summary
public static final Region BUTTON

Button region. To bind a style to this Region use the name Button.

CHECK_BOXback to summary
public static final Region CHECK_BOX

CheckBox region. To bind a style to this Region use the name CheckBox.

CHECK_BOX_MENU_ITEMback to summary
public static final Region CHECK_BOX_MENU_ITEM

CheckBoxMenuItem region. To bind a style to this Region use the name CheckBoxMenuItem.

COLOR_CHOOSERback to summary
public static final Region COLOR_CHOOSER

ColorChooser region. To bind a style to this Region use the name ColorChooser.

COMBO_BOXback to summary
public static final Region COMBO_BOX

ComboBox region. To bind a style to this Region use the name ComboBox.

DESKTOP_ICONback to summary
public static final Region DESKTOP_ICON

DesktopIcon region. To bind a style to this Region use the name DesktopIcon.

DESKTOP_PANEback to summary
public static final Region DESKTOP_PANE

DesktopPane region. To bind a style to this Region use the name DesktopPane.

EDITOR_PANEback to summary
public static final Region EDITOR_PANE

EditorPane region. To bind a style to this Region use the name EditorPane.

FILE_CHOOSERback to summary
public static final Region FILE_CHOOSER

FileChooser region. To bind a style to this Region use the name FileChooser.

FORMATTED_TEXT_FIELDback to summary
public static final Region FORMATTED_TEXT_FIELD

FormattedTextField region. To bind a style to this Region use the name FormattedTextField.

INTERNAL_FRAMEback to summary
public static final Region INTERNAL_FRAME

InternalFrame region. To bind a style to this Region use the name InternalFrame.

INTERNAL_FRAME_TITLE_PANEback to summary
public static final Region INTERNAL_FRAME_TITLE_PANE

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.

LABELback to summary
public static final Region LABEL

Label region. To bind a style to this Region use the name Label.

lcRegionMapback to summary
private static Map<Region, String> lcRegionMap
LISTback to summary
public static final Region LIST

List region. To bind a style to this Region use the name List.

nameback to summary
private final String name
OPTION_PANEback to summary
public static final Region OPTION_PANE

OptionPane region. To bind a style to this Region use the name OptionPane.

PANELback to summary
public static final Region PANEL

Panel region. To bind a style to this Region use the name Panel.

PASSWORD_FIELDback to summary
public static final Region PASSWORD_FIELD

PasswordField region. To bind a style to this Region use the name PasswordField.

PROGRESS_BARback to summary
public static final Region PROGRESS_BAR

ProgressBar region. To bind a style to this Region use the name ProgressBar.

RADIO_BUTTONback to summary
public static final Region RADIO_BUTTON

RadioButton region. To bind a style to this Region use the name RadioButton.

RADIO_BUTTON_MENU_ITEMback to summary
public static final Region RADIO_BUTTON_MENU_ITEM

RadioButtonMenuItem region. To bind a style to this Region use the name RadioButtonMenuItem.

regionMapback to summary
private static Map<String, Region> regionMap
ROOT_PANEback to summary
public static final Region ROOT_PANE

RootPane region. To bind a style to this Region use the name RootPane.

SCROLL_BARback to summary
public static final Region SCROLL_BAR

ScrollBar region. To bind a style to this Region use the name ScrollBar.

SCROLL_BAR_THUMBback to summary
public static final Region SCROLL_BAR_THUMB

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.

SCROLL_BAR_TRACKback to summary
public static final Region SCROLL_BAR_TRACK

Track of the ScrollBar. To bind a style to this Region use the name ScrollBarTrack.

SCROLL_PANEback to summary
public static final Region SCROLL_PANE

ScrollPane region. To bind a style to this Region use the name ScrollPane.

SEPARATORback to summary
public static final Region SEPARATOR

Separator region. To bind a style to this Region use the name Separator.

SLIDERback to summary
public static final Region SLIDER

Slider region. To bind a style to this Region use the name Slider.

SLIDER_THUMBback to summary
public static final Region SLIDER_THUMB

Thumb of the Slider. The thumb of the Slider identifies the current value. To bind a style to this Region use the name SliderThumb.

SLIDER_TRACKback to summary
public static final Region SLIDER_TRACK

Track of the Slider. To bind a style to this Region use the name SliderTrack.

SPINNERback to summary
public static final Region SPINNER

Spinner region. To bind a style to this Region use the name Spinner.

SPLIT_PANEback to summary
public static final Region SPLIT_PANE

SplitPane region. To bind a style to this Region use the name SplitPane.

SPLIT_PANE_DIVIDERback to summary
public static final Region SPLIT_PANE_DIVIDER

Divider of the SplitPane. To bind a style to this Region use the name SplitPaneDivider.

subregionback to summary
private final boolean subregion
TABBED_PANEback to summary
public static final Region TABBED_PANE

TabbedPane region. To bind a style to this Region use the name TabbedPane.

TABBED_PANE_CONTENTback to summary
public static final Region TABBED_PANE_CONTENT

Region of a TabbedPane containing the content. To bind a style to this Region use the name TabbedPaneContent.

TABBED_PANE_TABback to summary
public static final Region TABBED_PANE_TAB

Region of a TabbedPane for one tab. To bind a style to this Region use the name TabbedPaneTab.

TABBED_PANE_TAB_AREAback to summary
public static final Region TABBED_PANE_TAB_AREA

Region of a TabbedPane containing the tabs. To bind a style to this Region use the name TabbedPaneTabArea.

TABLEback to summary
public static final Region TABLE

Table region. To bind a style to this Region use the name Table.

TABLE_HEADERback to summary
public static final Region TABLE_HEADER

TableHeader region. To bind a style to this Region use the name TableHeader.

TEXT_AREAback to summary
public static final Region TEXT_AREA

TextArea region. To bind a style to this Region use the name TextArea.

TEXT_FIELDback to summary
public static final Region TEXT_FIELD

TextField region. To bind a style to this Region use the name TextField.

TEXT_PANEback to summary
public static final Region TEXT_PANE

TextPane region. To bind a style to this Region use the name TextPane.

TOGGLE_BUTTONback to summary
public static final Region TOGGLE_BUTTON

ToggleButton region. To bind a style to this Region use the name ToggleButton.

TOOL_BARback to summary
public static final Region TOOL_BAR

ToolBar region. To bind a style to this Region use the name ToolBar.

TOOL_BAR_CONTENTback to summary
public static final Region TOOL_BAR_CONTENT

Region of the ToolBar containing the content. To bind a style to this Region use the name ToolBarContent.

TOOL_BAR_DRAG_WINDOWback to summary
public static final Region TOOL_BAR_DRAG_WINDOW

Region for the Window containing the ToolBar. To bind a style to this Region use the name ToolBarDragWindow.

TOOL_BAR_SEPARATORback to summary
public static final Region TOOL_BAR_SEPARATOR

ToolBar separator region. To bind a style to this Region use the name ToolBarSeparator.

TOOL_TIPback to summary
public static final Region TOOL_TIP

ToolTip region. To bind a style to this Region use the name ToolTip.

TREEback to summary
public static final Region TREE

Tree region. To bind a style to this Region use the name Tree.

TREE_CELLback to summary
public static final Region TREE_CELL

Region of the Tree for one cell. To bind a style to this Region use the name TreeCell.

VIEWPORTback to summary
public static final Region VIEWPORT

Viewport region. To bind a style to this Region use the name Viewport.

Constructor Detail

Regionback to summary
private Region(String name, boolean subregion)
Regionback to summary
protected Region(String name, String ui, boolean subregion)

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.

Parameters
name:String

Name of the region

ui:String

String that will be returned from component.getUIClassID. This will be null if this is a subregion.

subregion:boolean

Whether or not this is a subregion.

Method Detail

getLowerCaseNameback to summary
pack-priv String getLowerCaseName()

Returns the name, in lowercase.

Returns:String

lower case representation of the name of the Region

getLowerCaseNameMapback to summary
private static synchronized Map<Region, String> getLowerCaseNameMap()
getNameback to summary
public String getName()

Returns the name of the region.

Returns:String

name of the Region.

getRegionback to summary
pack-priv static Region getRegion(JComponent c)
getUItoRegionMapback to summary
private static synchronized Map<String, Region> getUItoRegionMap()
isSubregionback to summary
public boolean isSubregion()

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.

Returns:boolean

true if the Region is a subregion of a Component.

registerUIsback to summary
pack-priv static void registerUIs(UIDefaults table)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns the name of the Region.

Returns:String

name of the Region.

Annotations
@Override