|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.opengl.util.packrect.LevelSet
public class LevelSet
Manages a list of Levels; this is the core data structure contained within the RectanglePacker and encompasses the storage algorithm for the contained Rects.
Constructor Summary | |
---|---|
LevelSet(int w,
int h)
A LevelSet manages all of the backing store for a region of a specified width and height. |
Method Summary | |
---|---|
boolean |
add(Rect rect)
Returns true if the given rectangle was successfully added to the LevelSet given its current dimensions, false if not. |
boolean |
canExpand(Level level,
int height)
Indicates whether it's legal to trivially increase the height of the given Level. |
void |
clear()
Clears out all Levels stored in this LevelSet. |
boolean |
compactAndAdd(Rect rect,
Object backingStore,
BackingStoreManager manager)
Allocates the given Rectangle, performing compaction of a Level if necessary. |
void |
expand(Level level,
int oldHeight,
int newHeight)
|
int |
getUsedHeight()
Gets the used height of the levels in this LevelSet. |
int |
h()
|
Iterator |
iterator()
|
boolean |
remove(Rect rect)
Removes the given Rect from this LevelSet. |
void |
setHeight(int height)
Sets the height of this LevelSet. |
void |
updateRectangleReferences()
Updates the references to the Rect objects in this LevelSet with the "next locations" of those Rects. |
float |
verticalFragmentationRatio()
Returns the vertical fragmentation ratio of this LevelSet. |
void |
visit(RectVisitor visitor)
Visits all Rects contained in this LevelSet. |
int |
w()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LevelSet(int w, int h)
Method Detail |
---|
public int w()
public int h()
public boolean add(Rect rect)
public boolean remove(Rect rect)
public boolean compactAndAdd(Rect rect, Object backingStore, BackingStoreManager manager)
add(Rect)
above. Returns true if allocated successfully, false
otherwise (indicating the need to expand the backing store).
public boolean canExpand(Level level, int height)
public void expand(Level level, int oldHeight, int newHeight)
public int getUsedHeight()
public void setHeight(int height) throws IllegalArgumentException
IllegalArgumentException
public float verticalFragmentationRatio()
public Iterator iterator()
public void visit(RectVisitor visitor)
public void updateRectangleReferences()
public void clear()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |