Java Doc for LayoutStyle.java in  » IDE-Netbeans » cvsclient » org » jdesktop » 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 Netbeans » cvsclient » org.jdesktop.layout 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jdesktop.layout.LayoutStyle

All known Subclasses:   org.jdesktop.layout.GnomeLayoutStyle,  org.jdesktop.layout.WindowsLayoutStyle,  org.jdesktop.layout.MetalLayoutStyle,
LayoutStyle
public class LayoutStyle (Code)
LayoutStyle is used to determine how much space to place between components during layout. LayoutStyle can be obtained for two components, or for a component relative to an edge of a parent container. The amount of space can vary depending upon whether or not the components are logically grouped together (RELATED).

This class is primarily useful for JREs prior to 1.6. In 1.6 API for this was added to Swing. When run on a JRE of 1.6 or greater this will call into the appropriate methods in Swing.
version:
   $Revision$



Field Summary
final public static  intINDENT
     Possible argument to getPreferredGap.
final public static  intRELATED
     Possible argument to getPreferredGap.
final public static  intUNRELATED
     Possible argument to getPreferredGap.


Method Summary
 intflipDirection(int position)
    
 intgetButtonChildIndent(Component c, int position)
     Returns the amount to indent the specified component if it's a JCheckBox or JRadioButton.
 intgetCBRBPadding(Component source, Component target, int position, int offset)
     For some look and feels check boxs and radio buttons have an empty border around them.
 intgetCBRBPadding(Component source, int position, int offset)
     For some look and feels check boxs and radio buttons have an empty border around them.
public  intgetContainerGap(Component component, int position, Container parent)
     Returns the amount of space to position a component inside its parent.
public  intgetPreferredGap(Component component1, Component component2, int type, int position, Container parent)
     Returns the amount of space to use between two components. The return value indicates the distance to place component2 relative to component1. For example, the following returns the amount of space to place between component2 and component1 when component2 is placed vertically above component1:
 int gap = getPreferredGap(component1, component2,
 LayoutStyle.RELATED,
 SwingConstants.NORTH, parent);
 
The type parameter indicates the type of gap being requested.
public static  LayoutStylegetSharedInstance()
     Factory methods for obtaining the current LayoutStyle object appropriate for the current look and feel.
 booleanisDialog(Component component)
     Returns true if component should be treated as a dialog.
public static  voidsetSharedInstance(LayoutStyle layoutStyle)
     Sets the LayoutStyle instance to use for this look and feel.

Field Detail
INDENT
final public static int INDENT(Code)
Possible argument to getPreferredGap. Used to indicate the distance to indent a component is being requested. To visually indicate a set of related components they will often times be horizontally indented, the INDENT constant for this. For example, to indent a check box relative to a label use this constant to getPreferredGap.



RELATED
final public static int RELATED(Code)
Possible argument to getPreferredGap. Used to indicate the two componets are grouped together.



UNRELATED
final public static int UNRELATED(Code)
Possible argument to getPreferredGap. Used to indicate the two componets are not grouped together.





Method Detail
flipDirection
int flipDirection(int position)(Code)



getButtonChildIndent
int getButtonChildIndent(Component c, int position)(Code)
Returns the amount to indent the specified component if it's a JCheckBox or JRadioButton. If the component is not a JCheckBox or JRadioButton, 0 will be returned.



getCBRBPadding
int getCBRBPadding(Component source, Component target, int position, int offset)(Code)
For some look and feels check boxs and radio buttons have an empty border around them. Look and feel guidelines generally don't include this space. Use this method to subtract this space from the specified components.
Parameters:
  source - First component
Parameters:
  target - Second component
Parameters:
  position - Position doing layout along.
Parameters:
  offset - Ideal offset, not including border/margin offset - border/margin around the component.



getCBRBPadding
int getCBRBPadding(Component source, int position, int offset)(Code)
For some look and feels check boxs and radio buttons have an empty border around them. Look and feel guidelines generally don't include this space. Use this method to subtract this space from the specified components.
Parameters:
  source - Component
Parameters:
  position - Position doing layout along.
Parameters:
  offset - Ideal offset, not including border/margin offset - border/margin around the component.



getContainerGap
public int getContainerGap(Component component, int position, Container parent)(Code)
Returns the amount of space to position a component inside its parent.
Parameters:
  component - the Component being positioned
Parameters:
  position - the position component is being placed relative to its parent; one ofSwingConstants.NORTH,SwingConstants.SOUTH,SwingConstants.EAST orSwingConstants.WEST
Parameters:
  parent - the parent of component; this may differfrom the actual parent and may be null the amount of space to place between the component and specifiededge
throws:
  IllegalArgumentException - if position is notone of SwingConstants.NORTH,SwingConstants.SOUTH,SwingConstants.EAST or SwingConstants.WEST;or component is null



getPreferredGap
public int getPreferredGap(Component component1, Component component2, int type, int position, Container parent)(Code)
Returns the amount of space to use between two components. The return value indicates the distance to place component2 relative to component1. For example, the following returns the amount of space to place between component2 and component1 when component2 is placed vertically above component1:
 int gap = getPreferredGap(component1, component2,
 LayoutStyle.RELATED,
 SwingConstants.NORTH, parent);
 
The type parameter indicates the type of gap being requested. It can be one of the following values:
RELATED If the two components will be contained in the same parent and are showing similar logically related items, use RELATED.
UNRELATED If the two components will be contained in the same parent but show logically unrelated items use UNRELATED.
INDENT Used to obtain the preferred distance to indent a component relative to another. For example, if you want to horizontally indent a JCheckBox relative to a JLabel use INDENT. This is only useful for the horizontal axis.

It's important to note that some look and feels may not distinguish between RELATED and UNRELATED.

The return value is not intended to take into account the current size and position of component2 or component1. The return value may take into consideration various properties of the components. For example, the space may vary based on font size, or the preferred size of the component.
Parameters:
  component1 - the Componentcomponent2 is being placed relative to
Parameters:
  component2 - the Component being placed
Parameters:
  type - how the two components are being placed
Parameters:
  position - the position component2 is being placed relative to component1; one ofSwingConstants.NORTH,SwingConstants.SOUTH,SwingConstants.EAST orSwingConstants.WEST
Parameters:
  parent - the parent of component2; this may differfrom the actual parent and may be null the amount of space to place between the two components
throws:
  IllegalArgumentException - if position is notone of SwingConstants.NORTH,SwingConstants.SOUTH,SwingConstants.EAST or SwingConstants.WEST; type not oneof INDENT, RELATEDor UNRELATED; or component1 orcomponent2 is null




getSharedInstance
public static LayoutStyle getSharedInstance()(Code)
Factory methods for obtaining the current LayoutStyle object appropriate for the current look and feel. the current LayoutStyle instance



isDialog
boolean isDialog(Component component)(Code)
Returns true if component should be treated as a dialog.



setSharedInstance
public static void setSharedInstance(LayoutStyle layoutStyle)(Code)
Sets the LayoutStyle instance to use for this look and feel. You generally don't need to invoke this, instead use the getter which will return the LayoutStyle appropriate for the current look and feel.
Parameters:
  layoutStyle - the LayoutStyle to use; a value of null indicates the default should be used



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.