|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.SpringLayout.Constraints
public static class SpringLayout.Constraints
The constraints that define the relationships between components. Each Constraints object can hold 4 Springs: one for each edge of the component. Additionally it can hold Springs for the components width and the components height. Since the height and width constraints are dependend on the other constraints, a component can be over-constraint. In this case (like when all of NORTH, SOUTH and HEIGHT are constraint), the values are adjusted, so that the mathematics still hold true.
Constructor Summary | |
---|---|
SpringLayout.Constraints()
Creates a new Constraints object. |
|
SpringLayout.Constraints(Component component)
Create a new Constraints object which tracks the indicated component. |
|
SpringLayout.Constraints(Spring x,
Spring y)
Creates a new Constraints object. |
|
SpringLayout.Constraints(Spring x,
Spring y,
Spring width,
Spring height)
Creates a new Constraints object. |
Method Summary | |
---|---|
void |
dropCalcResult()
|
Spring |
getConstraint(String edgeName)
Returns the constraint for the edge with the edgeName . |
Spring |
getEast()
Returns the constraint for the right edge of the component. |
Spring |
getHeight()
Returns the constraint for the height of the component. |
Spring |
getSouth()
Returns the constraint for the lower edge of the component. |
Spring |
getWidth()
Returns the constraint for the width of the component. |
Spring |
getX()
Returns the constraint for the left edge of the component. |
Spring |
getY()
Returns the constraint for the upper edge of the component. |
void |
setConstraint(String edgeName,
Spring s)
Sets a constraint for the specified edge. |
void |
setEast(Spring s)
Sets the EAST-constraint. |
void |
setHeight(Spring s)
Sets the height-constraint. |
void |
setSouth(Spring s)
Sets the SOUTH-constraint. |
void |
setWidth(Spring s)
Sets the width-constraint. |
void |
setX(Spring s)
Sets the WEST-constraint. |
void |
setY(Spring s)
Sets the NORTH-constraint. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SpringLayout.Constraints()
public SpringLayout.Constraints(Spring x, Spring y)
x
- the constraint for the left edge of the component.y
- the constraint for the upper edge of the component.public SpringLayout.Constraints(Spring x, Spring y, Spring width, Spring height)
x
- the constraint for the left edge of the component.y
- the constraint for the upper edge of the component.width
- the constraint for the width of the component.height
- the constraint for the height of the component.public SpringLayout.Constraints(Component component)
Spring.width(Component)
and Spring.height(Component)
,
respectively.
component
- the component to trackMethod Detail |
---|
public Spring getConstraint(String edgeName)
edgeName
.
This is expected to be one of
SpringLayout.EAST
, SpringLayout.WEST
, SpringLayout.NORTH
or SpringLayout.SOUTH
.
edgeName
- the name of the edge.
public Spring getHeight()
public Spring getWidth()
public Spring getX()
public Spring getY()
public Spring getSouth()
public Spring getEast()
public void setConstraint(String edgeName, Spring s)
edgeName
- the name of the edge, one of SpringLayout.EAST
,
SpringLayout.WEST
, SpringLayout.NORTH
or SpringLayout.SOUTH
.s
- the constraint to be set.public void setHeight(Spring s)
s
- the constraint to be set.public void setWidth(Spring s)
s
- the constraint to be set.public void setX(Spring s)
s
- the constraint to be set.public void setY(Spring s)
s
- the constraint to be set.public void setSouth(Spring s)
s
- the constraint to be set.public void setEast(Spring s)
s
- the constraint to be set.public void dropCalcResult()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |