edu.cmu.sun.model
Class SceneModel
java.lang.Object
edu.cmu.sun.model.Model
edu.cmu.sun.model.SceneModel
public class SceneModel
- extends Model
A state model of the available screen space and column order.
The Scene model contains a list of ColumnModels. It is responsible
for layout out columns so that they fit on the screen. So, it stacks
columns as necessary to make room.
It also handles updates to the total amount of screen space left. There are
some bugs in this, but it does an okay job for the demo.
- Author:
- Braden Kowitz, Jake Pierson, Jessica Smith
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
columns
java.util.List<ColumnModel> columns
recentlyUsedColumns
java.util.LinkedList<ColumnModel> recentlyUsedColumns
P2M
public static final float P2M
- See Also:
- Constant Field Values
BORDER
public static final float BORDER
- See Also:
- Constant Field Values
BOTTOM_BORDER
public static final float BOTTOM_BORDER
- See Also:
- Constant Field Values
sceneHeight
static float sceneHeight
sceneWidth
static float sceneWidth
SPACING
public static final float SPACING
- See Also:
- Constant Field Values
lastSizeWidth
float lastSizeWidth
lastSizeHeight
float lastSizeHeight
SceneModel
public SceneModel()
addColumn
public void addColumn(ColumnModel col)
removeColumn
public void removeColumn(ColumnModel col)
getHeight
public static float getHeight()
getWidth
public static float getWidth()
getColumnModels
public java.util.List<ColumnModel> getColumnModels()
getNextColumn
public ColumnModel getNextColumn(ColumnModel afterThisColumn)
getPrevColumn
public ColumnModel getPrevColumn(ColumnModel beforeThisColumn)
makeUnstacked
public void makeUnstacked(ColumnModel col)
makeRecent
public void makeRecent(ColumnModel col)
updateStacking
public void updateStacking()
unstackRecentColumn
private boolean unstackRecentColumn()
stackOldColumn
private boolean stackOldColumn()
- tries to stack the least recently used column.
If there are no more columns left to stack, it returns false.
Otherwise, true.
- Returns:
getSceneWidth
private float getSceneWidth()
setSize
public void setSize(float height,
float width)