public static class SpringLayout.Constraints extends Object
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
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 trackpublic 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 setSouth(Spring s)
s
- the constraint to be set.public void setEast(Spring s)
s
- the constraint to be set.public void dropCalcResult()