Source Code Cross Referenced for MacLayoutStyle.java in  » Swing-Library » jgoodies-forms » com » jgoodies » forms » util » 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 » Swing Library » jgoodies forms » com.jgoodies.forms.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 2002-2007 JGoodies Karsten Lentzsch. All Rights Reserved.
003:         *
004:         * Redistribution and use in source and binary forms, with or without 
005:         * modification, are permitted provided that the following conditions are met:
006:         * 
007:         *  o Redistributions of source code must retain the above copyright notice, 
008:         *    this list of conditions and the following disclaimer. 
009:         *     
010:         *  o Redistributions in binary form must reproduce the above copyright notice, 
011:         *    this list of conditions and the following disclaimer in the documentation 
012:         *    and/or other materials provided with the distribution. 
013:         *     
014:         *  o Neither the name of JGoodies Karsten Lentzsch nor the names of 
015:         *    its contributors may be used to endorse or promote products derived 
016:         *    from this software without specific prior written permission. 
017:         *     
018:         * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
019:         * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
020:         * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
021:         * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
022:         * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
023:         * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
024:         * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 
025:         * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026:         * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 
027:         * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
028:         * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
029:         */
030:
031:        package com.jgoodies.forms.util;
032:
033:        import com.jgoodies.forms.layout.ConstantSize;
034:        import com.jgoodies.forms.layout.Size;
035:        import com.jgoodies.forms.layout.Sizes;
036:
037:        /**
038:         * A {@link LayoutStyle} that aims to provide layout constants as defined by
039:         * Microsoft's <i>Design Specifications and Guidelines - Visual Design</i>.
040:         *
041:         * @author Karsten Lentzsch
042:         * @version $Revision: 1.2 $
043:         */
044:
045:        final class MacLayoutStyle extends LayoutStyle {
046:
047:            static final MacLayoutStyle INSTANCE = new MacLayoutStyle();
048:
049:            private MacLayoutStyle() {
050:                // Suppresses default constructor, ensuring non-instantiability.
051:            }
052:
053:            // Component Sizes ******************************************************
054:
055:            private static final Size BUTTON_WIDTH = Sizes.dluX(39);
056:            private static final Size BUTTON_HEIGHT = Sizes.dluY(14);
057:
058:            // Gaps ******************************************************************
059:
060:            private static final ConstantSize DIALOG_MARGIN_X = Sizes.DLUX9;
061:            private static final ConstantSize DIALOG_MARGIN_Y = Sizes.DLUY9;
062:
063:            private static final ConstantSize TABBED_DIALOG_MARGIN_X = Sizes.DLUX4;
064:            private static final ConstantSize TABBED_DIALOG_MARGIN_Y = Sizes.DLUY4;
065:
066:            private static final ConstantSize LABEL_COMPONENT_PADX = Sizes.DLUX3;
067:            private static final ConstantSize RELATED_COMPONENTS_PADX = Sizes.DLUX4;
068:            private static final ConstantSize UNRELATED_COMPONENTS_PADX = Sizes.DLUX8;
069:
070:            private static final ConstantSize RELATED_COMPONENTS_PADY = Sizes.DLUY3;
071:            private static final ConstantSize UNRELATED_COMPONENTS_PADY = Sizes.DLUY6;
072:            private static final ConstantSize NARROW_LINE_PAD = Sizes.DLUY2;
073:            private static final ConstantSize LINE_PAD = Sizes.DLUY3;
074:            private static final ConstantSize PARAGRAPH_PAD = Sizes.DLUY9;
075:            private static final ConstantSize BUTTON_BAR_PAD = Sizes.DLUY4;
076:
077:            // Layout Sizes *********************************************************
078:
079:            /**
080:             * Returns this style's default button width.
081:             * 
082:             * @return the default button width
083:             * 
084:             * @see #getDefaultButtonHeight()
085:             */
086:            public Size getDefaultButtonWidth() {
087:                return BUTTON_WIDTH;
088:            }
089:
090:            /**
091:             * Returns this style's default button height.
092:             * 
093:             * @return the default button height
094:             * 
095:             * @see #getDefaultButtonWidth()
096:             */
097:            public Size getDefaultButtonHeight() {
098:                return BUTTON_HEIGHT;
099:            }
100:
101:            /**
102:             * Returns this style's horizontal margin for general dialogs.
103:             * 
104:             * @return the horizontal margin for general dialogs
105:             * 
106:             * @see #getDialogMarginY()
107:             * @see #getTabbedDialogMarginX()
108:             */
109:            public ConstantSize getDialogMarginX() {
110:                return DIALOG_MARGIN_X;
111:            }
112:
113:            /**
114:             * Returns this style's vertical margin for general dialogs.
115:             * 
116:             * @return the vertical margin for general dialogs
117:             * 
118:             * @see #getDialogMarginX()
119:             * @see #getTabbedDialogMarginY()
120:             */
121:            public ConstantSize getDialogMarginY() {
122:                return DIALOG_MARGIN_Y;
123:            }
124:
125:            /**
126:             * Returns this style's horizontal margin for dialogs that consist of 
127:             * a tabbed pane.
128:             * 
129:             * @return the horizontal margin for dialogs that consist of a tabbed pane
130:             * @since 1.0.3
131:             * 
132:             * @see #getTabbedDialogMarginY()
133:             * @see #getDialogMarginX()
134:             */
135:            public ConstantSize getTabbedDialogMarginX() {
136:                return TABBED_DIALOG_MARGIN_X;
137:            }
138:
139:            /**
140:             * Returns this style's vertical margin for dialogs that consist of
141:             * a tabbed pane.
142:             * 
143:             * @return the vertical margin for dialogs that consist of a tabbed pane
144:             * @since 1.0.3
145:             * 
146:             * @see #getTabbedDialogMarginX()
147:             * @see #getDialogMarginY()
148:             */
149:            public ConstantSize getTabbedDialogMarginY() {
150:                return TABBED_DIALOG_MARGIN_Y;
151:            }
152:
153:            /**
154:             * Returns a gap used to separate a label and associated control.
155:             * 
156:             * @return a gap between label and associated control
157:             * 
158:             * @see #getRelatedComponentsPadX()
159:             * @see #getUnrelatedComponentsPadX()
160:             */
161:            public ConstantSize getLabelComponentPadX() {
162:                return LABEL_COMPONENT_PADX;
163:            }
164:
165:            /**
166:             * Returns a horizontal gap used to separate related controls.
167:             * 
168:             * @return a horizontal gap between related controls
169:             * 
170:             * @see #getLabelComponentPadX()
171:             * @see #getRelatedComponentsPadY()
172:             * @see #getUnrelatedComponentsPadX()
173:             */
174:            public ConstantSize getRelatedComponentsPadX() {
175:                return RELATED_COMPONENTS_PADX;
176:            }
177:
178:            /**
179:             * Returns a vertical gap used to separate related controls.
180:             * 
181:             * @return a vertical gap between related controls
182:             * 
183:             * @see #getRelatedComponentsPadX()
184:             * @see #getUnrelatedComponentsPadY()
185:             */
186:            public ConstantSize getRelatedComponentsPadY() {
187:                return RELATED_COMPONENTS_PADY;
188:            }
189:
190:            /**
191:             * Returns a horizontal gap used to separate unrelated controls.
192:             * 
193:             * @return a horizontal gap between unrelated controls
194:             * 
195:             * @see #getLabelComponentPadX()
196:             * @see #getUnrelatedComponentsPadY()
197:             * @see #getRelatedComponentsPadX()
198:             */
199:            public ConstantSize getUnrelatedComponentsPadX() {
200:                return UNRELATED_COMPONENTS_PADX;
201:            }
202:
203:            /**
204:             * Returns a vertical gap used to separate unrelated controls.
205:             * 
206:             * @return a vertical gap between unrelated controls
207:             * 
208:             * @see #getUnrelatedComponentsPadX()
209:             * @see #getRelatedComponentsPadY()
210:             */
211:            public ConstantSize getUnrelatedComponentsPadY() {
212:                return UNRELATED_COMPONENTS_PADY;
213:            }
214:
215:            /**
216:             * Returns a narrow vertical pad used to separate lines.
217:             * 
218:             * @return a narrow vertical pad used to separate lines
219:             * 
220:             * @see #getLinePad()
221:             * @see #getParagraphPad()
222:             */
223:            public ConstantSize getNarrowLinePad() {
224:                return NARROW_LINE_PAD;
225:            }
226:
227:            /**
228:             * Returns a narrow vertical pad used to separate lines.
229:             * 
230:             * @return a vertical pad used to separate lines
231:             * 
232:             * @see #getNarrowLinePad()
233:             * @see #getParagraphPad()
234:             */
235:            public ConstantSize getLinePad() {
236:                return LINE_PAD;
237:            }
238:
239:            /**
240:             * Returns a pad used to separate paragraphs.
241:             * 
242:             * @return a vertical pad used to separate paragraphs
243:             * 
244:             * @see #getNarrowLinePad()
245:             * @see #getLinePad()
246:             */
247:            public ConstantSize getParagraphPad() {
248:                return PARAGRAPH_PAD;
249:            }
250:
251:            /**
252:             * Returns a pad used to separate a button bar from a component.
253:             * 
254:             * @return a vertical pad used to separate paragraphs
255:             * @since 1.0.3
256:             * 
257:             * @see #getRelatedComponentsPadY()
258:             * @see #getUnrelatedComponentsPadY()
259:             */
260:            public ConstantSize getButtonBarPad() {
261:                return BUTTON_BAR_PAD;
262:            }
263:
264:            /**
265:             * Checks and answers whether buttons are typically ordered from 
266:             * left to right or from right to left. Useful for building button bars 
267:             * that shall comply with the platform's layout style guide.<p>
268:             * 
269:             * For example the Windows style guide recommends to layout out
270:             * <em>OK, Cancel, Apply</em> from left to right, where the 
271:             * Mac Aqua style guide recommends to layout out these buttons
272:             * from right to left.<p>
273:             * 
274:             * Although most button sequences shall honor this order
275:             * some buttons require a left to right order. For example
276:             * <em>Back, Next</em> or <em>Move Left, Move Right</em>.<p>
277:             * 
278:             * @return true if buttons are typically ordered from left to right
279:             * @since 1.0.3
280:             * 
281:             * @see com.jgoodies.forms.builder.ButtonBarBuilder
282:             * @see com.jgoodies.forms.factories.ButtonBarFactory
283:             */
284:            public boolean isLeftToRightButtonOrder() {
285:                return false;
286:            }
287:
288:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.