Source Code Cross Referenced for Region.java in  » Apache-Harmony-Java-SE » javax-package » javax » swing » plaf » synth » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Apache Harmony Java SE » javax package » javax.swing.plaf.synth 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  Licensed to the Apache Software Foundation (ASF) under one or more
003:         *  contributor license agreements.  See the NOTICE file distributed with
004:         *  this work for additional information regarding copyright ownership.
005:         *  The ASF licenses this file to You under the Apache License, Version 2.0
006:         *  (the "License"); you may not use this file except in compliance with
007:         *  the License.  You may obtain a copy of the License at
008:         *
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         *  Unless required by applicable law or agreed to in writing, software
012:         *  distributed under the License is distributed on an "AS IS" BASIS,
013:         *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         *  See the License for the specific language governing permissions and
015:         *  limitations under the License.
016:         */
017:
018:        package javax.swing.plaf.synth;
019:
020:        import java.util.HashMap;
021:
022:        /**
023:         * Region used to markup the type of JComponent to be painted
024:         */
025:        @SuppressWarnings("nls")
026:        public class Region {
027:
028:            /**
029:             * All regions depository
030:             */
031:            static final HashMap<String, Region> regionsMap = new HashMap<String, Region>();
032:
033:            public static final Region ARROW_BUTTON = new Region("ArrowButton",
034:                    "ArrowButtonUI", true);
035:
036:            public static final Region BUTTON = new Region("Button",
037:                    "ButtonUI", false);
038:
039:            public static final Region CHECK_BOX = new Region("CheckBox",
040:                    "CheckBoxUI", false);
041:
042:            public static final Region CHECK_BOX_MENU_ITEM = new Region(
043:                    "CheckBoxMenuItem", "CheckBoxMenuItemUI", false);
044:
045:            public static final Region COLOR_CHOOSER = new Region(
046:                    "ColorChooser", "ColorChooserUI", false);
047:
048:            public static final Region COMBO_BOX = new Region("ComboBox",
049:                    "ComboBoxUI", false);
050:
051:            public static final Region DESKTOP_ICON = new Region("DesktopIcon",
052:                    "DesktopIconUI", false);
053:
054:            public static final Region DESKTOP_PANE = new Region("DesktopPane",
055:                    "DesktopPaneUI", false);
056:
057:            public static final Region EDITOR_PANE = new Region("EditorPane",
058:                    "EditorPaneUI", false);
059:
060:            public static final Region FILE_CHOOSER = new Region("FileChooser",
061:                    "FileChooserUI", false);
062:
063:            public static final Region FORMATTED_TEXT_FIELD = new Region(
064:                    "FormattedTextField", "FormattedTextFieldUI", false);
065:
066:            public static final Region INTERNAL_FRAME = new Region(
067:                    "InternalFrame", null, false);
068:
069:            public static final Region INTERNAL_FRAME_TITLE_PANE = new Region(
070:                    "InternalFrameTitlePane", "InternalFrameUI", false);
071:
072:            public static final Region LABEL = new Region("Label", "LabelUI",
073:                    false);
074:
075:            public static final Region LIST = new Region("List", "ListUI",
076:                    false);
077:
078:            public static final Region MENU = new Region("Menu", "MenuUI",
079:                    false);
080:
081:            public static final Region MENU_BAR = new Region("MenuBar",
082:                    "MenuBarUI", false);
083:
084:            public static final Region MENU_ITEM = new Region("MenuItem",
085:                    "MenuItemUI", false);
086:
087:            public static final Region MENU_ITEM_ACCELERATOR = new Region(
088:                    "MenuItemAccelerator", "MenuItemAcceleratorUI", false);
089:
090:            public static final Region OPTION_PANE = new Region("OptionPane",
091:                    "OptionPaneUI", false);
092:
093:            public static final Region PANEL = new Region("Panel", "PanelUI",
094:                    false);
095:
096:            public static final Region PASSWORD_FIELD = new Region(
097:                    "PasswordField", "PasswordFieldUI", false);
098:
099:            public static final Region POPUP_MENU = new Region("PopupMenu",
100:                    "PopupMenuUI", false);
101:
102:            public static final Region POPUP_MENU_SEPARATOR = new Region(
103:                    "PopupMenuSeparator", "PopupMenuSeparatorUI", false);
104:
105:            public static final Region PROGRESS_BAR = new Region("ProgressBar",
106:                    "ProgressBarUI", false);
107:
108:            public static final Region RADIO_BUTTON = new Region("RadioButton",
109:                    "RadioButtonUI", false);
110:
111:            public static final Region RADIO_BUTTON_MENU_ITEM = new Region(
112:                    "RadioButtonMenuItem", "RadioButtonMenuItemUI", false);
113:
114:            public static final Region ROOT_PANE = new Region("RootPane",
115:                    "RootPaneUI", false);
116:
117:            public static final Region SCROLL_BAR = new Region("ScrollBar",
118:                    "ScrollBarUI", false);
119:
120:            public static final Region SCROLL_BAR_THUMB = new Region(
121:                    "ScrollBarThumb", null, true);
122:
123:            public static final Region SCROLL_BAR_TRACK = new Region(
124:                    "ScrollBarTrack", null, true);
125:
126:            public static final Region SCROLL_PANE = new Region("ScrollPane",
127:                    "ScrollPaneUI", false);
128:
129:            public static final Region SEPARATOR = new Region("Separator",
130:                    "SeparatorUI", false);
131:
132:            public static final Region SLIDER = new Region("Slider",
133:                    "SliderUI", false);
134:
135:            public static final Region SLIDER_THUMB = new Region("SliderThumb",
136:                    null, true);
137:
138:            public static final Region SLIDER_TRACK = new Region("SliderTrack",
139:                    null, true);
140:
141:            public static final Region SPINNER = new Region("Spinner",
142:                    "SpinnerUI", false);
143:
144:            public static final Region SPLIT_PANE = new Region("SplitPane",
145:                    "SplitPaneUI", false);
146:
147:            public static final Region SPLIT_PANE_DIVIDER = new Region(
148:                    "SplitPaneDivider", null, true);
149:
150:            public static final Region TABBED_PANE = new Region("TabbedPane",
151:                    "TabbedPaneUI", false);
152:
153:            public static final Region TABBED_PANE_CONTENT = new Region(
154:                    "TabbedPaneContent", null, true);
155:
156:            public static final Region TABBED_PANE_TAB = new Region(
157:                    "TabbedPaneTab", null, true);
158:
159:            public static final Region TABBED_PANE_TAB_AREA = new Region(
160:                    "TabbedPaneTabArea", null, true);
161:
162:            public static final Region TABLE = new Region("Table", "TableUI",
163:                    false);
164:
165:            public static final Region TABLE_HEADER = new Region("TableHeader",
166:                    "TableHeaderUI", false);
167:
168:            public static final Region TEXT_AREA = new Region("TextArea",
169:                    "TextAreaUI", false);
170:
171:            public static final Region TEXT_FIELD = new Region("TextField",
172:                    "TextFieldUI", false);
173:
174:            public static final Region TEXT_PANE = new Region("TextPane",
175:                    "TextPaneUI", false);
176:
177:            public static final Region TOGGLE_BUTTON = new Region(
178:                    "ToggleButton", "ToggleButtonUI", false);
179:
180:            public static final Region TOOL_BAR = new Region("ToolBar",
181:                    "ToolBarUI", false);
182:
183:            public static final Region TOOL_BAR_CONTENT = new Region(
184:                    "ToolBarContent", null, true);
185:
186:            public static final Region TOOL_BAR_DRAG_WINDOW = new Region(
187:                    "ToolBarDragWindow", "ToolBarDragWindowUI", false);
188:
189:            public static final Region TOOL_BAR_SEPARATOR = new Region(
190:                    "ToolBarSeparator", "ToolBarSeparatorUI", false);
191:
192:            public static final Region TOOL_TIP = new Region("ToolTip",
193:                    "ToolTipUI", false);
194:
195:            public static final Region TREE = new Region("Tree", "TreeUI",
196:                    false);
197:
198:            public static final Region TREE_CELL = new Region("TreeCell", null,
199:                    true);
200:
201:            public static final Region VIEWPORT = new Region("Viewport",
202:                    "ViewportUI", false);
203:
204:            private String name;
205:
206:            private String ui;
207:
208:            private boolean isSub;
209:
210:            protected Region(String name, String ui, boolean subregion) {
211:                this .name = name;
212:                this .isSub = subregion;
213:                this .ui = ui;
214:                regionsMap.put(name, this );
215:            }
216:
217:            /**
218:             * @return the region corresponds given UI String
219:             */
220:            static Region getRegionFromUIID(String ui) {
221:
222:                // Possible improvement:
223:                // This method creates additional object(substring) but possibly faster
224:                // way is the creating two HashMaps that contains the same values but
225:                // the different keys: UI and name
226:                return regionsMap.get(ui.substring(0, (ui.length() - 2)));
227:            }
228:
229:            public String getName() {
230:
231:                return this .name;
232:            }
233:
234:            public boolean isSubregion() {
235:
236:                return this .isSub;
237:            }
238:
239:            @Override
240:            public String toString() {
241:
242:                return this .ui;
243:            }
244:
245:            /**
246:             * @return the region corresponds given name String
247:             */
248:            static Region getRegionFromName(String reference) {
249:                return regionsMap.get(reference);
250:            }
251:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.