0N/A/*
2362N/A * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/Apackage javax.swing.plaf.synth;
0N/A
1510N/Aimport sun.awt.AppContext;
1510N/A
1510N/Aimport java.util.HashMap;
1510N/Aimport java.util.Locale;
1510N/Aimport java.util.Map;
1510N/Aimport javax.swing.JComponent;
1510N/Aimport javax.swing.UIDefaults;
0N/A
0N/A/**
0N/A * A distinct rendering area of a Swing component. A component may
0N/A * support one or more regions. Specific component regions are defined
0N/A * by the typesafe enumeration in this class.
0N/A * <p>
0N/A * Regions are typically used as a way to identify the <code>Component</code>s
0N/A * and areas a particular style is to apply to. Synth's file format allows you
0N/A * to bind styles based on the name of a <code>Region</code>.
0N/A * The name is derived from the field name of the constant:
0N/A * <ol>
0N/A * <li>Map all characters to lowercase.
0N/A * <li>Map the first character to uppercase.
0N/A * <li>Map the first character after underscores to uppercase.
0N/A * <li>Remove all underscores.
0N/A * </ol>
0N/A * For example, to identify the <code>SPLIT_PANE</code>
0N/A * <code>Region</code> you would use <code>SplitPane</code>.
0N/A * The following shows a custom <code>SynthStyleFactory</code>
0N/A * that returns a specific style for split panes:
0N/A * <pre>
0N/A * public SynthStyle getStyle(JComponent c, Region id) {
0N/A * if (id == Region.SPLIT_PANE) {
0N/A * return splitPaneStyle;
0N/A * }
0N/A * ...
0N/A * }
0N/A * </pre>
0N/A * The following <a href="doc-files/synthFileFormat.html">xml</a>
0N/A * accomplishes the same thing:
0N/A * <pre>
0N/A * &lt;style id="splitPaneStyle">
0N/A * ...
0N/A * &lt;/style>
0N/A * &lt;bind style="splitPaneStyle" type="region" key="SplitPane"/>
0N/A * </pre>
0N/A *
0N/A * @since 1.5
0N/A * @author Scott Violet
0N/A */
0N/Apublic class Region {
1510N/A private static final Object UI_TO_REGION_MAP_KEY = new Object();
1510N/A private static final Object LOWER_CASE_NAME_MAP_KEY = new Object();
0N/A
0N/A /**
0N/A * ArrowButton's are special types of buttons that also render a
0N/A * directional indicator, typically an arrow. ArrowButtons are used by
0N/A * composite components, for example ScrollBar's contain ArrowButtons.
0N/A * To bind a style to this <code>Region</code> use the name
0N/A * <code>ArrowButton</code>.
0N/A */
1510N/A public static final Region ARROW_BUTTON = new Region("ArrowButton", false);
0N/A
0N/A /**
0N/A * Button region. To bind a style to this <code>Region</code> use the name
0N/A * <code>Button</code>.
0N/A */
1510N/A public static final Region BUTTON = new Region("Button", false);
0N/A
0N/A /**
0N/A * CheckBox region. To bind a style to this <code>Region</code> use the name
0N/A * <code>CheckBox</code>.
0N/A */
1510N/A public static final Region CHECK_BOX = new Region("CheckBox", false);
0N/A
0N/A /**
0N/A * CheckBoxMenuItem region. To bind a style to this <code>Region</code> use
0N/A * the name <code>CheckBoxMenuItem</code>.
0N/A */
1510N/A public static final Region CHECK_BOX_MENU_ITEM = new Region("CheckBoxMenuItem", false);
0N/A
0N/A /**
0N/A * ColorChooser region. To bind a style to this <code>Region</code> use
0N/A * the name <code>ColorChooser</code>.
0N/A */
1510N/A public static final Region COLOR_CHOOSER = new Region("ColorChooser", false);
0N/A
0N/A /**
0N/A * ComboBox region. To bind a style to this <code>Region</code> use
0N/A * the name <code>ComboBox</code>.
0N/A */
1510N/A public static final Region COMBO_BOX = new Region("ComboBox", false);
0N/A
0N/A /**
0N/A * DesktopPane region. To bind a style to this <code>Region</code> use
0N/A * the name <code>DesktopPane</code>.
0N/A */
1510N/A public static final Region DESKTOP_PANE = new Region("DesktopPane", false);
1510N/A
0N/A /**
0N/A * DesktopIcon region. To bind a style to this <code>Region</code> use
0N/A * the name <code>DesktopIcon</code>.
0N/A */
1510N/A public static final Region DESKTOP_ICON = new Region("DesktopIcon", false);
0N/A
0N/A /**
0N/A * EditorPane region. To bind a style to this <code>Region</code> use
0N/A * the name <code>EditorPane</code>.
0N/A */
1510N/A public static final Region EDITOR_PANE = new Region("EditorPane", false);
0N/A
0N/A /**
0N/A * FileChooser region. To bind a style to this <code>Region</code> use
0N/A * the name <code>FileChooser</code>.
0N/A */
1510N/A public static final Region FILE_CHOOSER = new Region("FileChooser", false);
0N/A
0N/A /**
0N/A * FormattedTextField region. To bind a style to this <code>Region</code> use
0N/A * the name <code>FormattedTextField</code>.
0N/A */
1510N/A public static final Region FORMATTED_TEXT_FIELD = new Region("FormattedTextField", false);
0N/A
0N/A /**
0N/A * InternalFrame region. To bind a style to this <code>Region</code> use
0N/A * the name <code>InternalFrame</code>.
0N/A */
1510N/A public static final Region INTERNAL_FRAME = new Region("InternalFrame", false);
1510N/A
0N/A /**
0N/A * TitlePane of an InternalFrame. The TitlePane typically
0N/A * shows a menu, title, widgets to manipulate the internal frame.
0N/A * To bind a style to this <code>Region</code> use the name
0N/A * <code>InternalFrameTitlePane</code>.
0N/A */
1510N/A public static final Region INTERNAL_FRAME_TITLE_PANE = new Region("InternalFrameTitlePane", false);
0N/A
0N/A /**
0N/A * Label region. To bind a style to this <code>Region</code> use the name
0N/A * <code>Label</code>.
0N/A */
1510N/A public static final Region LABEL = new Region("Label", false);
0N/A
0N/A /**
0N/A * List region. To bind a style to this <code>Region</code> use the name
0N/A * <code>List</code>.
0N/A */
1510N/A public static final Region LIST = new Region("List", false);
0N/A
0N/A /**
0N/A * Menu region. To bind a style to this <code>Region</code> use the name
0N/A * <code>Menu</code>.
0N/A */
1510N/A public static final Region MENU = new Region("Menu", false);
0N/A
0N/A /**
0N/A * MenuBar region. To bind a style to this <code>Region</code> use the name
0N/A * <code>MenuBar</code>.
0N/A */
1510N/A public static final Region MENU_BAR = new Region("MenuBar", false);
0N/A
0N/A /**
0N/A * MenuItem region. To bind a style to this <code>Region</code> use the name
0N/A * <code>MenuItem</code>.
0N/A */
1510N/A public static final Region MENU_ITEM = new Region("MenuItem", false);
0N/A
0N/A /**
0N/A * Accelerator region of a MenuItem. To bind a style to this
0N/A * <code>Region</code> use the name <code>MenuItemAccelerator</code>.
0N/A */
1510N/A public static final Region MENU_ITEM_ACCELERATOR = new Region("MenuItemAccelerator", true);
0N/A
0N/A /**
0N/A * OptionPane region. To bind a style to this <code>Region</code> use
0N/A * the name <code>OptionPane</code>.
0N/A */
1510N/A public static final Region OPTION_PANE = new Region("OptionPane", false);
0N/A
0N/A /**
0N/A * Panel region. To bind a style to this <code>Region</code> use the name
0N/A * <code>Panel</code>.
0N/A */
1510N/A public static final Region PANEL = new Region("Panel", false);
0N/A
0N/A /**
0N/A * PasswordField region. To bind a style to this <code>Region</code> use
0N/A * the name <code>PasswordField</code>.
0N/A */
1510N/A public static final Region PASSWORD_FIELD = new Region("PasswordField", false);
0N/A
0N/A /**
0N/A * PopupMenu region. To bind a style to this <code>Region</code> use
0N/A * the name <code>PopupMenu</code>.
0N/A */
1510N/A public static final Region POPUP_MENU = new Region("PopupMenu", false);
0N/A
0N/A /**
0N/A * PopupMenuSeparator region. To bind a style to this <code>Region</code>
0N/A * use the name <code>PopupMenuSeparator</code>.
0N/A */
1510N/A public static final Region POPUP_MENU_SEPARATOR = new Region("PopupMenuSeparator", false);
0N/A
0N/A /**
0N/A * ProgressBar region. To bind a style to this <code>Region</code>
0N/A * use the name <code>ProgressBar</code>.
0N/A */
1510N/A public static final Region PROGRESS_BAR = new Region("ProgressBar", false);
0N/A
0N/A /**
0N/A * RadioButton region. To bind a style to this <code>Region</code>
0N/A * use the name <code>RadioButton</code>.
0N/A */
1510N/A public static final Region RADIO_BUTTON = new Region("RadioButton", false);
0N/A
0N/A /**
0N/A * RegionButtonMenuItem region. To bind a style to this <code>Region</code>
0N/A * use the name <code>RadioButtonMenuItem</code>.
0N/A */
1510N/A public static final Region RADIO_BUTTON_MENU_ITEM = new Region("RadioButtonMenuItem", false);
0N/A
0N/A /**
0N/A * RootPane region. To bind a style to this <code>Region</code> use
0N/A * the name <code>RootPane</code>.
0N/A */
1510N/A public static final Region ROOT_PANE = new Region("RootPane", false);
0N/A
0N/A /**
0N/A * ScrollBar region. To bind a style to this <code>Region</code> use
0N/A * the name <code>ScrollBar</code>.
0N/A */
1510N/A public static final Region SCROLL_BAR = new Region("ScrollBar", false);
1510N/A
0N/A /**
0N/A * Track of the ScrollBar. To bind a style to this <code>Region</code> use
0N/A * the name <code>ScrollBarTrack</code>.
0N/A */
1510N/A public static final Region SCROLL_BAR_TRACK = new Region("ScrollBarTrack", true);
1510N/A
0N/A /**
0N/A * Thumb of the ScrollBar. The thumb is the region of the ScrollBar
0N/A * that gives a graphical depiction of what percentage of the View is
0N/A * currently visible. To bind a style to this <code>Region</code> use
0N/A * the name <code>ScrollBarThumb</code>.
0N/A */
1510N/A public static final Region SCROLL_BAR_THUMB = new Region("ScrollBarThumb", true);
0N/A
0N/A /**
0N/A * ScrollPane region. To bind a style to this <code>Region</code> use
0N/A * the name <code>ScrollPane</code>.
0N/A */
1510N/A public static final Region SCROLL_PANE = new Region("ScrollPane", false);
0N/A
0N/A /**
0N/A * Separator region. To bind a style to this <code>Region</code> use
0N/A * the name <code>Separator</code>.
0N/A */
1510N/A public static final Region SEPARATOR = new Region("Separator", false);
0N/A
0N/A /**
0N/A * Slider region. To bind a style to this <code>Region</code> use
0N/A * the name <code>Slider</code>.
0N/A */
1510N/A public static final Region SLIDER = new Region("Slider", false);
1510N/A
0N/A /**
0N/A * Track of the Slider. To bind a style to this <code>Region</code> use
0N/A * the name <code>SliderTrack</code>.
0N/A */
1510N/A public static final Region SLIDER_TRACK = new Region("SliderTrack", true);
1510N/A
0N/A /**
0N/A * Thumb of the Slider. The thumb of the Slider identifies the current
0N/A * value. To bind a style to this <code>Region</code> use the name
0N/A * <code>SliderThumb</code>.
0N/A */
1510N/A public static final Region SLIDER_THUMB = new Region("SliderThumb", true);
0N/A
0N/A /**
0N/A * Spinner region. To bind a style to this <code>Region</code> use the name
0N/A * <code>Spinner</code>.
0N/A */
1510N/A public static final Region SPINNER = new Region("Spinner", false);
0N/A
0N/A /**
0N/A * SplitPane region. To bind a style to this <code>Region</code> use the name
0N/A * <code>SplitPane</code>.
0N/A */
1510N/A public static final Region SPLIT_PANE = new Region("SplitPane", false);
0N/A
0N/A /**
0N/A * Divider of the SplitPane. To bind a style to this <code>Region</code>
0N/A * use the name <code>SplitPaneDivider</code>.
0N/A */
1510N/A public static final Region SPLIT_PANE_DIVIDER = new Region("SplitPaneDivider", true);
0N/A
0N/A /**
0N/A * TabbedPane region. To bind a style to this <code>Region</code> use
0N/A * the name <code>TabbedPane</code>.
0N/A */
1510N/A public static final Region TABBED_PANE = new Region("TabbedPane", false);
1510N/A
0N/A /**
0N/A * Region of a TabbedPane for one tab. To bind a style to this
0N/A * <code>Region</code> use the name <code>TabbedPaneTab</code>.
0N/A */
1510N/A public static final Region TABBED_PANE_TAB = new Region("TabbedPaneTab", true);
1510N/A
0N/A /**
0N/A * Region of a TabbedPane containing the tabs. To bind a style to this
0N/A * <code>Region</code> use the name <code>TabbedPaneTabArea</code>.
0N/A */
1510N/A public static final Region TABBED_PANE_TAB_AREA = new Region("TabbedPaneTabArea", true);
1510N/A
0N/A /**
0N/A * Region of a TabbedPane containing the content. To bind a style to this
0N/A * <code>Region</code> use the name <code>TabbedPaneContent</code>.
0N/A */
1510N/A public static final Region TABBED_PANE_CONTENT = new Region("TabbedPaneContent", true);
0N/A
0N/A /**
0N/A * Table region. To bind a style to this <code>Region</code> use
0N/A * the name <code>Table</code>.
0N/A */
1510N/A public static final Region TABLE = new Region("Table", false);
0N/A
0N/A /**
0N/A * TableHeader region. To bind a style to this <code>Region</code> use
0N/A * the name <code>TableHeader</code>.
0N/A */
1510N/A public static final Region TABLE_HEADER = new Region("TableHeader", false);
1510N/A
0N/A /**
0N/A * TextArea region. To bind a style to this <code>Region</code> use
0N/A * the name <code>TextArea</code>.
0N/A */
1510N/A public static final Region TEXT_AREA = new Region("TextArea", false);
0N/A
0N/A /**
0N/A * TextField region. To bind a style to this <code>Region</code> use
0N/A * the name <code>TextField</code>.
0N/A */
1510N/A public static final Region TEXT_FIELD = new Region("TextField", false);
0N/A
0N/A /**
0N/A * TextPane region. To bind a style to this <code>Region</code> use
0N/A * the name <code>TextPane</code>.
0N/A */
1510N/A public static final Region TEXT_PANE = new Region("TextPane", false);
0N/A
0N/A /**
0N/A * ToggleButton region. To bind a style to this <code>Region</code> use
0N/A * the name <code>ToggleButton</code>.
0N/A */
1510N/A public static final Region TOGGLE_BUTTON = new Region("ToggleButton", false);
0N/A
0N/A /**
0N/A * ToolBar region. To bind a style to this <code>Region</code> use
0N/A * the name <code>ToolBar</code>.
0N/A */
1510N/A public static final Region TOOL_BAR = new Region("ToolBar", false);
1510N/A
0N/A /**
0N/A * Region of the ToolBar containing the content. To bind a style to this
0N/A * <code>Region</code> use the name <code>ToolBarContent</code>.
0N/A */
1510N/A public static final Region TOOL_BAR_CONTENT = new Region("ToolBarContent", true);
1510N/A
0N/A /**
0N/A * Region for the Window containing the ToolBar. To bind a style to this
0N/A * <code>Region</code> use the name <code>ToolBarDragWindow</code>.
0N/A */
1510N/A public static final Region TOOL_BAR_DRAG_WINDOW = new Region("ToolBarDragWindow", false);
0N/A
0N/A /**
0N/A * ToolTip region. To bind a style to this <code>Region</code> use
0N/A * the name <code>ToolTip</code>.
0N/A */
1510N/A public static final Region TOOL_TIP = new Region("ToolTip", false);
0N/A
0N/A /**
0N/A * ToolBar separator region. To bind a style to this <code>Region</code> use
0N/A * the name <code>ToolBarSeparator</code>.
0N/A */
1510N/A public static final Region TOOL_BAR_SEPARATOR = new Region("ToolBarSeparator", false);
0N/A
0N/A /**
0N/A * Tree region. To bind a style to this <code>Region</code> use the name
0N/A * <code>Tree</code>.
0N/A */
1510N/A public static final Region TREE = new Region("Tree", false);
1510N/A
0N/A /**
0N/A * Region of the Tree for one cell. To bind a style to this
0N/A * <code>Region</code> use the name <code>TreeCell</code>.
0N/A */
1510N/A public static final Region TREE_CELL = new Region("TreeCell", true);
0N/A
0N/A /**
0N/A * Viewport region. To bind a style to this <code>Region</code> use
0N/A * the name <code>Viewport</code>.
0N/A */
1510N/A public static final Region VIEWPORT = new Region("Viewport", false);
0N/A
1510N/A private static Map<String, Region> getUItoRegionMap() {
1510N/A AppContext context = AppContext.getAppContext();
1510N/A Map<String, Region> map = (Map<String, Region>) context.get(UI_TO_REGION_MAP_KEY);
1510N/A if (map == null) {
1510N/A map = new HashMap<String, Region>();
1510N/A map.put("ArrowButtonUI", ARROW_BUTTON);
1510N/A map.put("ButtonUI", BUTTON);
1510N/A map.put("CheckBoxUI", CHECK_BOX);
1510N/A map.put("CheckBoxMenuItemUI", CHECK_BOX_MENU_ITEM);
1510N/A map.put("ColorChooserUI", COLOR_CHOOSER);
1510N/A map.put("ComboBoxUI", COMBO_BOX);
1510N/A map.put("DesktopPaneUI", DESKTOP_PANE);
1510N/A map.put("DesktopIconUI", DESKTOP_ICON);
1510N/A map.put("EditorPaneUI", EDITOR_PANE);
1510N/A map.put("FileChooserUI", FILE_CHOOSER);
1510N/A map.put("FormattedTextFieldUI", FORMATTED_TEXT_FIELD);
1510N/A map.put("InternalFrameUI", INTERNAL_FRAME);
1510N/A map.put("InternalFrameTitlePaneUI", INTERNAL_FRAME_TITLE_PANE);
1510N/A map.put("LabelUI", LABEL);
1510N/A map.put("ListUI", LIST);
1510N/A map.put("MenuUI", MENU);
1510N/A map.put("MenuBarUI", MENU_BAR);
1510N/A map.put("MenuItemUI", MENU_ITEM);
1510N/A map.put("OptionPaneUI", OPTION_PANE);
1510N/A map.put("PanelUI", PANEL);
1510N/A map.put("PasswordFieldUI", PASSWORD_FIELD);
1510N/A map.put("PopupMenuUI", POPUP_MENU);
1510N/A map.put("PopupMenuSeparatorUI", POPUP_MENU_SEPARATOR);
1510N/A map.put("ProgressBarUI", PROGRESS_BAR);
1510N/A map.put("RadioButtonUI", RADIO_BUTTON);
1510N/A map.put("RadioButtonMenuItemUI", RADIO_BUTTON_MENU_ITEM);
1510N/A map.put("RootPaneUI", ROOT_PANE);
1510N/A map.put("ScrollBarUI", SCROLL_BAR);
1510N/A map.put("ScrollPaneUI", SCROLL_PANE);
1510N/A map.put("SeparatorUI", SEPARATOR);
1510N/A map.put("SliderUI", SLIDER);
1510N/A map.put("SpinnerUI", SPINNER);
1510N/A map.put("SplitPaneUI", SPLIT_PANE);
1510N/A map.put("TabbedPaneUI", TABBED_PANE);
1510N/A map.put("TableUI", TABLE);
1510N/A map.put("TableHeaderUI", TABLE_HEADER);
1510N/A map.put("TextAreaUI", TEXT_AREA);
1510N/A map.put("TextFieldUI", TEXT_FIELD);
1510N/A map.put("TextPaneUI", TEXT_PANE);
1510N/A map.put("ToggleButtonUI", TOGGLE_BUTTON);
1510N/A map.put("ToolBarUI", TOOL_BAR);
1510N/A map.put("ToolTipUI", TOOL_TIP);
1510N/A map.put("ToolBarSeparatorUI", TOOL_BAR_SEPARATOR);
1510N/A map.put("TreeUI", TREE);
1510N/A map.put("ViewportUI", VIEWPORT);
1510N/A context.put(UI_TO_REGION_MAP_KEY, map);
1510N/A }
1510N/A return map;
1510N/A }
0N/A
1510N/A private static Map<Region, String> getLowerCaseNameMap() {
1510N/A AppContext context = AppContext.getAppContext();
1510N/A Map<Region, String> map = (Map<Region, String>) context.get(LOWER_CASE_NAME_MAP_KEY);
1510N/A if (map == null) {
1510N/A map = new HashMap<Region, String>();
1510N/A context.put(LOWER_CASE_NAME_MAP_KEY, map);
1510N/A }
1510N/A return map;
1510N/A }
0N/A
0N/A static Region getRegion(JComponent c) {
1510N/A return getUItoRegionMap().get(c.getUIClassID());
0N/A }
0N/A
0N/A static void registerUIs(UIDefaults table) {
1510N/A for (Object key : getUItoRegionMap().keySet()) {
0N/A table.put(key, "javax.swing.plaf.synth.SynthLookAndFeel");
0N/A }
0N/A }
0N/A
1510N/A private final String name;
1510N/A private final boolean subregion;
0N/A
1510N/A private Region(String name, boolean subregion) {
1510N/A if (name == null) {
1510N/A throw new NullPointerException("You must specify a non-null name");
1510N/A }
1510N/A this.name = name;
1510N/A this.subregion = subregion;
0N/A }
0N/A
0N/A /**
0N/A * Creates a Region with the specified name. This should only be
0N/A * used if you are creating your own <code>JComponent</code> subclass
0N/A * with a custom <code>ComponentUI</code> class.
0N/A *
0N/A * @param name Name of the region
0N/A * @param ui String that will be returned from
0N/A * <code>component.getUIClassID</code>. This will be null
0N/A * if this is a subregion.
0N/A * @param subregion Whether or not this is a subregion.
0N/A */
0N/A protected Region(String name, String ui, boolean subregion) {
1510N/A this(name, subregion);
1510N/A if (ui != null) {
1510N/A getUItoRegionMap().put(ui, this);
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Returns true if the Region is a subregion of a Component, otherwise
0N/A * false. For example, <code>Region.BUTTON</code> corresponds do a
0N/A * <code>Component</code> so that <code>Region.BUTTON.isSubregion()</code>
0N/A * returns false.
0N/A *
0N/A * @return true if the Region is a subregion of a Component.
0N/A */
0N/A public boolean isSubregion() {
0N/A return subregion;
0N/A }
0N/A
0N/A /**
0N/A * Returns the name of the region.
0N/A *
0N/A * @return name of the Region.
0N/A */
0N/A public String getName() {
0N/A return name;
0N/A }
0N/A
0N/A /**
0N/A * Returns the name, in lowercase.
1510N/A *
1510N/A * @return lower case representation of the name of the Region
0N/A */
0N/A String getLowerCaseName() {
1510N/A Map<Region, String> lowerCaseNameMap = getLowerCaseNameMap();
1510N/A String lowerCaseName = lowerCaseNameMap.get(this);
1510N/A if (lowerCaseName == null) {
1510N/A lowerCaseName = name.toLowerCase(Locale.ENGLISH);
1510N/A lowerCaseNameMap.put(this, lowerCaseName);
0N/A }
1510N/A return lowerCaseName;
0N/A }
0N/A
0N/A /**
0N/A * Returns the name of the Region.
0N/A *
0N/A * @return name of the Region.
0N/A */
1510N/A @Override
0N/A public String toString() {
0N/A return name;
0N/A }
0N/A}