java.applet

java.awt

java.awt.color

java.awt.datatransfer

java.awt.dnd

java.awt.event

java.awt.font

java.awt.geom

java.awt.im

java.awt.im.spi

java.awt.image

java.awt.image.renderable

java.awt.print

java.beans

java.beans.beancontext

java.io

java.lang

java.lang.annotation

java.lang.instrument

java.lang.management

java.lang.ref

java.lang.reflect

java.math

java.net

java.nio

java.nio.channels

java.nio.channels.spi

java.nio.charset

java.nio.charset.spi

java.rmi

java.rmi.activation

java.rmi.dgc

java.rmi.registry

java.rmi.server

java.security

java.security.acl

java.security.cert

java.security.interfaces

java.security.spec

java.sql

java.text

java.util

java.util.concurrent

java.util.concurrent.atomic

java.util.concurrent.locks

java.util.jar

java.util.logging

java.util.prefs

java.util.regex

java.util.zip

javax.accessibility

javax.activity

javax.crypto

javax.crypto.interfaces

javax.crypto.spec

javax.imageio

javax.imageio.event

javax.imageio.metadata

javax.imageio.plugins.bmp

javax.imageio.plugins.jpeg

javax.imageio.spi

javax.imageio.stream

javax.management

javax.management.loading

javax.management.modelmbean

javax.management.monitor

javax.management.openmbean

javax.management.relation

javax.management.remote

javax.management.remote.rmi

javax.management.timer

javax.naming

javax.naming.directory

javax.naming.event

javax.naming.ldap

javax.naming.spi

javax.net

javax.net.ssl

javax.print

javax.print.attribute

javax.print.attribute.standard

javax.print.event

javax.rmi

javax.rmi.CORBA

javax.rmi.ssl

javax.security.auth

javax.security.auth.callback

javax.security.auth.kerberos

javax.security.auth.login

javax.security.auth.spi

javax.security.auth.x500

javax.security.cert

javax.security.sasl

javax.sound.midi

javax.sound.midi.spi

javax.sound.sampled

javax.sound.sampled.spi

javax.sql

javax.sql.rowset

javax.sql.rowset.serial

javax.sql.rowset.spi

javax.swing

javax.swing.border

javax.swing.colorchooser

javax.swing.event

javax.swing.filechooser

javax.swing.plaf

javax.swing.plaf.basic

javax.swing.plaf.metal

javax.swing.plaf.multi

javax.swing.plaf.synth

javax.swing.table

javax.swing.text

javax.swing.text

javax.swing.text.parser

javax.swing.text.rtf

javax.swing.tree

javax.swing.undo

javax.transaction

javax.transaction.xa

javax.xml

javax.xml.datatype

javax.xml.namespace

javax.xml.parsers

javax.xml.transform

javax.xml.transform.dom

javax.xml.transform.sax

javax.xml.transform.stream

javax.xml.validation

javax.xml.xpath

org.ietf.jgss

org.omg.CORBA

org.omg.CORBA_2_3

org.omg.CORBA_2_3.portable

org.omg.CORBA.DynAnyPackage

org.omg.CORBA.ORBPackage

org.omg.CORBA.portable

org.omg.CORBA.TypeCodePackage

org.omg.CosNaming

org.omg.CosNaming.NamingContextExtPackage

org.omg.CosNaming.NamingContextPackage

org.omg.Dynamic

org.omg.DynamicAny

org.omg.DynamicAny.DynAnyFactoryPackage

org.omg.DynamicAny.DynAnyPackage

org.omg.IOP

org.omg.IOP.CodecFactoryPackage

org.omg.IOP.CodecPackage

org.omg.Messaging

org.omg.PortableInterceptor

org.omg.PortableInterceptor.ORBInitInfoPackage

org.omg.PortableServer

org.omg.PortableServer.CurrentPackage

org.omg.PortableServer.POAManagerPackage

org.omg.PortableServer.POAPackage

org.omg.PortableServer.portable

org.omg.PortableServer.ServantLocatorPackage

org.omg.SendingContext

org.omg.stub.java.rmi

org.w3c.dom

org.w3c.dom.bootstrap

org.w3c.dom.events

org.w3c.dom.ls

org.xml.sax

org.xml.sax.ext

org.xml.sax.helpers

allclasses-frame

allclasses-noframe

constant-values

deprecated-list

help-doc

JavaTM 2 Platform
Standard Ed. 5.0

javax.swing.plaf.synth
类 Region

java.lang.Object
  继承者 javax.swing.plaf.synth.Region

public class Region
extends Object

Swing 组件的独特呈现区域。一个组件可以支持一个或多个 region。特定组件 region 由此类中的类型安全枚举定义。

通常使用 region 作为标识将应用特殊样式的 Component 和区域的方法。Synth 的文件格式允许基于 Region 的名称来绑定样式。该名称源自常量的字段名称:

  1. 将所有字符映射为小写字母。
  2. 将第一个字符映射为大写字母。
  3. 将第一个字符加下划线后映射为大写字母。
  4. 移除所有下划线。
例如,要标识 SPLIT_PANE Region,应该使用 SplitPane。以下展示了一个自定义 SynthStyleFactory,它为分隔窗格返回一个特定样式:
    public SynthStyle getStyle(JComponent c, Region id) {
        if (id == Region.SPLIT_PANE) {
            return splitPaneStyle;
        }
        ...
    }
 
以下 xml 实现了相同的目标:
 <style id="splitPaneStyle">
   ...
 </style>
 <bind style="splitPaneStyle" type="region" key="SplitPane"/>
 

从以下版本开始:
1.5

字段摘要
static Region ARROW_BUTTON
          ArrowButton 是特殊类型的按钮,也呈现了一个方向指示器(通常是一个箭头)。
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
          InternalFrame 的 TitlePane。
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
          MenuItem 的加速器 region。
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
          ScrollBar 的 thumb。
static Region SCROLL_BAR_TRACK
          ScrollBar 的滑道。
static Region SCROLL_PANE
          ScrollPane 的 region。
static Region SEPARATOR
          Separator 的 region。
static Region SLIDER
          Slider 的 region。
static Region SLIDER_THUMB
          滑块的 thumb。
static Region SLIDER_TRACK
          Slider 的滑道。
static Region SPINNER
          Spinner 的 region。
static Region SPLIT_PANE
          SplitPane 的 region。
static Region SPLIT_PANE_DIVIDER
          SplitPane 的分隔器。
static Region TABBED_PANE
          TabbedPane 的 region。
static Region TABBED_PANE_CONTENT
          包含内容的 TabbedPane 的 region。
static Region TABBED_PANE_TAB
          某一选项卡的 TabbedPane 的 region。
static Region TABBED_PANE_TAB_AREA
          包含选项卡的 TabbedPane 的 region。
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
          包含内容的 ToolBar 的 region。
static Region TOOL_BAR_DRAG_WINDOW
          包含 ToolBar 的 Window 的 region。
static Region TOOL_BAR_SEPARATOR
          ToolBar 分隔器的 region。
static Region TOOL_TIP
          ToolTip 的 region。
static Region TREE
          Tree 的 region。
static Region TREE_CELL
          用于某一单元格的 Tree 的 region。
static Region VIEWPORT
          Viewport 的 region。
 
构造方法摘要
protected Region(String name, String ui, boolean subregion)
          创建具有指定名称的 Region。
 
方法摘要
 String getName()
          返回 region 的名称。
 boolean isSubregion()
          如果 Region 是 Component 的子 region,则返回 true,否则返回 false。
 String toString()
          返回 Region 的名称。
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

ARROW_BUTTON

public static final Region ARROW_BUTTON
ArrowButton 是特殊类型的按钮,也呈现了一个方向指示器(通常是一个箭头)。ArrowButton 由复合组件使用,例如 ScrollBar 的某些 ArrowButton。要将某一样式绑定到此 Region,使用名称 ArrowButton


BUTTON

public static final Region BUTTON
Button 的 region。要将某一样式绑定到此 Region,使用名称 Button


CHECK_BOX

public static final Region CHECK_BOX
CheckBox 的 region。要将某一样式绑定到此 Region,使用名称 CheckBox


CHECK_BOX_MENU_ITEM

public static final Region CHECK_BOX_MENU_ITEM
CheckBoxMenuItem 的 region。要将某一样式绑定到此 Region,使用名称 CheckBoxMenuItem


COLOR_CHOOSER

public static final Region COLOR_CHOOSER
ColorChooser 的 region。要将某一样式绑定到此 Region,使用名称 ColorChooser


COMBO_BOX

public static final Region COMBO_BOX
ComboBox 的 region。要将某一样式绑定到此 Region,使用名称 ComboBox


DESKTOP_PANE

public static final Region DESKTOP_PANE
DesktopPane 的 region。要将某一样式绑定到此 Region,使用名称 DesktopPane


DESKTOP_ICON

public static final Region DESKTOP_ICON
DesktopIcon 的 region。要将某一样式绑定到此 Region,使用名称 DesktopIcon


EDITOR_PANE

public static final Region EDITOR_PANE
EditorPane 的 region。要将某一样式绑定到此 Region,使用名称 EditorPane


FILE_CHOOSER

public static final Region FILE_CHOOSER
FileChooser 的 region。要将某一样式绑定到此 Region,使用名称 FileChooser


FORMATTED_TEXT_FIELD

public static final Region FORMATTED_TEXT_FIELD
FormattedTextField 的 region。要将某一样式绑定到此 Region,使用名称 FormattedTextField


INTERNAL_FRAME

public static final Region INTERNAL_FRAME
InternalFrame 的 region。要将某一样式绑定到此 Region,使用名称 InternalFrame


INTERNAL_FRAME_TITLE_PANE

public static final Region INTERNAL_FRAME_TITLE_PANE
InternalFrame 的 TitlePane。TitlePane 通常显示操作内部窗体的菜单、标题和窗口小部件。要将某一样式绑定到此 Region,使用名称 InternalFrameTitlePane


LABEL

public static final Region LABEL
Label 的 region。要将某一样式绑定到此 Region,使用名称 Label


LIST

public static final Region LIST
List 的 region。要将某一样式绑定到此 Region,使用名称 List


MENU

public static final Region MENU
Menu 的 region。要将某一样式绑定到此 Region,使用名称 Menu


MENU_BAR

public static final Region MENU_BAR
MenuBar 的 region。要将某一样式绑定到此 Region,使用名称 MenuBar


MENU_ITEM

public static final Region MENU_ITEM
MenuItem 的 region。要将某一样式绑定到此 Region,使用名称 MenuItem


MENU_ITEM_ACCELERATOR

public static final Region MENU_ITEM_ACCELERATOR
MenuItem 的加速器 region。要将某一样式绑定到此 Region,使用名称 MenuItemAccelerator


OPTION_PANE

public static final Region OPTION_PANE
OptionPane 的 region。要将某一样式绑定到此 Region,使用名称 OptionPane


PANEL

public static final Region PANEL
Panel 的 region。要将某一样式绑定到此 Region,使用名称 Panel


PASSWORD_FIELD

public static final Region PASSWORD_FIELD
PasswordField 的 region。要将某一样式绑定到此 Region,使用名称 PasswordField


POPUP_MENU

public static final Region POPUP_MENU
PopupMenu 的 region。要将某一样式绑定到此 Region,使用名称 PopupMenu


POPUP_MENU_SEPARATOR

public static final Region POPUP_MENU_SEPARATOR
PopupMenuSeparator 的 region。要将某一样式绑定到此 Region,使用名称 PopupMenuSeparator


PROGRESS_BAR

public static final Region PROGRESS_BAR
ProgressBar 的 region。要将某一样式绑定到此 Region,使用名称 ProgressBar


RADIO_BUTTON

public static final Region RADIO_BUTTON
RadioButton 的 region。要将某一样式绑定到此 Region,使用名称 RadioButton


RADIO_BUTTON_MENU_ITEM

public static final Region RADIO_BUTTON_MENU_ITEM
RegionButtonMenuItem 的 region。要将某一样式绑定到此 Region,使用名称 RadioButtonMenuItem


ROOT_PANE

public static final Region ROOT_PANE
RootPane 的 region。要将某一样式绑定到此 Region,使用名称 RootPane


SCROLL_BAR

public static final Region SCROLL_BAR
ScrollBar 的 region。要将某一样式绑定到此 Region,使用名称 ScrollBar


SCROLL_BAR_TRACK

public static final Region SCROLL_BAR_TRACK
ScrollBar 的滑道。要将某一样式绑定到此 Region,使用名称 ScrollBarTrack


SCROLL_BAR_THUMB

public static final Region SCROLL_BAR_THUMB
ScrollBar 的 thumb。Thumb 是 ScrollBar 的一个 region,它给出了 View 当前可见百分比的图形描述。要将某一样式绑定到此 Region,使用名称 ScrollBarThumb


SCROLL_PANE

public static final Region SCROLL_PANE
ScrollPane 的 region。要将某一样式绑定到此 Region,使用名称 ScrollPane


SEPARATOR

public static final Region SEPARATOR
Separator 的 region。要将某一样式绑定到此 Region,使用名称 Separator


SLIDER

public static final Region SLIDER
Slider 的 region。要将某一样式绑定到此 Region,使用名称 Slider


SLIDER_TRACK

public static final Region SLIDER_TRACK
Slider 的滑道。要将某一样式绑定到此 Region,使用名称 SliderTrack


SLIDER_THUMB

public static final Region SLIDER_THUMB
滑块的 thumb。滑块的 thumb 标识当前值。要将某一样式绑定到此 Region,使用名称 SliderThumb


SPINNER

public static final Region SPINNER
Spinner 的 region。要将某一样式绑定到此 Region,使用名称 Spinner


