|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrelativelayout.RelativePosition
public class RelativePosition
Represents the position of an edge at some offset from another edge. RelativePositions are
designed to be reused in multiple Binding
s using the
Binding.Binding(RelativePosition, java.awt.Component)
constructor. If you don't need
reusability, you can also construct a Binding
without having to create a RelativePosition
by using the Binding.Binding(Edge, int, Direction, Edge, java.awt.Component)
constructor.
RelativePositions are immutable; that is, once constructed, they cannot be changed.
Constructor Summary | |
---|---|
RelativePosition(Edge myEdge,
int distance,
Direction direction,
Edge fixedEdge)
Constructs an RelativePosition with the given parameters. |
Method Summary | |
---|---|
Direction |
getDirection()
Accessor method for direction, as set in the constructor. |
int |
getDistance()
Accessor method for distance, as set in the constructor. |
Edge |
getFixedEdge()
Accessor method for fixedEdge, as set in the constructor. |
Edge |
getMyEdge()
Accessor method for myEdge, as set in the constructor. |
boolean |
isValid()
Returns true if this RelativePosition is "valid" -- that is, does not result
in a nonsensical relationship. |
String |
toString()
Returns a human readable String representation of this RelativePosition. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RelativePosition(Edge myEdge, int distance, Direction direction, Edge fixedEdge)
Binding.Binding(Edge, int, Direction, Edge, java.awt.Component)
for more information.
myEdge
- The edge of a component that will be defined by this RelativePosition.distance
- How far that edge will be from the edge of some fixed component, in pixels.direction
- The direction the edge will be in from the edge of some fixed component.fixedEdge
- The edge of some fixed component from which the distance should be measured.Binding.Binding(Edge, int, Direction, Edge, java.awt.Component)
Method Detail |
---|
public Direction getDirection()
public int getDistance()
public Edge getFixedEdge()
public Edge getMyEdge()
public boolean isValid()
true
if this RelativePosition is "valid" -- that is, does not result
in a nonsensical relationship. See InvalidBindingException
for a more formal
definition of what this means.
true
if the RelativePosition is valid, false
otherwise.public String toString()
toString
in class Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |