|
Arch4J 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.arch4j.ui.layout.OriginConstraint | +--org.arch4j.ui.layout.FrameConstraint
A FrameConstraint is used with an instance of FractionalLayout to compute a Rectangle relative to a containing Rectangle by computing the relative edges and then adding offsets to them. Any preferredSize of the component is ignored. A couple of examples:
new FrameConstraint(0.0, 0, 0.0, 10, 1.0, 0, 0.0, 40)
will cause the component to be 30 pixels high (40 - 10), with the top
of the component 10 pixels down from the top of the container. The
container's width will be the entire width of the container.
new FrameConstraint(0.0, 0, 0.5, 0, 1.0, 0, 1.0, 0)
will cause the component to take up the entire bottom half of the container.
FractionalLayout
Field Summary | |
int |
bottom
Represents the number of pixels to be added as an offset to the bottom edge of a component. |
double |
bottomFraction
A number between 0.0 and 1.0 which represents the relative fraction (of the container) for the bottom edge of a component. |
int |
right
Represents the number of pixels to be added as an offset to the right edge of a component. |
double |
rightFraction
A number between 0.0 and 1.0 which represents the relative fraction (of the container) for the right edge of a component. |
Fields inherited from class org.arch4j.ui.layout.OriginConstraint |
left, leftFraction, top, topFraction |
Constructor Summary | |
FrameConstraint()
Create an instanace of an FrameConstraint. |
|
FrameConstraint(double lf,
int l,
double tf,
int t,
double rf,
int r,
double bf,
int b)
Create an instance of an FrameConstraint given the left fraction, the left offset, the top fraction, the top offset, the right fraction, the right offset, the bottom fraction, and the bottom offset. |
Method Summary | |
protected int |
adjustedBottom(Dimension containerSize)
Given a container size, resolve the bottom edge of a component |
Rectangle |
adjustedRectangle(Dimension containerSize,
Dimension componentSize)
Given the size of a container and the component size, return a Rectangle which appropriately bounds the component given this constraint. |
protected int |
adjustedRight(Dimension containerSize)
Given a container size, resolve the right edge of a component |
Dimension |
containSize(Dimension componentSize)
Given the size of a component, return the smallest size container which could contain it given this constraint. |
void |
setFractionsAndOffsets(double lf,
int l,
double tf,
int t,
double rf,
int r,
double bf,
int b)
This method was created by a SmartGuide. |
Methods inherited from class org.arch4j.ui.layout.OriginConstraint |
adjustedLeft, adjustedTop |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public double rightFraction
public int right
public double bottomFraction
public int bottom
Constructor Detail |
public FrameConstraint()
public FrameConstraint(double lf, int l, double tf, int t, double rf, int r, double bf, int b)
lf
- the left fractionl
- the left offsettf
- the top fractiont
- the top offsetrf
- the right fractionr
- the right offsetbf
- the bottom fractionb
- the bottom offsetMethod Detail |
protected int adjustedBottom(Dimension containerSize)
containerSize
- the size of the container
public Rectangle adjustedRectangle(Dimension containerSize, Dimension componentSize)
adjustedRectangle
in class OriginConstraint
containerSize
- the size of the containercomponentSize
- the size of the component
protected int adjustedRight(Dimension containerSize)
containerSize
- the size of the container
public Dimension containSize(Dimension componentSize)
containSize
in class OriginConstraint
componentSize
- the size of a component
public void setFractionsAndOffsets(double lf, int l, double tf, int t, double rf, int r, double bf, int b)
lf
- doublel
- inttf
- doublet
- intrf
- doubler
- intbf
- doubleb
- int
|
Arch4J 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |