|
||||||||||
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 Area
public int distanceToEdge(Location location)
Area
distanceToEdge
in interface Area
location
- the reference location
public final int getBottom()
Area
getBottom
in interface Area
public Location getCenter()
Area
getCenter
in interface Area
public int getHeight()
Area
getHeight
in interface Area
public final int getLeft()
Area
getLeft
in interface Area
public final int getRight()
Area
getRight
in interface Area
public int getSize()
Area
getSize
in interface Area
public final int getTop()
Area
getTop
in interface Area
public int getWidth()
Area
getWidth
in interface Area
public boolean inBottomRight(Location location)
Area
y 45 | / |/ -----+----- x /| / |
inBottomRight
in interface Area
location
- the location to consider
public boolean intersects(Area targetArea)
Area
intersects
in interface Area
targetArea
- the area to compare to
public boolean intersects(Location location)
Area
intersects
in interface Area
location
- the location to examine
public void moveTo(Location location)
Area
moveTo
in interface Area
location
- the position to translate topublic java.lang.String toString()
[(left, top) - (right, bottom) ]
.
toString
in class java.lang.Object
protected 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 |