- java.lang.Object
-
- 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
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 aRegion
. The name is derived from the field name of the constant:- Map all characters to lowercase.
- Map the first character to uppercase.
- Map the first character after underscores to uppercase.
- Remove all underscores.
SPLIT_PANE
Region
you would useSplitPane
. The following shows a customSynthStyleFactory
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"/>
- Since:
- 1.5
-
-
Field Summary
Fields Modifier and Type Field and Description 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
Constructors Modifier Constructor and Description protected
Region(String name, String ui, boolean subregion)
Creates a Region with the specified name.
-
Method Summary
Methods Modifier and Type Method and 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.
-
-
-
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. To bind a style to thisRegion
use the nameArrowButton
.
-
BUTTON
public static final Region BUTTON
Button region. To bind a style to thisRegion
use the nameButton
.
-
CHECK_BOX
public static final Region CHECK_BOX
CheckBox region. To bind a style to thisRegion
use the nameCheckBox
.
-
CHECK_BOX_MENU_ITEM
public static final Region CHECK_BOX_MENU_ITEM
CheckBoxMenuItem region. To bind a style to thisRegion
use the nameCheckBoxMenuItem
.
-
COLOR_CHOOSER
public static final Region COLOR_CHOOSER
ColorChooser region. To bind a style to thisRegion
use the nameColorChooser
.
-
COMBO_BOX
public static final Region COMBO_BOX
ComboBox region. To bind a style to thisRegion
use the nameComboBox
.
-
DESKTOP_PANE
public static final Region DESKTOP_PANE
DesktopPane region. To bind a style to thisRegion
use the nameDesktopPane
.
-
DESKTOP_ICON
public static final Region DESKTOP_ICON
DesktopIcon region. To bind a style to thisRegion
use the nameDesktopIcon
.
-
EDITOR_PANE
public static final Region EDITOR_PANE
EditorPane region. To bind a style to thisRegion
use the nameEditorPane
.
-
FILE_CHOOSER
public static final Region FILE_CHOOSER
FileChooser region. To bind a style to thisRegion
use the nameFileChooser
.
-
FORMATTED_TEXT_FIELD
public static final Region FORMATTED_TEXT_FIELD
FormattedTextField region. To bind a style to thisRegion
use the nameFormattedTextField
.
-
INTERNAL_FRAME
public static final Region INTERNAL_FRAME
InternalFrame region. To bind a style to thisRegion
use the nameInternalFrame
.
-
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. To bind a style to thisRegion
use the nameInternalFrameTitlePane
.
-
LABEL
public static final Region LABEL
Label region. To bind a style to thisRegion
use the nameLabel
.
-
LIST
public static final Region LIST
List region. To bind a style to thisRegion
use the nameList
.
-
MENU
public static final Region MENU
Menu region. To bind a style to thisRegion
use the nameMenu
.
-
MENU_BAR
public static final Region MENU_BAR
MenuBar region. To bind a style to thisRegion
use the nameMenuBar
.
-
MENU_ITEM
public static final Region MENU_ITEM
MenuItem region. To bind a style to thisRegion
use the nameMenuItem
.
-
MENU_ITEM_ACCELERATOR
public static final Region MENU_ITEM_ACCELERATOR
Accelerator region of a MenuItem. To bind a style to thisRegion
use the nameMenuItemAccelerator
.
-
OPTION_PANE
public static final Region OPTION_PANE
OptionPane region. To bind a style to thisRegion
use the nameOptionPane
.
-
PANEL
public static final Region PANEL
Panel region. To bind a style to thisRegion
use the namePanel
.
-
PASSWORD_FIELD
public static final Region PASSWORD_FIELD
PasswordField region. To bind a style to thisRegion
use the namePasswordField
.
-
POPUP_MENU
public static final Region POPUP_MENU
PopupMenu region. To bind a style to thisRegion
use the namePopupMenu
.
-
POPUP_MENU_SEPARATOR
public static final Region POPUP_MENU_SEPARATOR
PopupMenuSeparator region. To bind a style to thisRegion
use the namePopupMenuSeparator
.
-
PROGRESS_BAR
public static final Region PROGRESS_BAR
ProgressBar region. To bind a style to thisRegion
use the nameProgressBar
.
-
RADIO_BUTTON
public static final Region RADIO_BUTTON
RadioButton region. To bind a style to thisRegion
use the nameRadioButton
.
-
RADIO_BUTTON_MENU_ITEM
public static final Region RADIO_BUTTON_MENU_ITEM
RegionButtonMenuItem region. To bind a style to thisRegion
use the nameRadioButtonMenuItem
.
-
ROOT_PANE
public static final Region ROOT_PANE
RootPane region. To bind a style to thisRegion
use the nameRootPane
.
-
SCROLL_BAR
public static final Region SCROLL_BAR
ScrollBar region. To bind a style to thisRegion
use the nameScrollBar
.
-
SCROLL_BAR_TRACK
public static final Region SCROLL_BAR_TRACK
Track of the ScrollBar. To bind a style to thisRegion
use the nameScrollBarTrack
.
-
SCROLL_BAR_THUMB
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 thisRegion
use the nameScrollBarThumb
.
-
SCROLL_PANE
public static final Region SCROLL_PANE
ScrollPane region. To bind a style to thisRegion
use the nameScrollPane
.
-
SEPARATOR
public static final Region SEPARATOR
Separator region. To bind a style to thisRegion
use the nameSeparator
.
-
SLIDER
public static final Region SLIDER
Slider region. To bind a style to thisRegion
use the nameSlider
.
-
SLIDER_TRACK
public static final Region SLIDER_TRACK
Track of the Slider. To bind a style to thisRegion
use the nameSliderTrack
.
-
SLIDER_THUMB
public static final Region SLIDER_THUMB
Thumb of the Slider. The thumb of the Slider identifies the current value. To bind a style to thisRegion
use the nameSliderThumb
.
-
SPINNER
public static final Region SPINNER
Spinner region. To bind a style to thisRegion
use the nameSpinner
.
-
SPLIT_PANE
public static final Region SPLIT_PANE
SplitPane region. To bind a style to thisRegion
use the nameSplitPane
.
-
SPLIT_PANE_DIVIDER
public static final Region SPLIT_PANE_DIVIDER
Divider of the SplitPane. To bind a style to thisRegion
use the nameSplitPaneDivider
.
-
TABBED_PANE
public static final Region TABBED_PANE
TabbedPane region. To bind a style to thisRegion
use the nameTabbedPane
.
-
TABBED_PANE_TAB
public static final Region TABBED_PANE_TAB
Region of a TabbedPane for one tab. To bind a style to thisRegion
use the nameTabbedPaneTab
.
-
TABBED_PANE_TAB_AREA
public static final Region TABBED_PANE_TAB_AREA
Region of a TabbedPane containing the tabs. To bind a style to thisRegion
use the nameTabbedPaneTabArea
.
-
TABBED_PANE_CONTENT
public static final Region TABBED_PANE_CONTENT
Region of a TabbedPane containing the content. To bind a style to thisRegion
use the nameTabbedPaneContent
.
-
TABLE
public static final Region TABLE
Table region. To bind a style to thisRegion
use the nameTable
.
-
TABLE_HEADER
public static final Region TABLE_HEADER
TableHeader region. To bind a style to thisRegion
use the nameTableHeader
.
-
TEXT_AREA
public static final Region TEXT_AREA
TextArea region. To bind a style to thisRegion
use the nameTextArea
.
-
TEXT_FIELD
public static final Region TEXT_FIELD
TextField region. To bind a style to thisRegion
use the nameTextField
.
-
TEXT_PANE
public static final Region TEXT_PANE
TextPane region. To bind a style to thisRegion
use the nameTextPane
.
-
TOGGLE_BUTTON
public static final Region TOGGLE_BUTTON
ToggleButton region. To bind a style to thisRegion
use the nameToggleButton
.
-
TOOL_BAR
public static final Region TOOL_BAR
ToolBar region. To bind a style to thisRegion
use the nameToolBar
.
-
TOOL_BAR_CONTENT
public static final Region TOOL_BAR_CONTENT
Region of the ToolBar containing the content. To bind a style to thisRegion
use the nameToolBarContent
.
-
TOOL_BAR_DRAG_WINDOW
public static final Region TOOL_BAR_DRAG_WINDOW
Region for the Window containing the ToolBar. To bind a style to thisRegion
use the nameToolBarDragWindow
.
-
TOOL_TIP
public static final Region TOOL_TIP
ToolTip region. To bind a style to thisRegion
use the nameToolTip
.
-
TOOL_BAR_SEPARATOR
public static final Region TOOL_BAR_SEPARATOR
ToolBar separator region. To bind a style to thisRegion
use the nameToolBarSeparator
.
-
TREE
public static final Region TREE
Tree region. To bind a style to thisRegion
use the nameTree
.
-
TREE_CELL
public static final Region TREE_CELL
Region of the Tree for one cell. To bind a style to thisRegion
use the nameTreeCell
.
-
VIEWPORT
public static final Region VIEWPORT
Viewport region. To bind a style to thisRegion
use the nameViewport
.
-
-
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 ownJComponent
subclass with a customComponentUI
class.- Parameters:
name
- Name of the regionui
- String that will be returned fromcomponent.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 aComponent
so thatRegion.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.
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
05/11/2024 07:56:02 Cette version de la page est en cache (à la date du 05/11/2024 07:56:02) afin d'accélérer le traitement. Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la dernère version de la page.Document créé le 30/08/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-javax/swing/plaf/synth/region.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.