|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.media.RegionManager
public class RegionManager
Manages regions (rectangles) that are invalidated in the process of ticking animations and sprites and generally doing other display related business.
| Field Summary | |
|---|---|
protected List<Rectangle> |
_dirty
A list of dirty rectangles. |
| Constructor Summary | |
|---|---|
RegionManager()
|
|
| Method Summary | |
|---|---|
void |
addDirtyRegion(Rectangle rect)
Adds the supplied rectangle to the dirty regions. |
Rectangle[] |
getDirtyRegions()
Merges all outstanding dirty regions into a single list of rectangles and returns that to the caller. |
boolean |
haveDirtyRegions()
Returns true if dirty regions have been accumulated since the last call to getDirtyRegions(). |
void |
invalidateRegion(int x,
int y,
int width,
int height)
Invalidates the specified region. |
void |
invalidateRegion(Rectangle rect)
Invalidates the specified region (the supplied rectangle will be cloned as the region manager fiddles with the rectangles it uses internally). |
protected boolean |
isValidSize(int width,
int height)
Used to ensure our dirty regions are not invalid. |
List<Rectangle> |
peekDirtyRegions()
Returns our unmerged list of dirty regions. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected List<Rectangle> _dirty
| Constructor Detail |
|---|
public RegionManager()
| Method Detail |
|---|
public void invalidateRegion(int x,
int y,
int width,
int height)
public void invalidateRegion(Rectangle rect)
public void addDirtyRegion(Rectangle rect)
invalidateRegion(int, int, int, int).
protected final boolean isValidSize(int width,
int height)
public boolean haveDirtyRegions()
getDirtyRegions().
public List<Rectangle> peekDirtyRegions()
getDirtyRegions(), this does not clear out the list of dirty
regions and prepare for the next frame.
public Rectangle[] getDirtyRegions()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||