Java Doc for FormAttachment.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.FormAttachment

FormAttachment
final public class FormAttachment (Code)
Instances of this class are used to define the edges of a control within a FormLayout.

FormAttachments are set into the top, bottom, left, and right fields of the FormData for a control. For example:

 FormData data = new FormData();
 data.top = new FormAttachment(0,5);
 data.bottom = new FormAttachment(100,-5);
 data.left = new FormAttachment(0,5);
 data.right = new FormAttachment(100,-5);
 button.setLayoutData(data);
 

A FormAttachment defines where to attach the side of a control by using the equation, y = ax + b. The "a" term represents a fraction of the parent composite's width (from the left) or height (from the top). It can be defined using a numerator and denominator, or just a percentage value. If a percentage is used, the denominator is set to 100. The "b" term in the equation represents an offset, in pixels, from the attachment position. For example:

 FormAttachment attach = new FormAttachment (20, -5);
 
specifies that the side to which the FormAttachment object belongs will lie at 20% of the parent composite, minus 5 pixels.

Control sides can also be attached to another control. For example:

 FormAttachment attach = new FormAttachment (button, 10);
 
specifies that the side to which the FormAttachment object belongs will lie in the same position as the adjacent side of the button control, plus 10 pixels. The control side can also be attached to the opposite side of the specified control. For example:
 FormData data = new FormData ();
 data.left = new FormAttachment (button, 0, SWT.LEFT);
 
specifies that the left side of the control will lie in the same position as the left side of the button control. The control can also be attached in a position that will center the control on the specified control. For example:
 data.left = new FormAttachment (button, 0, SWT.CENTER);
 
specifies that the left side of the control will be positioned so that it is centered between the left and right sides of the button control. If the alignment is not specified, the default is to attach to the adjacent side.


See Also:   FormLayout
See Also:   FormData
since:
   2.0


Field Summary
public  intalignment
     alignment specifies the alignment of the control side that is attached to a control.

For top and bottom attachments, TOP, BOTTOM and CENTER are used.

public  Controlcontrol
     control specifies the control to which the control side is attached.
public  intdenominator
     denominator specifies the denominator of the "a" term in the equation, y = ax + b, which defines the attachment.
public  intnumerator
     numerator specifies the numerator of the "a" term in the equation, y = ax + b, which defines the attachment.
public  intoffset
     offset specifies the offset, in pixels, of the control side from the attachment position. If the offset is positive, then the control side is offset to the right of or below the attachment position.

Constructor Summary
public  FormAttachment()
     Constructs a new instance of this class.
public  FormAttachment(int numerator)
     Constructs a new instance of this class given a numerator Since no denominator or offset is specified, the default is to treat the numerator as a percentage of the form, with a denominator of 100.
public  FormAttachment(int numerator, int offset)
     Constructs a new instance of this class given a numerator and an offset.
public  FormAttachment(int numerator, int denominator, int offset)
     Constructs a new instance of this class given a numerator and denominator and an offset.
public  FormAttachment(Control control)
     Constructs a new instance of this class given a control. Since no alignment is specified, the default alignment is to attach the side to the adjacent side of the specified control.
public  FormAttachment(Control control, int offset)
     Constructs a new instance of this class given a control and an offset.
public  FormAttachment(Control control, int offset, int alignment)
     Constructs a new instance of this class given a control, an offset and an alignment.

Method Summary
 FormAttachmentdivide(int value)
    
 intgcd(int m, int n)
    
 FormAttachmentminus(FormAttachment attachment)
    
 FormAttachmentminus(int value)
    
 FormAttachmentplus(FormAttachment attachment)
    
 FormAttachmentplus(int value)
    
 intsolveX(int value)
    
 intsolveY(int value)
    
public  StringtoString()
     Returns a string containing a concise, human-readable description of the receiver.

Field Detail
alignment
public int alignment(Code)
alignment specifies the alignment of the control side that is attached to a control.

For top and bottom attachments, TOP, BOTTOM and CENTER are used. For left and right attachments, LEFT, RIGHT and CENTER are used. If any other case occurs, the default will be used instead.


Possible values are:
  • TOP: Attach the side to the top side of the specified control.
  • BOTTOM : Attach the side to the bottom side of the specified control.
  • LEFT: Attach the side to the left side of the specified control.
  • RIGHT: Attach the side to the right side of the specified control.
  • CENTER: Attach the side at a position which will center the control on the specified control.
  • DEFAULT: Attach the side to the adjacent side of the specified control.



control
public Control control(Code)
control specifies the control to which the control side is attached.



denominator
public int denominator(Code)
denominator specifies the denominator of the "a" term in the equation, y = ax + b, which defines the attachment. The default value is 100.



numerator
public int numerator(Code)
numerator specifies the numerator of the "a" term in the equation, y = ax + b, which defines the attachment.



offset
public int offset(Code)
offset specifies the offset, in pixels, of the control side from the attachment position. If the offset is positive, then the control side is offset to the right of or below the attachment position. If it is negative, then the control side is offset to the left of or above the attachment position. This is equivalent to the "b" term in the equation y = ax + b. The default value is 0.




Constructor Detail
FormAttachment
public FormAttachment()(Code)
Constructs a new instance of this class. Since no numerator, denominator or offset is specified, the attachment is treated as a percentage of the form. The numerator is zero, the denominator is 100 and the offset is zero.
since:
   3.2



FormAttachment
public FormAttachment(int numerator)(Code)
Constructs a new instance of this class given a numerator Since no denominator or offset is specified, the default is to treat the numerator as a percentage of the form, with a denominator of 100. The offset is zero.
Parameters:
  numerator - the percentage of the position
since:
   3.0



FormAttachment
public FormAttachment(int numerator, int offset)(Code)
Constructs a new instance of this class given a numerator and an offset. Since no denominator is specified, the default is to treat the numerator as a percentage of the form, with a denominator of 100.
Parameters:
  numerator - the percentage of the position
Parameters:
  offset - the offset of the side from the position



FormAttachment
public FormAttachment(int numerator, int denominator, int offset)(Code)
Constructs a new instance of this class given a numerator and denominator and an offset. The position of the side is given by the fraction of the form defined by the numerator and denominator.
Parameters:
  numerator - the numerator of the position
Parameters:
  denominator - the denominator of the position
Parameters:
  offset - the offset of the side from the position



FormAttachment
public FormAttachment(Control control)(Code)
Constructs a new instance of this class given a control. Since no alignment is specified, the default alignment is to attach the side to the adjacent side of the specified control. Since no offset is specified, an offset of 0 is used.
Parameters:
  control - the control the side is attached to



FormAttachment
public FormAttachment(Control control, int offset)(Code)
Constructs a new instance of this class given a control and an offset. Since no alignment is specified, the default alignment is to attach the side to the adjacent side of the specified control.
Parameters:
  control - the control the side is attached to
Parameters:
  offset - the offset of the side from the control



FormAttachment
public FormAttachment(Control control, int offset, int alignment)(Code)
Constructs a new instance of this class given a control, an offset and an alignment.
Parameters:
  control - the control the side is attached to
Parameters:
  offset - the offset of the side from the control
Parameters:
  alignment - the alignment of the side to the control it is attached to




Method Detail
divide
FormAttachment divide(int value)(Code)



gcd
int gcd(int m, int n)(Code)



minus
FormAttachment minus(FormAttachment attachment)(Code)



minus
FormAttachment minus(int value)(Code)



plus
FormAttachment plus(FormAttachment attachment)(Code)



plus
FormAttachment plus(int value)(Code)



solveX
int solveX(int value)(Code)



solveY
int solveY(int value)(Code)



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



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.