Java Doc for GridData.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 Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.eclipse.swt.layout.GridData

GridData
final public class GridData (Code)
GridData is the layout data object associated with GridLayout. To set a GridData object into a control, you use the Control.setLayoutData(Object) method.

There are two ways to create a GridData object with certain fields set. The first is to set the fields directly, like this:

 GridData gridData = new GridData();
 gridData.horizontalAlignment = GridData.FILL;
 gridData.grabExcessHorizontalSpace = true;
 button1.setLayoutData(gridData);
 
The second is to take advantage of convenience style bits defined by GridData:
 button1.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL));
 

NOTE: Do not reuse GridData objects. Every control in a Composite that is managed by a GridLayout must have a unique GridData object. If the layout data for a control in a GridLayout is null at layout time, a unique GridData object is created for it.


See Also:   GridLayout
See Also:   Control.setLayoutData


Field Summary
final public static  intBEGINNING
     Value for horizontalAlignment or verticalAlignment. Position the control at the top or left of the cell. Not recommended.
final public static  intCENTER
     Value for horizontalAlignment or verticalAlignment. Position the control in the vertical or horizontal center of the cell Not recommended.
final public static  intEND
     Value for horizontalAlignment or verticalAlignment. Position the control at the bottom or right of the cell Not recommended.
final public static  intFILL
     Value for horizontalAlignment or verticalAlignment. Resize the control to fill the cell horizontally or vertically. Not recommended.
final public static  intFILL_BOTH
     Style bit for new GridData(int) to resize the control to fill the cell horizontally and vertically and to fit the remaining horizontal and vertical space. FILL_BOTH = FILL_VERTICAL | FILL_HORIZONTAL Not recommended.
final public static  intFILL_HORIZONTAL
     Style bit for new GridData(int) to resize the control to fill the cell horizontally and to fit the remaining horizontal space. FILL_HORIZONTAL = HORIZONTAL_ALIGN_FILL | GRAB_HORIZONTAL Not recommended.
final public static  intFILL_VERTICAL
     Style bit for new GridData(int) to resize the control to fill the cell vertically and to fit the remaining vertical space. FILL_VERTICAL = VERTICAL_ALIGN_FILL | GRAB_VERTICAL Not recommended.
final public static  intGRAB_HORIZONTAL
     Style bit for new GridData(int) to resize the control to fit the remaining horizontal space. Not recommended.
final public static  intGRAB_VERTICAL
     Style bit for new GridData(int) to resize the control to fit the remaining vertical space. Not recommended.
final public static  intHORIZONTAL_ALIGN_BEGINNING
     Style bit for new GridData(int) to position the control at the left of the cell. Not recommended.
final public static  intHORIZONTAL_ALIGN_CENTER
     Style bit for new GridData(int) to position the control in the horizontal center of the cell. Not recommended.
final public static  intHORIZONTAL_ALIGN_END
     Style bit for new GridData(int) to position the control at the right of the cell. Not recommended.
final public static  intHORIZONTAL_ALIGN_FILL
     Style bit for new GridData(int) to resize the control to fill the cell horizontally. Not recommended.
final public static  intVERTICAL_ALIGN_BEGINNING
     Style bit for new GridData(int). Position the control at the top of the cell. Not recommended.
final public static  intVERTICAL_ALIGN_CENTER
     Style bit for new GridData(int) to position the control in the vertical center of the cell. Not recommended.
final public static  intVERTICAL_ALIGN_END
     Style bit for new GridData(int) to position the control at the bottom of the cell. Not recommended.
final public static  intVERTICAL_ALIGN_FILL
     Style bit for new GridData(int) to resize the control to fill the cell vertically. Not recommended.
 intcacheWidthcacheHeight
    
 intcurrentWhintcurrentHhintcurrentWidthcurrentHeight
    
 intdefaultWhintdefaultHhintdefaultWidthdefaultHeight
    
public  booleanexclude
     exclude informs the layout to ignore this control when sizing and positioning controls.
public  booleangrabExcessHorizontalSpace
    

grabExcessHorizontalSpace specifies whether the width of the cell changes depending on the size of the parent Composite.

public  booleangrabExcessVerticalSpace
    

grabExcessVerticalSpace specifies whether the height of the cell changes depending on the size of the parent Composite.

public  intheightHint
     heightHint specifies the preferred height in pixels.
public  inthorizontalAlignment
     horizontalAlignment specifies how controls will be positioned horizontally within a cell.
public  inthorizontalIndent
     horizontalIndent specifies the number of pixels of indentation that will be placed along the left side of the cell.
public  inthorizontalSpan
     horizontalSpan specifies the number of column cells that the control will take up.
public  intminimumHeight
     minimumHeight specifies the minimum height in pixels.
public  intminimumWidth
     minimumWidth specifies the minimum width in pixels.
public  intverticalAlignment
     verticalAlignment specifies how controls will be positioned vertically within a cell.
public  intverticalIndent
     verticalIndent specifies the number of pixels of indentation that will be placed along the top side of the cell.
public  intverticalSpan
     verticalSpan specifies the number of row cells that the control will take up.
public  intwidthHint
     widthHint specifies the preferred width in pixels.

Constructor Summary
public  GridData()
     Constructs a new instance of GridData using default values.
public  GridData(int style)
     Constructs a new instance based on the GridData style.
public  GridData(int horizontalAlignment, int verticalAlignment, boolean grabExcessHorizontalSpace, boolean grabExcessVerticalSpace)
     Constructs a new instance of GridData according to the parameters.
public  GridData(int horizontalAlignment, int verticalAlignment, boolean grabExcessHorizontalSpace, boolean grabExcessVerticalSpace, int horizontalSpan, int verticalSpan)
     Constructs a new instance of GridData according to the parameters.
public  GridData(int width, int height)
     Constructs a new instance of GridData according to the parameters.

Method Summary
 voidcomputeSize(Control control, int wHint, int hHint, boolean flushCache)
    
 voidflushCache()
    
 StringgetName()
    
public  StringtoString()
     Returns a string containing a concise, human-readable description of the receiver.

Field Detail
BEGINNING
final public static int BEGINNING(Code)
Value for horizontalAlignment or verticalAlignment. Position the control at the top or left of the cell. Not recommended. Use SWT.BEGINNING, SWT.TOP or SWT.LEFT instead.



CENTER
final public static int CENTER(Code)
Value for horizontalAlignment or verticalAlignment. Position the control in the vertical or horizontal center of the cell Not recommended. Use SWT.CENTER instead.



END
final public static int END(Code)
Value for horizontalAlignment or verticalAlignment. Position the control at the bottom or right of the cell Not recommended. Use SWT.END, SWT.BOTTOM or SWT.RIGHT instead.



FILL
final public static int FILL(Code)
Value for horizontalAlignment or verticalAlignment. Resize the control to fill the cell horizontally or vertically. Not recommended. Use SWT.FILL instead.



FILL_BOTH
final public static int FILL_BOTH(Code)
Style bit for new GridData(int) to resize the control to fill the cell horizontally and vertically and to fit the remaining horizontal and vertical space. FILL_BOTH = FILL_VERTICAL | FILL_HORIZONTAL Not recommended. Use new GridData(SWT.FILL, SWT.FILL, true, true) instead.



FILL_HORIZONTAL
final public static int FILL_HORIZONTAL(Code)
Style bit for new GridData(int) to resize the control to fill the cell horizontally and to fit the remaining horizontal space. FILL_HORIZONTAL = HORIZONTAL_ALIGN_FILL | GRAB_HORIZONTAL Not recommended. Use new GridData(SWT.FILL, int, true, boolean) instead.



FILL_VERTICAL
final public static int FILL_VERTICAL(Code)
Style bit for new GridData(int) to resize the control to fill the cell vertically and to fit the remaining vertical space. FILL_VERTICAL = VERTICAL_ALIGN_FILL | GRAB_VERTICAL Not recommended. Use new GridData(int, SWT.FILL, boolean, true) instead.



GRAB_HORIZONTAL
final public static int GRAB_HORIZONTAL(Code)
Style bit for new GridData(int) to resize the control to fit the remaining horizontal space. Not recommended. Use new GridData(int, int, true, boolean) instead.



GRAB_VERTICAL
final public static int GRAB_VERTICAL(Code)
Style bit for new GridData(int) to resize the control to fit the remaining vertical space. Not recommended. Use new GridData(int, int, boolean, true) instead.



HORIZONTAL_ALIGN_BEGINNING
final public static int HORIZONTAL_ALIGN_BEGINNING(Code)
Style bit for new GridData(int) to position the control at the left of the cell. Not recommended. Use new GridData(SWT.BEGINNING, int, boolean, boolean) instead.



HORIZONTAL_ALIGN_CENTER
final public static int HORIZONTAL_ALIGN_CENTER(Code)
Style bit for new GridData(int) to position the control in the horizontal center of the cell. Not recommended. Use new GridData(SWT.CENTER, int, boolean, boolean) instead.



HORIZONTAL_ALIGN_END
final public static int HORIZONTAL_ALIGN_END(Code)
Style bit for new GridData(int) to position the control at the right of the cell. Not recommended. Use new GridData(SWT.END, int, boolean, boolean) instead.



HORIZONTAL_ALIGN_FILL
final public static int HORIZONTAL_ALIGN_FILL(Code)
Style bit for new GridData(int) to resize the control to fill the cell horizontally. Not recommended. Use new GridData(SWT.FILL, int, boolean, boolean) instead.



VERTICAL_ALIGN_BEGINNING
final public static int VERTICAL_ALIGN_BEGINNING(Code)
Style bit for new GridData(int). Position the control at the top of the cell. Not recommended. Use new GridData(int, SWT.BEGINNING, boolean, boolean) instead.



VERTICAL_ALIGN_CENTER
final public static int VERTICAL_ALIGN_CENTER(Code)
Style bit for new GridData(int) to position the control in the vertical center of the cell. Not recommended. Use new GridData(int, SWT.CENTER, boolean, boolean) instead.



VERTICAL_ALIGN_END
final public static int VERTICAL_ALIGN_END(Code)
Style bit for new GridData(int) to position the control at the bottom of the cell. Not recommended. Use new GridData(int, SWT.END, boolean, boolean) instead.



VERTICAL_ALIGN_FILL
final public static int VERTICAL_ALIGN_FILL(Code)
Style bit for new GridData(int) to resize the control to fill the cell vertically. Not recommended. Use new GridData(int, SWT.FILL, boolean, boolean) instead



cacheWidthcacheHeight
int cacheWidthcacheHeight(Code)



currentWhintcurrentHhintcurrentWidthcurrentHeight
int currentWhintcurrentHhintcurrentWidthcurrentHeight(Code)



defaultWhintdefaultHhintdefaultWidthdefaultHeight
int defaultWhintdefaultHhintdefaultWidthdefaultHeight(Code)



exclude
public boolean exclude(Code)
exclude informs the layout to ignore this control when sizing and positioning controls. If this value is true, the size and position of the control will not be managed by the layout. If this value is false, the size and position of the control will be computed and assigned. The default value is false.
since:
   3.1



grabExcessHorizontalSpace
public boolean grabExcessHorizontalSpace(Code)

grabExcessHorizontalSpace specifies whether the width of the cell changes depending on the size of the parent Composite. If grabExcessHorizontalSpace is true, the following rules apply to the width of the cell:

  • If extra horizontal space is available in the parent, the cell will grow to be wider than its preferred width. The new width will be "preferred width + delta" where delta is the extra horizontal space divided by the number of grabbing columns.
  • If there is not enough horizontal space available in the parent, the cell will shrink until it reaches its minimum width as specified by GridData.minimumWidth. The new width will be the maximum of "minimumWidth" and "preferred width - delta", where delta is the amount of space missing divided by the number of grabbing columns.
  • If the parent is packed, the cell will be its preferred width as specified by GridData.widthHint.
  • If the control spans multiple columns and there are no other grabbing controls in any of the spanned columns, the last column in the span will grab the extra space. If there is at least one other grabbing control in the span, the grabbing will be spread over the columns already marked as grabExcessHorizontalSpace.

The default value is false.


See Also:   GridData.minimumWidth
See Also:   GridData.widthHint



grabExcessVerticalSpace
public boolean grabExcessVerticalSpace(Code)

grabExcessVerticalSpace specifies whether the height of the cell changes depending on the size of the parent Composite. If grabExcessVerticalSpace is true, the following rules apply to the height of the cell:

  • If extra vertical space is available in the parent, the cell will grow to be taller than its preferred height. The new height will be "preferred height + delta" where delta is the extra vertical space divided by the number of grabbing rows.
  • If there is not enough vertical space available in the parent, the cell will shrink until it reaches its minimum height as specified by GridData.minimumHeight. The new height will be the maximum of "minimumHeight" and "preferred height - delta", where delta is the amount of space missing divided by the number of grabbing rows.
  • If the parent is packed, the cell will be its preferred height as specified by GridData.heightHint.
  • If the control spans multiple rows and there are no other grabbing controls in any of the spanned rows, the last row in the span will grab the extra space. If there is at least one other grabbing control in the span, the grabbing will be spread over the rows already marked as grabExcessVerticalSpace.

The default value is false.


See Also:   GridData.minimumHeight
See Also:   GridData.heightHint



heightHint
public int heightHint(Code)
heightHint specifies the preferred height in pixels. This value is the hHint passed into Control.computeSize(int, int, boolean) to determine the preferred size of the control. The default value is SWT.DEFAULT.
See Also:   Control.computeSize(intintboolean)



horizontalAlignment
public int horizontalAlignment(Code)
horizontalAlignment specifies how controls will be positioned horizontally within a cell. The default value is BEGINNING. Possible values are:
  • SWT.BEGINNING (or SWT.LEFT): Position the control at the left of the cell
  • SWT.CENTER: Position the control in the horizontal center of the cell
  • SWT.END (or SWT.RIGHT): Position the control at the right of the cell
  • SWT.FILL: Resize the control to fill the cell horizontally



horizontalIndent
public int horizontalIndent(Code)
horizontalIndent specifies the number of pixels of indentation that will be placed along the left side of the cell. The default value is 0.



horizontalSpan
public int horizontalSpan(Code)
horizontalSpan specifies the number of column cells that the control will take up. The default value is 1.



minimumHeight
public int minimumHeight(Code)
minimumHeight specifies the minimum height in pixels. This value applies only if grabExcessVerticalSpace is true. A value of SWT.DEFAULT means that the minimum height will be the result of Control.computeSize(int, int, boolean) where hHint is determined by GridData.heightHint. The default value is 0.
since:
   3.1
See Also:   Control.computeSize(intintboolean)
See Also:   GridData.heightHint



minimumWidth
public int minimumWidth(Code)
minimumWidth specifies the minimum width in pixels. This value applies only if grabExcessHorizontalSpace is true. A value of SWT.DEFAULT means that the minimum width will be the result of Control.computeSize(int, int, boolean) where wHint is determined by GridData.widthHint. The default value is 0.
since:
   3.1
See Also:   Control.computeSize(intintboolean)
See Also:   GridData.widthHint



verticalAlignment
public int verticalAlignment(Code)
verticalAlignment specifies how controls will be positioned vertically within a cell. The default value is CENTER. Possible values are:
  • SWT.BEGINNING (or SWT.TOP): Position the control at the top of the cell
  • SWT.CENTER: Position the control in the vertical center of the cell
  • SWT.END (or SWT.BOTTOM): Position the control at the bottom of the cell
  • SWT.FILL: Resize the control to fill the cell vertically



verticalIndent
public int verticalIndent(Code)
verticalIndent specifies the number of pixels of indentation that will be placed along the top side of the cell. The default value is 0.
since:
   3.1



verticalSpan
public int verticalSpan(Code)
verticalSpan specifies the number of row cells that the control will take up. The default value is 1.



widthHint
public int widthHint(Code)
widthHint specifies the preferred width in pixels. This value is the wHint passed into Control.computeSize(int, int, boolean) to determine the preferred size of the control. The default value is SWT.DEFAULT.
See Also:   Control.computeSize(intintboolean)




Constructor Detail
GridData
public GridData()(Code)
Constructs a new instance of GridData using default values.



GridData
public GridData(int style)(Code)
Constructs a new instance based on the GridData style. This constructor is not recommended.
Parameters:
  style - the GridData style



GridData
public GridData(int horizontalAlignment, int verticalAlignment, boolean grabExcessHorizontalSpace, boolean grabExcessVerticalSpace)(Code)
Constructs a new instance of GridData according to the parameters.
Parameters:
  horizontalAlignment - how control will be positioned horizontally within a cell
Parameters:
  verticalAlignment - how control will be positioned vertically within a cell
Parameters:
  grabExcessHorizontalSpace - whether cell will be made wide enough to fit the remaining horizontal space
Parameters:
  grabExcessVerticalSpace - whether cell will be made high enough to fit the remaining vertical space
since:
   3.0



GridData
public GridData(int horizontalAlignment, int verticalAlignment, boolean grabExcessHorizontalSpace, boolean grabExcessVerticalSpace, int horizontalSpan, int verticalSpan)(Code)
Constructs a new instance of GridData according to the parameters.
Parameters:
  horizontalAlignment - how control will be positioned horizontally within a cell
Parameters:
  verticalAlignment - how control will be positioned vertically within a cell
Parameters:
  grabExcessHorizontalSpace - whether cell will be made wide enough to fit the remaining horizontal space
Parameters:
  grabExcessVerticalSpace - whether cell will be made high enough to fit the remaining vertical space
Parameters:
  horizontalSpan - the number of column cells that the control will take up
Parameters:
  verticalSpan - the number of row cells that the control will take up
since:
   3.0



GridData
public GridData(int width, int height)(Code)
Constructs a new instance of GridData according to the parameters. A value of SWT.DEFAULT indicates that no minimum width or no minimum height is specified.
Parameters:
  width - a minimum width for the column
Parameters:
  height - a minimum height for the row
since:
   3.0




Method Detail
computeSize
void computeSize(Control control, int wHint, int hHint, boolean flushCache)(Code)



flushCache
void flushCache()(Code)



getName
String getName()(Code)



toString
public String toString()(Code)
Returns a string containing a concise, human-readable description of the receiver. a string representation of the GridData object



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.