|
Préférences
Moteurs de recherche
|
|||||||||||||||||||||||||||||||
JavaTM 2 Platform Std. Ed. v1.6.0
javax.swing
|
Constructor Summary | |
---|---|
SpringLayout.Constraints()
Creates an empty Constraints object. |
|
SpringLayout.Constraints(Component c)
Creates a Constraints object with
suitable x , y , width and
height springs for component, c . |
|
SpringLayout.Constraints(Spring x,
Spring y)
Creates a Constraints object with the
specified values for its
x and y properties. |
|
SpringLayout.Constraints(Spring x,
Spring y,
Spring width,
Spring height)
Creates a Constraints object with the
specified values for its
x , y , width ,
and height properties. |
Method Summary | |
---|---|
Spring |
getConstraint(String edgeName)
Returns the value of the specified edge, which may be a derived value, or even null . |
Spring |
getHeight()
Returns the value of the height property. |
Spring |
getWidth()
Returns the value of the width property. |
Spring |
getX()
Returns the value of the x property. |
Spring |
getY()
Returns the value of the y property. |
void |
setConstraint(String edgeName,
Spring s)
Sets the spring controlling the specified edge. |
void |
setHeight(Spring height)
Sets the height property,
which controls the height of a component. |
void |
setWidth(Spring width)
Sets the width property,
which controls the width of a component. |
void |
setX(Spring x)
Sets the x property,
which controls the x value
of a component's location. |
void |
setY(Spring y)
Sets the y property,
which controls the y value
of a component's location. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SpringLayout.Constraints()
Constraints
object.
public SpringLayout.Constraints(Spring x, Spring y)
Constraints
object with the
specified values for its
x
and y
properties.
The height
and width
springs
have null
values.
x
- the spring controlling the component's x valuey
- the spring controlling the component's y valuepublic SpringLayout.Constraints(Spring x, Spring y, Spring width, Spring height)
Constraints
object with the
specified values for its
x
, y
, width
,
and height
properties.
Note: If the SpringLayout
class
encounters null
values in the
Constraints
object of a given component,
it replaces them with suitable defaults.
x
- the spring value for the x
propertyy
- the spring value for the y
propertywidth
- the spring value for the width
propertyheight
- the spring value for the height
propertypublic SpringLayout.Constraints(Component c)
Constraints
object with
suitable x
, y
, width
and
height
springs for component, c
.
The x
and y
springs are constant
springs initialised with the component's location at
the time this method is called. The width
and
height
springs are special springs, created by
the Spring.width()
and Spring.height()
methods, which track the size characteristics of the component
when they change.
c
- the component whose characteristics will be reflected by this Constraints object
NullPointerException
- if c
is null.Method Detail |
---|
public void setX(Spring x)
x
property,
which controls the x
value
of a component's location.
x
- the spring controlling the x
value
of a component's locationgetX()
,
SpringLayout.Constraints
public Spring getX()
x
property.
x
value
of a component's locationsetX(javax.swing.Spring)
,
SpringLayout.Constraints
public void setY(Spring y)
y
property,
which controls the y
value
of a component's location.
y
- the spring controlling the y
value
of a component's locationgetY()
,
SpringLayout.Constraints
public Spring getY()
y
property.
y
value
of a component's locationsetY(javax.swing.Spring)
,
SpringLayout.Constraints
public void setWidth(Spring width)
width
property,
which controls the width of a component.
width
- the spring controlling the width of this
Constraints
objectgetWidth()
,
SpringLayout.Constraints
public Spring getWidth()
width
property.
setWidth(javax.swing.Spring)
,
SpringLayout.Constraints
public void setHeight(Spring height)
height
property,
which controls the height of a component.
height
- the spring controlling the height of this Constraints
objectgetHeight()
,
SpringLayout.Constraints
public Spring getHeight()
height
property.
setHeight(javax.swing.Spring)
,
SpringLayout.Constraints
public void setConstraint(String edgeName, Spring s)
SpringLayout.NORTH
,
SpringLayout.SOUTH
,
SpringLayout.EAST
,
SpringLayout.WEST
,
SpringLayout.HORIZONTAL_CENTER
,
SpringLayout.VERTICAL_CENTER
,
SpringLayout.BASELINE
,
SpringLayout.WIDTH
or
SpringLayout.HEIGHT
.
For any other String
value passed as the edge,
no action is taken. For a null
edge, a
NullPointerException
is thrown.
edgeName
- the edge to be sets
- the spring controlling the specified edge
NullPointerException
- if edgeName
is null
getConstraint(java.lang.String)
,
SpringLayout.NORTH
,
SpringLayout.SOUTH
,
SpringLayout.EAST
,
SpringLayout.WEST
,
SpringLayout.HORIZONTAL_CENTER
,
SpringLayout.VERTICAL_CENTER
,
SpringLayout.BASELINE
,
SpringLayout.WIDTH
,
SpringLayout.HEIGHT
,
SpringLayout.Constraints
public Spring getConstraint(String edgeName)
null
.
The edge must have one of the following values:
SpringLayout.NORTH
,
SpringLayout.SOUTH
,
SpringLayout.EAST
,
SpringLayout.WEST
,
SpringLayout.HORIZONTAL_CENTER
,
SpringLayout.VERTICAL_CENTER
,
SpringLayout.BASELINE
,
SpringLayout.WIDTH
or
SpringLayout.HEIGHT
.
For any other String
value passed as the edge,
null
will be returned. Throws
NullPointerException
for a null
edge.
edgeName
- the edge whose value
is to be returned
null
NullPointerException
- if edgeName
is null
setConstraint(java.lang.String, javax.swing.Spring)
,
SpringLayout.NORTH
,
SpringLayout.SOUTH
,
SpringLayout.EAST
,
SpringLayout.WEST
,
SpringLayout.HORIZONTAL_CENTER
,
SpringLayout.VERTICAL_CENTER
,
SpringLayout.BASELINE
,
SpringLayout.WIDTH
,
SpringLayout.HEIGHT
,
SpringLayout.Constraints