|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectpagelayout.BoundSpring
public class BoundSpring
The BoundSpring class
encapsulates the geometrical
properties of an object of the class
Cell in terms of
minimum, maximum, and preferred width and
height of the rectangle that encloses the cell.
Also defined here are methods
addx,
addy, and
outerProduct that are
used to determine the BoundSpring of cells
that may contain other cells, such as rows
( Row), columns
( Column), and rectangular grids
( CellGrid).
| Constructor Summary | |
|---|---|
BoundSpring(BoundSpring boundSpring)
Creates a BoundSpring which is an exact copy of the given BoundSpring. |
|
BoundSpring(java.awt.Component component)
Creates the BoundSpring for a component. |
|
BoundSpring(int minGap,
int preferredGap,
int maxGap,
boolean isHorizontalGap)
Creates the BoundSpring for a horizontal or a vertical gap. |
|
| Method Summary | |
|---|---|
BoundSpring |
addx(BoundSpring boundSpring)
Computes the BoundSpring resulting from horizontal stacking of this
object and another BoundSpring object. |
static BoundSpring |
addx(BoundSpring aBoundSpring,
BoundSpring bBoundSpring)
Computes the BoundSpring resulting from
horizontal stacking of two BoundSpring objects. |
BoundSpring |
addy(BoundSpring bBoundSpring)
Computes the BoundSpring resulting from vertical stacking of this
object and another BoundSpring object. |
static BoundSpring |
addy(BoundSpring aBoundSpring,
BoundSpring bBoundSpring)
Computes the BoundSpring resulting from vertical
stacking of two BoundSpring objects. |
protected void |
encloseBoundSpring(BoundSpring bs)
|
protected void |
fixMax()
|
int |
getMaximumHeight()
Returns the maximum height of this BoundSpring object. |
int |
getMaximumWidth()
Returns the maximum width of this BoundSpring object. |
int |
getMinimumHeight()
Returns the minimum height of this BoundSpring object. |
int |
getMinimumWidth()
Returns the minimum width of this BoundSpring object. |
int |
getPreferredHeight()
Returns the preferred height of this BoundSpring object. |
int |
getPreferredWidth()
Returns the preferred width of this BoundSpring object. |
protected int |
getSize(int type,
int coord)
Compact utility method for getting various dimensions of this BoundSpring. |
protected boolean |
isFixed(int c)
|
boolean |
isGap()
Returns true if this object represents the enclosing
rectangle of a gap. |
boolean |
isXFixed()
Returns true if this object is rigid in the x-direction. |
boolean |
isYFixed()
Returns true if this object is rigid in the y-direction. |
void |
linkHeight(java.awt.Component[] componentArray,
int fromOffset)
Sets the height of the components in the input component array to the height of this BoundSpring. |
void |
linkWidth(java.awt.Component[] componentArray,
int fromOffset)
Sets the width of the components in the input component array to the width of this BoundSpring. |
BoundSpring |
outerProduct(BoundSpring verticalSpring)
Returns the outer product of this object with another BoundSpring
object. |
static BoundSpring |
outerProduct(BoundSpring horizontalSpring,
BoundSpring verticalSpring)
Returns the outer product of the two input BoundSpring
objects. |
protected void |
setFixedHeight()
|
protected void |
setFixedWidth()
|
void |
setInset(int horizontalGap,
int verticalGap)
Increases the width and height of this object by the specified inputs. |
protected void |
setSize(int value,
int type,
int coord)
Compact utility method for setting various dimensions of this BoundSpring. |
java.lang.String |
toString()
Returns the string representation of this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BoundSpring(java.awt.Component component)
BoundSpring for a component.
component - the component for which the BoundSpring is to be created.
public BoundSpring(int minGap,
int preferredGap,
int maxGap,
boolean isHorizontalGap)
BoundSpring for a horizontal or a vertical gap.
minGap - the minimum length of the gap.preferredGap - the preferred length of the gap.maxGap - the maximum length of the gap.isHorizontalGap - true for a horizontal gap,
false otherwise.public BoundSpring(BoundSpring boundSpring)
BoundSpring which is an exact copy of the given BoundSpring.
boundSpring - the BoundSpring object to be duplicated.| Method Detail |
|---|
public BoundSpring addx(BoundSpring boundSpring)
BoundSpring resulting from horizontal stacking of this
object and another BoundSpring object.
boundSpring - the second BoundSpring object.
BoundSpring object resulting from the horizontal stacking.
public static BoundSpring addx(BoundSpring aBoundSpring,
BoundSpring bBoundSpring)
BoundSpring resulting from
horizontal stacking of two BoundSpring objects.
aBoundSpring - the first BoundSpring object.
Note that the result is copied to this object which is returned
as the output of this method.bBoundSpring - the second BoundSpring object.
BoundSpring object resulting from the horizontal stacking.public BoundSpring addy(BoundSpring bBoundSpring)
BoundSpring resulting from vertical stacking of this
object and another BoundSpring object.
bBoundSpring - the second BoundSpring object.
BoundSpring object resulting from the vertical stacking.
public static BoundSpring addy(BoundSpring aBoundSpring,
BoundSpring bBoundSpring)
BoundSpring resulting from vertical
stacking of two BoundSpring objects.
aBoundSpring - the first BoundSpring object.
Note that the result is copied to this object which is returned
as the output of this method.bBoundSpring - the second BoundSpring object.
BoundSpring object resulting from the
vertical stacking.public int getMinimumWidth()
BoundSpring object.
BoundSpring object.public int getMinimumHeight()
BoundSpring object.
BoundSpring object.public int getPreferredWidth()
BoundSpring object.
BoundSpring object.public int getPreferredHeight()
BoundSpring object.
BoundSpring object.public int getMaximumWidth()
BoundSpring object.
BoundSpring object.public int getMaximumHeight()
BoundSpring object.
BoundSpring object.public boolean isXFixed()
true if this object is rigid in the x-direction.
true if this object is rigid in the x-direction,false otherwise.public boolean isYFixed()
true if this object is rigid in the y-direction.
true if this object is rigid in the y-direction,false otherwise.public boolean isGap()
true if this object represents the enclosing
rectangle of a gap.
true of this object is a in the y-direction,false otherwise.public java.lang.String toString()
toString in class java.lang.Object
public void linkHeight(java.awt.Component[] componentArray,
int fromOffset)
BoundSpring. Only the elements
in the array starting from the index fromOffset
are affected in this manner.
componentArray - the array of components to resize.fromOffset - the index of the first element in the array to modify.
public void linkWidth(java.awt.Component[] componentArray,
int fromOffset)
BoundSpring.
Only the elements in the array starting from the index
fromOffset are affected in this manner.
componentArray - the array of components to resize.fromOffset - the index of the first element in the array to modify.public BoundSpring outerProduct(BoundSpring verticalSpring)
BoundSpring
object. The outer product of two
the BoundSpring objects is BoundSpring of the
rectangle formed by the horizontal
spring (i.e. minimum, maximum and preferred width)
of the first object and the vertical spring
(i.e. minimum, maximum and preferred height) of the second.
verticalSpring - the object whose vertical spring is copied to
the vertical spring of the result.
BoundSpring object
resulting from the operation defined above.
public static BoundSpring outerProduct(BoundSpring horizontalSpring,
BoundSpring verticalSpring)
BoundSpring
objects.
horizontalSpring - the object whose horizontal spring is copied to
the horizontal spring of the result. The result is copied
to this object which is returned as the output of this method.verticalSpring - the object whose vertical spring is copied to
the vertical spring of the result.
public void setInset(int horizontalGap,
int verticalGap)
horizontalGap - the specified increase in the width.verticalGap - the specified increase in the height.
protected int getSize(int type,
int coord)
BoundSpring.
type - 0, 1, or any other number for getting the
minimum, maximum or preferred
size along the coordinate specified the
selcond paramter.coord - 0 for x axis (width), 1 for y axis (height)
protected void setSize(int value,
int type,
int coord)
BoundSpring.
value - the actual value.type - 0, 1, or any other number for setting the
minimum, maximum or preferred
size along the coordinate specified the
selcond paramter.coord - 0 for x axis (width), 1 for y axis (height)protected boolean isFixed(int c)
protected void setFixedWidth()
protected void setFixedHeight()
protected void encloseBoundSpring(BoundSpring bs)
protected void fixMax()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||