Source Code Cross Referenced for RowData.java in  » IDE-Eclipse » swt » org » eclipse » swt » layout » 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 » IDE Eclipse » swt » org.eclipse.swt.layout 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*******************************************************************************
002:         * Copyright (c) 2000, 2006 IBM Corporation and others.
003:         * All rights reserved. This program and the accompanying materials
004:         * are made available under the terms of the Eclipse Public License v1.0
005:         * which accompanies this distribution, and is available at
006:         * http://www.eclipse.org/legal/epl-v10.html
007:         *
008:         * Contributors:
009:         *     IBM Corporation - initial API and implementation
010:         *******************************************************************************/package org.eclipse.swt.layout;
011:
012:        import org.eclipse.swt.*;
013:        import org.eclipse.swt.graphics.*;
014:
015:        /**
016:         * Each control controlled by a <code>RowLayout</code> can have its initial 
017:         * width and height specified by setting a <code>RowData</code> object 
018:         * into the control.
019:         * <p>
020:         * The following code uses a <code>RowData</code> object to change the initial
021:         * size of a <code>Button</code> in a <code>Shell</code>:
022:         * <pre>
023:         * 		Display display = new Display();
024:         * 		Shell shell = new Shell(display);
025:         * 		shell.setLayout(new RowLayout());
026:         * 		Button button1 = new Button(shell, SWT.PUSH);
027:         * 		button1.setText("Button 1");
028:         * 		button1.setLayoutData(new RowData(50, 40));
029:         * </pre>
030:         * </p>
031:         * 
032:         * @see RowLayout
033:         */
034:        public final class RowData {
035:            /**
036:             * width specifies the desired width in pixels. This value
037:             * is the wHint passed into Control.computeSize(int, int, boolean) 
038:             * to determine the preferred size of the control.
039:             *
040:             * The default value is SWT.DEFAULT.
041:             *
042:             * @see org.eclipse.swt.widgets.Control#computeSize(int, int, boolean)
043:             */
044:            public int width = SWT.DEFAULT;
045:            /**
046:             * height specifies the preferred height in pixels. This value
047:             * is the hHint passed into Control.computeSize(int, int, boolean) 
048:             * to determine the preferred size of the control.
049:             *
050:             * The default value is SWT.DEFAULT.
051:             *
052:             * @see org.eclipse.swt.widgets.Control#computeSize(int, int, boolean)
053:             */
054:            public int height = SWT.DEFAULT;
055:
056:            /**
057:             * exclude informs the layout to ignore this control when sizing
058:             * and positioning controls.  If this value is <code>true</code>,
059:             * the size and position of the control will not be managed by the
060:             * layout.  If this	value is <code>false</code>, the size and 
061:             * position of the control will be computed and assigned.
062:             * 
063:             * The default value is <code>false</code>.
064:             * 
065:             * @since 3.1
066:             */
067:            public boolean exclude = false;
068:
069:            /**
070:             * Constructs a new instance of RowData using
071:             * default values.
072:             */
073:            public RowData() {
074:            }
075:
076:            /**
077:             * Constructs a new instance of RowData according to the parameters.
078:             * A value of SWT.DEFAULT indicates that no minimum width or
079:             * no minimum height is specified.
080:             * 
081:             * @param width a minimum width for the control
082:             * @param height a minimum height for the control
083:             */
084:            public RowData(int width, int height) {
085:                this .width = width;
086:                this .height = height;
087:            }
088:
089:            /**
090:             * Constructs a new instance of RowData according to the parameter.
091:             * A value of SWT.DEFAULT indicates that no minimum width or
092:             * no minimum height is specified.
093:             * 
094:             * @param point a point whose x coordinate specifies a minimum width for the control
095:             * and y coordinate specifies a minimum height for the control
096:             */
097:            public RowData(Point point) {
098:                this (point.x, point.y);
099:            }
100:
101:            String getName() {
102:                String string = getClass().getName();
103:                int index = string.lastIndexOf('.');
104:                if (index == -1)
105:                    return string;
106:                return string.substring(index + 1, string.length());
107:            }
108:
109:            /**
110:             * Returns a string containing a concise, human-readable
111:             * description of the receiver.
112:             *
113:             * @return a string representation of the RowData object
114:             */
115:            public String toString() {
116:                String string = getName() + " {";
117:                if (width != SWT.DEFAULT)
118:                    string += "width=" + width + " ";
119:                if (height != SWT.DEFAULT)
120:                    string += "height=" + height + " ";
121:                if (exclude)
122:                    string += "exclude=" + exclude + " ";
123:                string = string.trim();
124:                string += "}";
125:                return string;
126:            }
127:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.