javax.swing.plaf.synth
Class Region

java.lang.Object
  extended by javax.swing.plaf.synth.Region

public class Region
extends Object

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. For example, the following shows a custom SynthStyleFactory that returns a specific style for buttons:

    public SynthStyle getStyle(JComponent c, Region id) {
        if (id == Region.BUTTON) {
            return buttonStyle;
        }
        ...
    }
 
The following xml accomplishes the same thing:
 <style id="buttonStyle">
   ...
 </style>
 <bind style="buttonStyle" type="region" key="button"/>
 

Since:
1.5

Field Summary
static Region ARROW_BUTTON
          ArrowButton's are special types of buttons that also render a directional indicator, typically an arrow.
static Region BUTTON
          Button region.
static Region CHECK_BOX
          CheckBox region.
static Region CHECK_BOX_MENU_ITEM
          CheckBoxMenuItem region.
static Region COLOR_CHOOSER
          ColorChooser region.
static Region COMBO_BOX
          ComboBox region.
static Region DESKTOP_ICON
          DesktopIcon region.
static Region DESKTOP_PANE
          DesktopPane region.
static Region EDITOR_PANE
          EditorPane region.
static Region FILE_CHOOSER
          FileChooser region.
static Region FORMATTED_TEXT_FIELD
          FormattedTextField region.
static Region INTERNAL_FRAME
          InternalFrame region.
static Region INTERNAL_FRAME_TITLE_PANE
          TitlePane of an InternalFrame.
static Region LABEL
          Label region.
static Region LIST
          List region.
static Region MENU
          Menu region.
static Region MENU_BAR
          MenuBar region.
static Region MENU_ITEM
          MenuItem region.
static Region MENU_ITEM_ACCELERATOR
          Accelerator region of a MenuItem.
static Region OPTION_PANE
          OptionPane region.
static Region PANEL
          Panel region.
static Region PASSWORD_FIELD
          PasswordField region.
static Region POPUP_MENU
          PopupMenu region.
static Region POPUP_MENU_SEPARATOR
          PopupMenuSeparator region.
static Region PROGRESS_BAR
          ProgressBar region.
static Region RADIO_BUTTON
          RadioButton region.
static Region RADIO_BUTTON_MENU_ITEM
          RegionButtonMenuItem region.
static Region ROOT_PANE
          RootPane region.
static Region SCROLL_BAR
          ScrollBar region.
static Region SCROLL_BAR_THUMB
          Thumb of the ScrollBar.
static Region SCROLL_BAR_TRACK
          Track of the ScrollBar.
static Region SCROLL_PANE
          ScrollPane region.
static Region SEPARATOR
          Separator region.
static Region SLIDER
          Slider region.
static Region SLIDER_THUMB
          Thumb of the Slider.
static Region SLIDER_TRACK
          Track of the Slider.
static Region SPINNER
          Spinner region.
static Region SPLIT_PANE
          SplitPane region.
static Region SPLIT_PANE_DIVIDER
          Divider of the SplitPane.
static Region TABBED_PANE
          TabbedPane region.
static Region TABBED_PANE_CONTENT
          Region of a TabbedPane containing the content.
static Region TABBED_PANE_TAB
          Region of a TabbedPane for one tab.
static Region TABBED_PANE_TAB_AREA
          Region of a TabbedPane containing the tabs.
static Region TABLE
          Table region.
static Region TABLE_HEADER
          TableHeader region.
static Region TEXT_AREA
          TextArea region.
static Region TEXT_FIELD
          TextField region.
static Region TEXT_PANE
          TextPane region.
static Region TOGGLE_BUTTON
          ToggleButton region.
static Region TOOL_BAR
          ToolBar region.
static Region TOOL_BAR_CONTENT
          Region of the ToolBar containing the content.
static Region TOOL_BAR_DRAG_WINDOW
          Region for the Window containing the ToolBar.
static Region TOOL_BAR_SEPARATOR
          ToolBar separator region.
static Region TOOL_TIP
          ToolTip region.
static Region TREE
          Tree region.
static Region TREE_CELL
          Region of the Tree for one cell.
static Region VIEWPORT
          Viewport region.
 
Constructor Summary
protected Region(String name, String ui, boolean subregion)
          Creates a Region with the specified name.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ARROW_BUTTON

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.


BUTTON

public static final Region BUTTON
Button region.


CHECK_BOX

public static final Region CHECK_BOX
CheckBox region.


CHECK_BOX_MENU_ITEM

public static final Region CHECK_BOX_MENU_ITEM
CheckBoxMenuItem region.


COLOR_CHOOSER

public static final Region COLOR_CHOOSER
ColorChooser region.


COMBO_BOX

public static final Region COMBO_BOX
ComboBox region.


DESKTOP_PANE

public static final Region DESKTOP_PANE
DesktopPane region.


DESKTOP_ICON

public static final Region DESKTOP_ICON
DesktopIcon region.


EDITOR_PANE

public static final Region EDITOR_PANE
EditorPane region.


FILE_CHOOSER

public static final Region FILE_CHOOSER
FileChooser region.


FORMATTED_TEXT_FIELD

public static final Region FORMATTED_TEXT_FIELD
FormattedTextField region.


INTERNAL_FRAME

public static final Region INTERNAL_FRAME
InternalFrame region.


INTERNAL_FRAME_TITLE_PANE

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...


LABEL

public static final Region LABEL
Label region.


LIST

public static final Region LIST
List region.


MENU

public static final Region MENU
Menu region.


MENU_BAR

public static final Region MENU_BAR
MenuBar region.


MENU_ITEM

public static final Region MENU_ITEM
MenuItem region.


MENU_ITEM_ACCELERATOR

public static final Region MENU_ITEM_ACCELERATOR
Accelerator region of a MenuItem.


OPTION_PANE

public static final Region OPTION_PANE
OptionPane region.


PANEL

public static final Region PANEL
Panel region.


PASSWORD_FIELD

public static final Region PASSWORD_FIELD
PasswordField region.


POPUP_MENU

public static final Region POPUP_MENU
PopupMenu region.


POPUP_MENU_SEPARATOR

public static final Region POPUP_MENU_SEPARATOR
PopupMenuSeparator region.


PROGRESS_BAR

public static final Region PROGRESS_BAR
ProgressBar region.


RADIO_BUTTON

public static final Region RADIO_BUTTON
RadioButton region.


RADIO_BUTTON_MENU_ITEM

public static final Region RADIO_BUTTON_MENU_ITEM
RegionButtonMenuItem region.


ROOT_PANE

public static final Region ROOT_PANE
RootPane region.


SCROLL_BAR

public static final Region SCROLL_BAR
ScrollBar region.


SCROLL_BAR_TRACK

public static final Region SCROLL_BAR_TRACK
Track of the ScrollBar.


SCROLL_BAR_THUMB

public static final Region SCROLL_BAR_THUMB
Thumb of the ScrollBar. The thumb is the region of the ScrollBar the gives a graphical depiction of what percentage of the View is currently visible.


SCROLL_PANE

public static final Region SCROLL_PANE
ScrollPane region.


SEPARATOR

public static final Region SEPARATOR
Separator region.


SLIDER

public static final Region SLIDER
Slider region.


SLIDER_TRACK

public static final Region SLIDER_TRACK
Track of the Slider.


SLIDER_THUMB

public static final Region SLIDER_THUMB
Thumb of the Slider. The thumb of the Slider identifies the current value.


SPINNER

public static final Region SPINNER
Spinner region.


SPLIT_PANE

public static final Region SPLIT_PANE
SplitPane region.


SPLIT_PANE_DIVIDER

public static final Region SPLIT_PANE_DIVIDER
Divider of the SplitPane.


TABBED_PANE

public static final Region TABBED_PANE
TabbedPane region.


TABBED_PANE_TAB

public static final Region TABBED_PANE_TAB
Region of a TabbedPane for one tab.


TABBED_PANE_TAB_AREA

public static final Region TABBED_PANE_TAB_AREA
Region of a TabbedPane containing the tabs.


TABBED_PANE_CONTENT

public static final Region TABBED_PANE_CONTENT
Region of a TabbedPane containing the content.


TABLE

public static final Region TABLE
Table region.


TABLE_HEADER

public static final Region TABLE_HEADER
TableHeader region.


TEXT_AREA

public static final Region TEXT_AREA
TextArea region.


TEXT_FIELD

public static final Region TEXT_FIELD
TextField region.


TEXT_PANE

public static final Region TEXT_PANE
TextPane region.


TOGGLE_BUTTON

public static final Region TOGGLE_BUTTON
ToggleButton region.


TOOL_BAR

public static final Region TOOL_BAR
ToolBar region.


TOOL_BAR_CONTENT

public static final Region TOOL_BAR_CONTENT
Region of the ToolBar containing the content.


TOOL_BAR_DRAG_WINDOW

public static final Region TOOL_BAR_DRAG_WINDOW
Region for the Window containing the ToolBar.


TOOL_TIP

public static final Region TOOL_TIP
ToolTip region.


TOOL_BAR_SEPARATOR

public static final Region TOOL_BAR_SEPARATOR
ToolBar separator region.


TREE

public static final Region TREE
Tree region.


TREE_CELL

public static final Region TREE_CELL
Region of the Tree for one cell.


VIEWPORT

public static final Region VIEWPORT
Viewport region.

Constructor Detail

Region

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 - 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.
Method Detail

isSubregion

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:
true if the Region is a subregion of a Component.

getName

public String getName()
Returns the name of the region.

Returns:
name of the Region.

toString

public String toString()
Returns the name of the Region.

Overrides:
toString in class Object
Returns:
name of the Region.