SPLIT_PANE

public static final Region SPLIT_PANE
SplitPane 的 region。要将某一样式绑定到此 Region,使用名称 SplitPane


SPLIT_PANE_DIVIDER

public static final Region SPLIT_PANE_DIVIDER
SplitPane 的分隔器。要将某一样式绑定到此 Region,使用名称 SplitPaneDivider


TABBED_PANE

public static final Region TABBED_PANE
TabbedPane 的 region。要将某一样式绑定到此 Region,使用名称 TabbedPane


TABBED_PANE_TAB

public static final Region TABBED_PANE_TAB
某一选项卡的 TabbedPane 的 region。要将某一样式绑定到此 Region,使用名称 TabbedPaneTab


TABBED_PANE_TAB_AREA

public static final Region TABBED_PANE_TAB_AREA
包含选项卡的 TabbedPane 的 region。要将某一样式绑定到此 Region,使用名称 TabbedPaneTabArea


TABBED_PANE_CONTENT

public static final Region TABBED_PANE_CONTENT
包含内容的 TabbedPane 的 region。要将某一样式绑定到此 Region,使用名称 TabbedPaneContent


TABLE

public static final Region TABLE
Table 的 region。要将某一样式绑定到此 Region,使用名称 Table


TABLE_HEADER

public static final Region TABLE_HEADER
TableHeader 的 region。要将某一样式绑定到此 Region,使用名称 TableHeader


TEXT_AREA

public static final Region TEXT_AREA
TextArea 的 region。要将某一样式绑定到此 Region,使用名称 TextArea


TEXT_FIELD

public static final Region TEXT_FIELD
TextField 的 region。要将某一样式绑定到此 Region,使用名称 TextField


TEXT_PANE

public static final Region TEXT_PANE
TextPane 的 region。要将某一样式绑定到此 Region,使用名称 TextPane


TOGGLE_BUTTON

public static final Region TOGGLE_BUTTON
ToggleButton 的 region。要将某一样式绑定到此 Region,使用名称 ToggleButton


TOOL_BAR

public static final Region TOOL_BAR
ToolBar 的 region。要将某一样式绑定到此 Region,使用名称 ToolBar


TOOL_BAR_CONTENT

public static final Region TOOL_BAR_CONTENT
包含内容的 ToolBar 的 region。要将某一样式绑定到此 Region,使用名称 ToolBarContent


TOOL_BAR_DRAG_WINDOW

public static final Region TOOL_BAR_DRAG_WINDOW
包含 ToolBar 的 Window 的 region。要将某一样式绑定到此 Region,使用名称 ToolBarDragWindow


TOOL_TIP

public static final Region TOOL_TIP
ToolTip 的 region。要将某一样式绑定到此 Region,使用名称 ToolTip


TOOL_BAR_SEPARATOR

public static final Region TOOL_BAR_SEPARATOR
ToolBar 分隔器的 region。要将某一样式绑定到此 Region,使用名称 ToolBarSeparator


TREE

public static final Region TREE
Tree 的 region。要将某一样式绑定到此 Region,使用名称 Tree


TREE_CELL

public static final Region TREE_CELL
用于某一单元格的 Tree 的 region。要将某一样式绑定到此 Region,使用名称 TreeCell


VIEWPORT

public static final Region VIEWPORT
Viewport 的 region。要将某一样式绑定到此 Region,使用名称 Viewport

构造方法详细信息

Region

protected Region(String name,
                 String ui,
                 boolean subregion)
创建具有指定名称的 Region。应该只在想使用自定义 ComponentUI 类创建自己的 JComponent 子类时使用此方法。

参数:
name - region 的名称
ui - 将从 component.getUIClassID 中返回的字符串。如果是一个子 region,则该参数将为 null。
subregion - 判断是否是一个子 region。
方法详细信息

isSubregion

public boolean isSubregion()
如果 Region 是 Component 的子 region,则返回 true,否则返回 false。例如,Region.BUTTON 对应于某个 Component,因此 Region.BUTTON.isSubregion() 返回 false。

返回:
如果 Region 是 Component 的子 region,则返回 true。

getName

public String getName()
返回 region 的名称。

返回:
Region 的名称。

toString

public String toString()
返回 Region 的名称。

覆盖:
Object 中的 toString
返回:
Region 的名称。

JavaTM 2 Platform
Standard Ed. 5.0

提交错误或意见
有关更多的 API 参考资料和开发人员文档,请参阅 Java 2 SDK SE 开发人员文档。该文档包含更详细的、面向开发人员的描述,以及总体概述、术语定义、使用技巧和工作代码示例。

版权所有 2004 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策