|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.allen_sauer.gwt.dnd.client.util.AbstractLocation
com.allen_sauer.gwt.dnd.client.util.WidgetLocation
public class WidgetLocation
Constructor Summary | |
---|---|
WidgetLocation(com.google.gwt.user.client.ui.Widget widget,
com.google.gwt.user.client.ui.Widget reference)
Determine location of widget relative to reference , such that
referencePanel.add(widget, location.getLeft(), location.getTop()) leaves the
widget in the exact same location on the screen. |
Method Summary | |
---|---|
void |
constrain(int minLeft,
int minTop,
int maxLeft,
int maxTop)
Constrain the widget location to the provided minimum and maximum values. |
int |
getLeft()
Get x coordinate. |
int |
getTop()
Get the y coordinate. |
java.lang.String |
toString()
Textual representation of this location formatted as (x, y) . |
Methods inherited from class com.allen_sauer.gwt.dnd.client.util.AbstractLocation |
---|
newLocationSnappedToGrid |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public WidgetLocation(com.google.gwt.user.client.ui.Widget widget, com.google.gwt.user.client.ui.Widget reference)
widget
relative to reference
, such that
referencePanel.add(widget, location.getLeft(), location.getTop())
leaves the
widget in the exact same location on the screen. Note that reference
need not be
the parent node, or even an ancestor of widget
. Therefore coordinates returned may
be negative or may exceed the dimensions of reference
.
widget
- the widget whose coordinates we seekreference
- the widget relative to which we seek our coordinatesMethod Detail |
---|
public void constrain(int minLeft, int minTop, int maxLeft, int maxTop)
minLeft
- the minimum left valueminTop
- the minimum top valuemaxLeft
- the maximum left valuemaxTop
- the maximum top valuepublic int getLeft()
Location
public int getTop()
Location
public java.lang.String toString()
AbstractLocation
(x, y)
.
toString
in class AbstractLocation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |