Java Doc for GridBagConstraints.java in  » 6.0-JDK-Core » AWT » java » awt » 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 » AWT » java.awt 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.awt.GridBagConstraints

GridBagConstraints
public class GridBagConstraints implements Cloneable,java.io.Serializable(Code)
The GridBagConstraints class specifies constraints for components that are laid out using the GridBagLayout class.
version:
   1.47, 05/05/07
author:
   Doug Stein
author:
   Bill Spitzak (orignial NeWS & OLIT implementation)
See Also:   java.awt.GridBagLayout
since:
   JDK1.0


Field Summary
final public static  intABOVE_BASELINE
     Possible value for the anchor field.
final public static  intABOVE_BASELINE_LEADING
     Possible value for the anchor field.
final public static  intABOVE_BASELINE_TRAILING
     Possible value for the anchor field.
final public static  intBASELINE
     Possible value for the anchor field.
final public static  intBASELINE_LEADING
     Possible value for the anchor field.
final public static  intBASELINE_TRAILING
     Possible value for the anchor field.
final public static  intBELOW_BASELINE
     Possible value for the anchor field.
final public static  intBELOW_BASELINE_LEADING
     Possible value for the anchor field.
final public static  intBELOW_BASELINE_TRAILING
     Possible value for the anchor field.
final public static  intBOTH
     Resize the component both horizontally and vertically.
final public static  intCENTER
     Put the component in the center of its display area.
final public static  intEAST
     Put the component on the right side of its display area, centered vertically.
final public static  intFIRST_LINE_END
     Place the component in the corner of its display area where the first line of text on a page would normally end for the current ComponentOrienation.
final public static  intFIRST_LINE_START
     Place the component in the corner of its display area where the first line of text on a page would normally begin for the current ComponentOrienation.
final public static  intHORIZONTAL
     Resize the component horizontally but not vertically.
final public static  intLAST_LINE_END
     Place the component in the corner of its display area where the last line of text on a page would normally end for the current ComponentOrienation.
final public static  intLAST_LINE_START
     Place the component in the corner of its display area where the last line of text on a page would normally start for the current ComponentOrienation.
final public static  intLINE_END
     Place the component centered along the edge of its display area where lines of text would normally end for the current ComponentOrienation.
final public static  intLINE_START
     Place the component centered along the edge of its display area where lines of text would normally begin for the current ComponentOrienation.
final public static  intNONE
     Do not resize the component.
final public static  intNORTH
     Put the component at the top of its display area, centered horizontally.
final public static  intNORTHEAST
     Put the component at the top-right corner of its display area.
final public static  intNORTHWEST
     Put the component at the top-left corner of its display area.
final public static  intPAGE_END
     Place the component centered along the edge of its display area associated with the end of a page for the current ComponentOrienation.
final public static  intPAGE_START
     Place the component centered along the edge of its display area associated with the start of a page for the current ComponentOrienation.
final public static  intRELATIVE
     Specifies that this component is the next-to-last component in its column or row (gridwidth, gridheight), or that this component be placed next to the previously added component (gridx, gridy).
final public static  intREMAINDER
     Specifies that this component is the last component in its column or row.
final public static  intSOUTH
     Put the component at the bottom of its display area, centered horizontally.
final public static  intSOUTHEAST
     Put the component at the bottom-right corner of its display area.
final public static  intSOUTHWEST
     Put the component at the bottom-left corner of its display area.
final public static  intVERTICAL
     Resize the component vertically but not horizontally.
final public static  intWEST
     Put the component on the left side of its display area, centered vertically.
public  intanchor
     This field is used when the component is smaller than its display area.
transient  intascent
    
transient  Component.BaselineResizeBehaviorbaselineResizeBehavior
    
transient  intcenterOffset
    
transient  intcenterPadding
    
transient  intdescent
    
public  intfill
     This field is used when the component's display area is larger than the component's requested size.
public  intgridheight
     Specifies the number of cells in a column for the component's display area.
public  intgridwidth
     Specifies the number of cells in a row for the component's display area.
public  intgridx
     Specifies the cell containing the leading edge of the component's display area, where the first cell in a row has gridx=0.
public  intgridy
     Specifies the cell at the top of the component's display area, where the topmost cell has gridy=0.
public  Insetsinsets
     This field specifies the external padding of the component, the minimum amount of space between the component and the edges of its display area.
public  intipadx
     This field specifies the internal padding of the component, how much space to add to the minimum width of the component.
public  intipady
     This field specifies the internal padding, that is, how much space to add to the minimum height of the component.
 intminHeight
     The minimum height of the component.
 intminWidth
     The minimum width of the component.
 inttempHeight
     Temporary place holder for the Height of the component.
 inttempWidth
     Temporary place holder for the Width of the component.
 inttempX
     Temporary place holder for the x coordinate.
 inttempY
     Temporary place holder for the y coordinate.
public  doubleweightx
     Specifies how to distribute extra horizontal space.
public  doubleweighty
     Specifies how to distribute extra vertical space.

Constructor Summary
public  GridBagConstraints()
     Creates a GridBagConstraint object with all of its fields set to their default value.
public  GridBagConstraints(int gridx, int gridy, int gridwidth, int gridheight, double weightx, double weighty, int anchor, int fill, Insets insets, int ipadx, int ipady)
     Creates a GridBagConstraints object with all of its fields set to the passed-in arguments.

Method Summary
public  Objectclone()
     Creates a copy of this grid bag constraint.
 booleanisVerticallyResizable()
    

Field Detail
ABOVE_BASELINE
final public static int ABOVE_BASELINE(Code)
Possible value for the anchor field. Specifies that the component should be horizontally centered. Vertically the component is positioned so that its bottom edge touches the baseline of the starting row. If the starting row does not have a baseline it will be vertically centered.
since:
   1.6



ABOVE_BASELINE_LEADING
final public static int ABOVE_BASELINE_LEADING(Code)
Possible value for the anchor field. Specifies that the component should be horizontally placed along the leading edge. For components with a left-to-right orientation, the leading edge is the left edge. Vertically the component is positioned so that its bottom edge touches the baseline of the starting row. If the starting row does not have a baseline it will be vertically centered.
since:
   1.6



ABOVE_BASELINE_TRAILING
final public static int ABOVE_BASELINE_TRAILING(Code)
Possible value for the anchor field. Specifies that the component should be horizontally placed along the trailing edge. For components with a left-to-right orientation, the trailing edge is the right edge. Vertically the component is positioned so that its bottom edge touches the baseline of the starting row. If the starting row does not have a baseline it will be vertically centered.
since:
   1.6



BASELINE
final public static int BASELINE(Code)
Possible value for the anchor field. Specifies that the component should be horizontally centered and vertically aligned along the baseline of the prevailing row. If the component does not have a baseline it will be vertically centered.
since:
   1.6



BASELINE_LEADING
final public static int BASELINE_LEADING(Code)
Possible value for the anchor field. Specifies that the component should be horizontally placed along the leading edge. For components with a left-to-right orientation, the leading edge is the left edge. Vertically the component is aligned along the baseline of the prevailing row. If the component does not have a baseline it will be vertically centered.
since:
   1.6



BASELINE_TRAILING
final public static int BASELINE_TRAILING(Code)
Possible value for the anchor field. Specifies that the component should be horizontally placed along the trailing edge. For components with a left-to-right orientation, the trailing edge is the right edge. Vertically the component is aligned along the baseline of the prevailing row. If the component does not have a baseline it will be vertically centered.
since:
   1.6



BELOW_BASELINE
final public static int BELOW_BASELINE(Code)
Possible value for the anchor field. Specifies that the component should be horizontally centered. Vertically the component is positioned so that its top edge touches the baseline of the starting row. If the starting row does not have a baseline it will be vertically centered.
since:
   1.6



BELOW_BASELINE_LEADING
final public static int BELOW_BASELINE_LEADING(Code)
Possible value for the anchor field. Specifies that the component should be horizontally placed along the leading edge. For components with a left-to-right orientation, the leading edge is the left edge. Vertically the component is positioned so that its top edge touches the baseline of the starting row. If the starting row does not have a baseline it will be vertically centered.
since:
   1.6



BELOW_BASELINE_TRAILING
final public static int BELOW_BASELINE_TRAILING(Code)
Possible value for the anchor field. Specifies that the component should be horizontally placed along the trailing edge. For components with a left-to-right orientation, the trailing edge is the right edge. Vertically the component is positioned so that its top edge touches the baseline of the starting row. If the starting row does not have a baseline it will be vertically centered.
since:
   1.6



BOTH
final public static int BOTH(Code)
Resize the component both horizontally and vertically.



CENTER
final public static int CENTER(Code)
Put the component in the center of its display area.



EAST
final public static int EAST(Code)
Put the component on the right side of its display area, centered vertically.



FIRST_LINE_END
final public static int FIRST_LINE_END(Code)
Place the component in the corner of its display area where the first line of text on a page would normally end for the current ComponentOrienation. Equal to NORTHEAST for horizontal, left-to-right orientations and NORTHWEST for horizontal, right-to-left orientations.



FIRST_LINE_START
final public static int FIRST_LINE_START(Code)
Place the component in the corner of its display area where the first line of text on a page would normally begin for the current ComponentOrienation. Equal to NORTHWEST for horizontal, left-to-right orientations and NORTHEAST for horizontal, right-to-left orientations.



HORIZONTAL
final public static int HORIZONTAL(Code)
Resize the component horizontally but not vertically.



LAST_LINE_END
final public static int LAST_LINE_END(Code)
Place the component in the corner of its display area where the last line of text on a page would normally end for the current ComponentOrienation. Equal to SOUTHEAST for horizontal, left-to-right orientations and SOUTHWEST for horizontal, right-to-left orientations.



LAST_LINE_START
final public static int LAST_LINE_START(Code)
Place the component in the corner of its display area where the last line of text on a page would normally start for the current ComponentOrienation. Equal to SOUTHWEST for horizontal, left-to-right orientations and SOUTHEAST for horizontal, right-to-left orientations.



LINE_END
final public static int LINE_END(Code)
Place the component centered along the edge of its display area where lines of text would normally end for the current ComponentOrienation. Equal to EAST for horizontal, left-to-right orientations and WEST for horizontal, right-to-left orientations.



LINE_START
final public static int LINE_START(Code)
Place the component centered along the edge of its display area where lines of text would normally begin for the current ComponentOrienation. Equal to WEST for horizontal, left-to-right orientations and EAST for horizontal, right-to-left orientations.



NONE
final public static int NONE(Code)
Do not resize the component.



NORTH
final public static int NORTH(Code)
Put the component at the top of its display area, centered horizontally.



NORTHEAST
final public static int NORTHEAST(Code)
Put the component at the top-right corner of its display area.



NORTHWEST
final public static int NORTHWEST(Code)
Put the component at the top-left corner of its display area.



PAGE_END
final public static int PAGE_END(Code)
Place the component centered along the edge of its display area associated with the end of a page for the current ComponentOrienation. Equal to SOUTH for horizontal orientations.



PAGE_START
final public static int PAGE_START(Code)
Place the component centered along the edge of its display area associated with the start of a page for the current ComponentOrienation. Equal to NORTH for horizontal orientations.



RELATIVE
final public static int RELATIVE(Code)
Specifies that this component is the next-to-last component in its column or row (gridwidth, gridheight), or that this component be placed next to the previously added component (gridx, gridy).
See Also:   java.awt.GridBagConstraints.gridwidth
See Also:   java.awt.GridBagConstraints.gridheight
See Also:   java.awt.GridBagConstraints.gridx
See Also:   java.awt.GridBagConstraints.gridy



REMAINDER
final public static int REMAINDER(Code)
Specifies that this component is the last component in its column or row.



SOUTH
final public static int SOUTH(Code)
Put the component at the bottom of its display area, centered horizontally.



SOUTHEAST
final public static int SOUTHEAST(Code)
Put the component at the bottom-right corner of its display area.



SOUTHWEST
final public static int SOUTHWEST(Code)
Put the component at the bottom-left corner of its display area.



VERTICAL
final public static int VERTICAL(Code)
Resize the component vertically but not horizontally.



WEST
final public static int WEST(Code)
Put the component on the left side of its display area, centered vertically.



anchor
public int anchor(Code)
This field is used when the component is smaller than its display area. It determines where, within the display area, to place the component.

There are three kinds of possible values: orientation relative, baseline relative and absolute. Orientation relative values are interpreted relative to the container's component orientation property, baseline relative values are interpreted relative to the baseline and absolute values are not. The absolute values are: CENTER, NORTH, NORTHEAST, EAST, SOUTHEAST, SOUTH, SOUTHWEST, WEST, and NORTHWEST. The orientation relative values are: PAGE_START, PAGE_END, LINE_START, LINE_END, FIRST_LINE_START, FIRST_LINE_END, LAST_LINE_START and LAST_LINE_END. The baseline relvative values are: BASELINE, BASELINE_LEADING, BASELINE_TRAILING, ABOVE_BASELINE, ABOVE_BASELINE_LEADING, ABOVE_BASELINE_TRAILING, BELOW_BASELINE, BELOW_BASELINE_LEADING, and BELOW_BASELINE_TRAILING. The default value is CENTER.
See Also:   GridBagConstraints.clone()
See Also:   
See Also:   java.awt.ComponentOrientation




ascent
transient int ascent(Code)



baselineResizeBehavior
transient Component.BaselineResizeBehavior baselineResizeBehavior(Code)



centerOffset
transient int centerOffset(Code)



centerPadding
transient int centerPadding(Code)



descent
transient int descent(Code)



fill
public int fill(Code)
This field is used when the component's display area is larger than the component's requested size. It determines whether to resize the component, and if so, how.

The following values are valid for fill:

  • NONE: Do not resize the component.
  • HORIZONTAL: Make the component wide enough to fill its display area horizontally, but do not change its height.
  • VERTICAL: Make the component tall enough to fill its display area vertically, but do not change its width.
  • BOTH: Make the component fill its display area entirely.

The default value is NONE.
See Also:   GridBagConstraints.clone()




gridheight
public int gridheight(Code)
Specifies the number of cells in a column for the component's display area.

Use REMAINDER to specify that the component's display area will be from gridy to the last cell in the column. Use RELATIVE to specify that the component's display area will be from gridy to the next to the last one in its column.

gridheight should be a non-negative value and the default value is 1.
See Also:   GridBagConstraints.clone()
See Also:   java.awt.GridBagConstraints.gridwidth




gridwidth
public int gridwidth(Code)
Specifies the number of cells in a row for the component's display area.

Use REMAINDER to specify that the component's display area will be from gridx to the last cell in the row. Use RELATIVE to specify that the component's display area will be from gridx to the next to the last one in its row.

gridwidth should be non-negative and the default value is 1.
See Also:   GridBagConstraints.clone()
See Also:   
See Also:   java.awt.GridBagConstraints.gridheight




gridx
public int gridx(Code)
Specifies the cell containing the leading edge of the component's display area, where the first cell in a row has gridx=0. The leading edge of a component's display area is its left edge for a horizontal, left-to-right container and its right edge for a horizontal, right-to-left container. The value RELATIVE specifies that the component be placed immediately following the component that was added to the container just before this component was added.

The default value is RELATIVE. gridx should be a non-negative value.
See Also:   GridBagConstraints.clone()
See Also:   java.awt.GridBagConstraints.gridy
See Also:   java.awt.ComponentOrientation




gridy
public int gridy(Code)
Specifies the cell at the top of the component's display area, where the topmost cell has gridy=0. The value RELATIVE specifies that the component be placed just below the component that was added to the container just before this component was added.

The default value is RELATIVE. gridy should be a non-negative value.
See Also:   GridBagConstraints.clone()
See Also:   
See Also:   java.awt.GridBagConstraints.gridx




insets
public Insets insets(Code)
This field specifies the external padding of the component, the minimum amount of space between the component and the edges of its display area.

The default value is new Insets(0, 0, 0, 0).
See Also:   GridBagConstraints.clone()




ipadx
public int ipadx(Code)
This field specifies the internal padding of the component, how much space to add to the minimum width of the component. The width of the component is at least its minimum width plus ipadx pixels.

The default value is 0.
See Also:   GridBagConstraints.clone()
See Also:   java.awt.GridBagConstraints.ipady




ipady
public int ipady(Code)
This field specifies the internal padding, that is, how much space to add to the minimum height of the component. The height of the component is at least its minimum height plus ipady pixels.

The default value is 0.
See Also:   GridBagConstraints.clone()
See Also:   java.awt.GridBagConstraints.ipadx




minHeight
int minHeight(Code)
The minimum height of the component. It is used to calculate ipadx, where the default will be 0.
See Also:   GridBagConstraints.ipadx



minWidth
int minWidth(Code)
The minimum width of the component. It is used to calculate ipady, where the default will be 0.
See Also:   GridBagConstraints.ipady



tempHeight
int tempHeight(Code)
Temporary place holder for the Height of the component.



tempWidth
int tempWidth(Code)
Temporary place holder for the Width of the component.



tempX
int tempX(Code)
Temporary place holder for the x coordinate.



tempY
int tempY(Code)
Temporary place holder for the y coordinate.



weightx
public double weightx(Code)
Specifies how to distribute extra horizontal space.

The grid bag layout manager calculates the weight of a column to be the maximum weightx of all the components in a column. If the resulting layout is smaller horizontally than the area it needs to fill, the extra space is distributed to each column in proportion to its weight. A column that has a weight of zero receives no extra space.

If all the weights are zero, all the extra space appears between the grids of the cell and the left and right edges.

The default value of this field is 0. weightx should be a non-negative value.
See Also:   GridBagConstraints.clone()
See Also:   
See Also:   java.awt.GridBagConstraints.weighty




weighty
public double weighty(Code)
Specifies how to distribute extra vertical space.

The grid bag layout manager calculates the weight of a row to be the maximum weighty of all the components in a row. If the resulting layout is smaller vertically than the area it needs to fill, the extra space is distributed to each row in proportion to its weight. A row that has a weight of zero receives no extra space.

If all the weights are zero, all the extra space appears between the grids of the cell and the top and bottom edges.

The default value of this field is 0. weighty should be a non-negative value.
See Also:   GridBagConstraints.clone()
See Also:   java.awt.GridBagConstraints.weightx





Constructor Detail
GridBagConstraints
public GridBagConstraints()(Code)
Creates a GridBagConstraint object with all of its fields set to their default value.



GridBagConstraints
public GridBagConstraints(int gridx, int gridy, int gridwidth, int gridheight, double weightx, double weighty, int anchor, int fill, Insets insets, int ipadx, int ipady)(Code)
Creates a GridBagConstraints object with all of its fields set to the passed-in arguments. Note: Because the use of this constructor hinders readability of source code, this constructor should only be used by automatic source code generation tools.
Parameters:
  gridx - The initial gridx value.
Parameters:
  gridy - The initial gridy value.
Parameters:
  gridwidth - The initial gridwidth value.
Parameters:
  gridheight - The initial gridheight value.
Parameters:
  weightx - The initial weightx value.
Parameters:
  weighty - The initial weighty value.
Parameters:
  anchor - The initial anchor value.
Parameters:
  fill - The initial fill value.
Parameters:
  insets - The initial insets value.
Parameters:
  ipadx - The initial ipadx value.
Parameters:
  ipady - The initial ipady value.
See Also:   java.awt.GridBagConstraints.gridx
See Also:   java.awt.GridBagConstraints.gridy
See Also:   java.awt.GridBagConstraints.gridwidth
See Also:   java.awt.GridBagConstraints.gridheight
See Also:   java.awt.GridBagConstraints.weightx
See Also:   java.awt.GridBagConstraints.weighty
See Also:   java.awt.GridBagConstraints.anchor
See Also:   java.awt.GridBagConstraints.fill
See Also:   java.awt.GridBagConstraints.insets
See Also:   java.awt.GridBagConstraints.ipadx
See Also:   java.awt.GridBagConstraints.ipady
since:
   1.2




Method Detail
clone
public Object clone()(Code)
Creates a copy of this grid bag constraint. a copy of this grid bag constraint



isVerticallyResizable
boolean isVerticallyResizable()(Code)



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.