|
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.AlignmentOriginConstraint
An AlignmentOriginConstraint is used with an instance of FractionalLayout to describe the layout of an unbounded figure. It provides for the 'location point' of the figure to be inset from the top and left edges of the figure. A couple of examples:
new AlignmentOriginConstraint(0.0, 0, 1.0, -10, 1.0, 0.0)
will place the upper-right corner of the component 10 pixels to the left
of the upper-right corner of the container. The component
will be its preferred size.
new AlignmentOriginConstraint(0.5, 0, 0.5, 0, 0.5, 0.5)
will place the center of the component in the center of the container.
The component will be its preferred size.
FractionalLayout
Field Summary | |
double |
leftAlignmentFraction
A number between 0.0 and 1.0 which represents the inset of the location point from the left edge of the component. |
double |
topAlignmentFraction
A number between 0.0 and 1.0 which represents the inset of the location point from the top edge of the component. |
Fields inherited from class org.arch4j.ui.layout.OriginConstraint |
left, leftFraction, top, topFraction |
Constructor Summary | |
AlignmentOriginConstraint()
Create an instanace of an AlignmentOriginConstraint. |
|
AlignmentOriginConstraint(double lf,
int l,
double tf,
int t,
double laf,
double taf)
Create an instance of an AlignmentOriginConstraint given the left fraction, the left offset, the top fraction, the top offset, the left alignment fraction, and the top alignment fraction. |
Method Summary | |
protected int |
adjustedAlignmentLeft(Dimension componentSize)
Given a component size, figure out the appropriate horizontal offset |
protected int |
adjustedAlignmentTop(Dimension componentSize)
Given a component size, figure out the appropriate vertical offset |
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. |
Dimension |
containSize(Dimension componentSize)
Given the size of a component, return the smallest size container which could contain it given this constraint. |
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 leftAlignmentFraction
public double topAlignmentFraction
Constructor Detail |
public AlignmentOriginConstraint()
public AlignmentOriginConstraint(double lf, int l, double tf, int t, double laf, double taf)
lf
- the left fractionl
- the left offsettf
- the top fractiont
- the top offsetlaf
- the left alignment fractiontaf
- the top alignment fractionMethod Detail |
protected int adjustedAlignmentLeft(Dimension componentSize)
componentSize
- the size of the component
protected int adjustedAlignmentTop(Dimension componentSize)
componentSize
- the size of the component
public Rectangle adjustedRectangle(Dimension containerSize, Dimension componentSize)
adjustedRectangle
in class OriginConstraint
containerSize
- the size of the containercomponentSize
- the size of the component
public Dimension containSize(Dimension componentSize)
containSize
in class OriginConstraint
componentSize
- the size of a component
|
Arch4J 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |