|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.cmu.relativelayout.BindingFactory
public class BindingFactory
A factory for quickly creating Bindings to lay out simple interfaces. When you create a BindingFactory, you can set top, left, bottom, and right margins, as well as horizontal and vertical spacing for controls. When you subsequently ask the BindingFactory for Bindings, it uses this information to generate them.
| Constructor Summary | |
|---|---|
BindingFactory()
Constructs a BindingFactory with the given margins and spacing. |
|
BindingFactory(int topMargin,
int leftMargin,
int bottomMargin,
int rightMargin,
int horizontalSpacing,
int verticalSpacing)
Constructs a BindingFactory with the given margins and spacing. |
|
| Method Summary | |
|---|---|
Binding |
above(Component fixed)
Returns a Binding that will place a component above the given fixed component. |
Binding |
below(Component fixed)
Returns a Binding that will place a component below the given fixed component. |
Binding |
bottomAlignedWith(Component fixed)
Returns a Binding that will align a component's bottom edge to that of the given fixed component. |
Binding |
bottomEdge()
Returns a Binding that will place a component just above the bottom edge of its container. |
Binding |
directBottomEdge()
Returns a Binding that will place a component directly above the bottom edge of its container. |
Binding |
directLeftEdge()
Returns a Binding that will place a component directly to the right of the left edge of its container. |
Binding |
directlyAbove(Component fixed)
Returns a Binding that will place a component directly above the given fixed component. |
Binding |
directlyBelow(Component fixed)
Returns a Binding that will place a component directly below of the given fixed component. |
Binding |
directlyLeftOf(Component fixed)
Returns a Binding that will place a component directly to the left of the given fixed component. |
Binding |
directlyRightOf(Component fixed)
Returns a Binding that will place a component directly to the right of the given fixed component. |
Binding |
directRightEdge()
Returns a Binding that will place a component directly to the left of the right edge of its container. |
Binding |
directTopEdge()
Returns a Binding that will place a component directly below the top edge of its container. |
static BindingFactory |
getBindingFactory()
This method returns the default instance of BindingFactory. |
int |
getBottomMargin()
Returns the current bottom margin of this BindingFactory. |
int |
getHorizontalSpacing()
Returns the current horizontal spacing used by this BindingFactory. |
int |
getLeftMargin()
Returns the current left margin of this BindingFactory. |
int |
getRightMargin()
Returns the current right margin of this BindingFactory. |
int |
getTopMargin()
Returns the current top margin of this BindingFactory. |
int |
getVerticalSpacing()
Returns the current vertical spacing used by this BindingFactory. |
Binding |
horizontallyCenterAlignedWith(Component fixed)
Returns a Binding that will align a component's horizontal center to that of the given fixed component. |
Binding |
leftAlignedWith(Component fixed)
Returns a Binding that will align a component's left edge to that of the given fixed component. |
Binding |
leftEdge()
Returns a Binding that will place a component just to the right of the left edge of its container. |
Binding |
leftOf(Component fixed)
Returns a Binding that will place a component to the left of the given fixed component. |
Binding |
rightAlignedWith(Component fixed)
Returns a Binding that will align a component's right edge to that of the given fixed component. |
Binding |
rightEdge()
Returns a Binding that will place a component just to the left of the right edge of its container. |
Binding |
rightOf(Component fixed)
Returns a Binding that will place a component to the right of the given fixed component. |
void |
setBottomMargin(int bottomMargin)
Sets the bottom margin of this BindingFactory. |
void |
setHorizontalSpacing(int horizontalSpacing)
Sets the horizontal spacing used by this BindingFactory. |
void |
setLeftMargin(int leftMargin)
Sets the left margin of this BindingFactory. |
void |
setMargin(int topMargin,
int leftMargin,
int bottomMargin,
int rightMargin)
Sets the margins for this BindingFactory. |
void |
setRightMargin(int rightMargin)
Sets the right margin of this BindingFactory. |
void |
setSpacing(int horizontalSpacing,
int verticalSpacing)
Sets the spacing for the BindingFactory |
void |
setTopMargin(int topMargin)
Sets the top margin of this BindingFactory. |
void |
setVerticalSpacing(int verticalSpacing)
Sets the vertical spacing used by this BindingFactory. |
Binding |
topAlign(Component fixed)
Returns a Binding that will align a component's top edge to that of the given fixed component. |
Binding |
topEdge()
Returns a Binding that will place a component just below the top edge of its container. |
Binding |
verticallyCenterAlignedWith(Component fixed)
Returns a Binding that will align a component's vertical center to that of the given fixed component. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BindingFactory()
public BindingFactory(int topMargin,
int leftMargin,
int bottomMargin,
int rightMargin,
int horizontalSpacing,
int verticalSpacing)
topMargin - the distance between the top of the container and controls bound using topEdgeBinding()leftMargin - the distance between the left edge of the container and controls bound using leftEdgeBinding()bottomMargin - the distance between the bottom of the container and controls bound using bottomEdgeBinding()rightMargin - the distance between the right edge of the container and controls bound using rightEdgeBinding()horizontalSpacing - the distance between controls bound together using leftOf() or rightOf()verticalSpacing - the distance between controls bound together using above() or below()| Method Detail |
|---|
public static BindingFactory getBindingFactory()
public Binding above(Component fixed)
fixed - the component to place this one next to
public Binding below(Component fixed)
fixed - the component to place this one next to
public Binding bottomAlignedWith(Component fixed)
fixed - the component to align to
public Binding bottomEdge()
public Binding directBottomEdge()
public Binding directLeftEdge()
public Binding directlyAbove(Component fixed)
fixed - the component to place this one next to
public Binding directlyBelow(Component fixed)
fixed - the component to place this one next to
public Binding directlyLeftOf(Component fixed)
fixed - the component to place this one next to
public Binding directlyRightOf(Component fixed)
fixed - the component to place this one next to
public Binding directRightEdge()
public Binding directTopEdge()
public int getBottomMargin()
public int getHorizontalSpacing()
public int getLeftMargin()
public int getRightMargin()
public int getTopMargin()
public int getVerticalSpacing()
public Binding horizontallyCenterAlignedWith(Component fixed)
fixed - the component to align to
public Binding leftAlignedWith(Component fixed)
fixed - the component to align to
public Binding leftEdge()
public Binding leftOf(Component fixed)
fixed - the component to place this one next to
public Binding rightAlignedWith(Component fixed)
fixed - the component to align to
public Binding rightEdge()
public Binding rightOf(Component fixed)
fixed - the component to place this one next to
public void setBottomMargin(int bottomMargin)
bottomMargin - the new marginpublic void setHorizontalSpacing(int horizontalSpacing)
horizontalSpacing - the new spacingpublic void setLeftMargin(int leftMargin)
leftMargin - the new margin
public void setMargin(int topMargin,
int leftMargin,
int bottomMargin,
int rightMargin)
topMargin - the distance between the top of the container and controls bound using topEdgeBinding()leftMargin - the distance between the left edge of the container and controls bound using leftEdgeBinding()bottomMargin - the distance between the bottom of the container and controls bound using bottomEdgeBinding()rightMargin - the distance between the right edge of the container and controls bound using rightEdgeBinding()public void setRightMargin(int rightMargin)
rightMargin - the new margin
public void setSpacing(int horizontalSpacing,
int verticalSpacing)
horizontalSpacing - the distance between controls bound together using leftOf() or rightOf()verticalSpacing - the distance between controls bound together using above() or below()public void setTopMargin(int topMargin)
topMargin - the new marginpublic void setVerticalSpacing(int verticalSpacing)
verticalSpacing - the new spacingpublic Binding topAlign(Component fixed)
fixed - the component to align to
public Binding topEdge()
public Binding verticallyCenterAlignedWith(Component fixed)
fixed - the component to align to
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||