Java Doc for LayoutStyle.java in  » 6.0-JDK-Core » swing » javax » swing » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
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
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » swing » javax.swing 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.swing.LayoutStyle

LayoutStyle
abstract public class LayoutStyle (Code)
LayoutStyle provides information about how to position components. This class is primarily useful for visual tools and layout managers. Most developers will not need to use this class.

You typically don't set or create a LayoutStyle. Instead use the static method getInstance to obtain the current instance.
version:
   1.8, 05/05/07
since:
   1.6


Inner Class :public enum ComponentPlacement


Constructor Summary
public  LayoutStyle()
     Creates a new LayoutStyle.

Method Summary
abstract public  intgetContainerGap(JComponent component, int position, Container parent)
     Returns the amount of space to place between the component and specified edge of its parent.
public static  LayoutStylegetInstance()
     Returns the shared instance of LayoutStyle.
abstract public  intgetPreferredGap(JComponent component1, JComponent component2, ComponentPlacement 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,
 ComponentPlacement.RELATED,
 SwingConstants.NORTH, parent);
 
The type parameter indicates the relation between the two components.
public static  voidsetInstance(LayoutStyle style)
     Sets the shared instance of LayoutStyle.


Constructor Detail
LayoutStyle
public LayoutStyle()(Code)
Creates a new LayoutStyle. You generally don't create a LayoutStyle. Instead use the method getInstance to obtain the current LayoutStyle.




Method Detail
getContainerGap
abstract public int getContainerGap(JComponent component, int position, Container parent)(Code)
Returns the amount of space to place between the component and specified edge of its parent.
Parameters:
  component - the JComponent 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



getInstance
public static LayoutStyle getInstance()(Code)
Returns the shared instance of LayoutStyle. If an instance has not been specified in setInstance, this will return the LayoutStyle from the current LookAndFeel.
See Also:   LookAndFeel.getLayoutStyle the shared instance of LayoutStyle



getPreferredGap
abstract public int getPreferredGap(JComponent component1, JComponent component2, ComponentPlacement 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,
 ComponentPlacement.RELATED,
 SwingConstants.NORTH, parent);
 
The type parameter indicates the relation between the two components. If the two components will be contained in the same parent and are showing similar logically related items, use RELATED. If the two components will be contained in the same parent but show logically unrelated items use UNRELATED. Some look and feels may not distinguish between the RELATED and UNRELATED types.

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 JComponentcomponent2 is being placed relative to
Parameters:
  component2 - the JComponent being placed
Parameters:
  position - the position component2 is being placed relative to component1; one ofSwingConstants.NORTH,SwingConstants.SOUTH,SwingConstants.EAST orSwingConstants.WEST
Parameters:
  type - how the two components are being placed
Parameters:
  parent - the parent of component2; this may differfrom the actual parent and it may be null the amount of space to place between the two components
throws:
  NullPointerException - if component1,component2 or type isnull
throws:
  IllegalArgumentException - if position is notone of SwingConstants.NORTH,SwingConstants.SOUTH,SwingConstants.EAST or SwingConstants.WEST
See Also:   LookAndFeel.getLayoutStyle
since:
   1.6




setInstance
public static void setInstance(LayoutStyle style)(Code)
Sets the shared instance of LayoutStyle. Specifying null results in using the LayoutStyle from the current LookAndFeel.
Parameters:
  style - the LayoutStyle, or null
See Also:   LayoutStyle.getInstance



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.