|
||||||||||
| 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.AbstractArea
public abstract class AbstractArea
Provides implementations for common Area calculations.
| Constructor Summary | |
|---|---|
AbstractArea()
|
|
| Method Summary | |
|---|---|
Area |
copyOf()
Clone our area. |
int |
distanceToEdge(Location location)
Determine the shortest distance from the location to the edge of the area. |
int |
getBottom()
Get the area's bottom coordinate in pixels. |
Location |
getCenter()
Get the area's center Location. |
int |
getHeight()
Get the area's height. |
int |
getLeft()
Get the area's left coordinate in pixels. |
int |
getRight()
Get the area's right coordinate in pixels. |
int |
getSize()
Determine area (width * height). |
int |
getTop()
Get the area's top coordinate in pixels. |
int |
getWidth()
Get the area's width. |
boolean |
inBottomRight(Location location)
Determine if location is to the bottom-right of the following 45 degree line. |
boolean |
intersects(Area targetArea)
Determine if the target area intersects our area. |
boolean |
intersects(Location location)
Determine if the provided location intersects with our area. |
void |
moveTo(Location location)
Translate our top left position to the new location. |
protected void |
setBottom(int bottom)
Set bottom coordinate. |
protected void |
setLeft(int left)
Set left coordinate. |
protected void |
setRight(int right)
Set right coordinate. |
protected void |
setTop(int top)
Set top coordinate. |
java.lang.String |
toString()
Textual representation of this area formatted as [(left, top) - (right, bottom) ]. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractArea()
| Method Detail |
|---|
public Area copyOf()
Area
copyOf in interface Areapublic int distanceToEdge(Location location)
Area
distanceToEdge in interface Arealocation - the reference location
public final int getBottom()
Area
getBottom in interface Areapublic Location getCenter()
Area
getCenter in interface Areapublic int getHeight()
Area
getHeight in interface Areapublic final int getLeft()
Area
getLeft in interface Areapublic final int getRight()
Area
getRight in interface Areapublic int getSize()
Area
getSize in interface Areapublic final int getTop()
Area
getTop in interface Areapublic int getWidth()
Area
getWidth in interface Areapublic boolean inBottomRight(Location location)
Area
y 45
| /
|/
-----+----- x
/|
/ |
inBottomRight in interface Arealocation - the location to consider
public boolean intersects(Area targetArea)
Area
intersects in interface AreatargetArea - the area to compare to
public boolean intersects(Location location)
Area
intersects in interface Arealocation - the location to examine
public void moveTo(Location location)
Area
moveTo in interface Arealocation - the position to translate topublic java.lang.String toString()
[(left, top) - (right, bottom) ].
toString in class java.lang.Objectprotected final void setBottom(int bottom)
bottom - the bottom coordinate in pixelsprotected final void setLeft(int left)
left - the left coordinate in pixelsprotected final void setRight(int right)
right - the right coordinate in pixelsprotected final void setTop(int top)
top - the top coordinate in pixels
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||