edu.cmu.sun.model
Class ColumnModel

java.lang.Object
  extended by edu.cmu.sun.model.Model
      extended by edu.cmu.sun.model.ColumnModel

public class ColumnModel
extends Model

Model for the state of a column of windows. Contains a list of WindowModels for the contents of this column. Also does some basic layout for the components within the column.

Author:
Braden Kowitz, Jake Pierson, Jessica Smith

Nested Class Summary
static class ColumnModel.Stacked
           
 
Field Summary
(package private)  WindowModel activeWindowModel
           
(package private)  SceneModel sceneModel
           
static float SPACING
           
static float STACKED_WIDTH
           
(package private)  ColumnModel.Stacked stackedModel
           
static float UNSTACKED_WIDTH
           
(package private)  java.util.ArrayList<WindowModel> windows
           
 
Constructor Summary
ColumnModel()
           
 
Method Summary
 void addWindow(WindowModel win)
           
 boolean contains(WindowModel model)
           
 WindowModel getActiveWindowModel()
           
 ColumnModel getNextColumn()
           
 int getPosition(WindowModel model)
           
 ColumnModel getPrevColumn()
           
 SceneModel getSceneModel()
           
 int getSize()
           
 ColumnModel.Stacked getStackedModel()
           
 float getWidth()
           
 java.util.List<WindowModel> getWindowModels()
          returns a list of the windows in this model.
 boolean isEmpty()
           
protected  void needsUpdate()
          Called by subclasses to signial that a model has changed and needs updating.
 void removeWindow(WindowModel win)
           
private  void resizeWindowModels()
           
 void setActiveWindowModel(WindowModel activeWindowModel)
           
 void setSceneModel(SceneModel sceneModel)
           
 void sortWindows()
           
 
Methods inherited from class edu.cmu.sun.model.Model
addModelListener, notifyAllListeners, notifyListeners, removeModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPACING

public static final float SPACING
See Also:
Constant Field Values

UNSTACKED_WIDTH

public static final float UNSTACKED_WIDTH
See Also:
Constant Field Values

STACKED_WIDTH

public static final float STACKED_WIDTH
See Also:
Constant Field Values

windows

java.util.ArrayList<WindowModel> windows

activeWindowModel

WindowModel activeWindowModel

sceneModel

SceneModel sceneModel

stackedModel

ColumnModel.Stacked stackedModel
Constructor Detail

ColumnModel

public ColumnModel()
Method Detail

addWindow

public void addWindow(WindowModel win)

removeWindow

public void removeWindow(WindowModel win)

contains

public boolean contains(WindowModel model)

getWindowModels

public java.util.List<WindowModel> getWindowModels()
returns a list of the windows in this model. Note: this returns a COPY of the underlying structure.

Returns:

getActiveWindowModel

public WindowModel getActiveWindowModel()

setActiveWindowModel

public void setActiveWindowModel(WindowModel activeWindowModel)

needsUpdate

protected void needsUpdate()
Description copied from class: Model
Called by subclasses to signial that a model has changed and needs updating. Really, the views need updating, the model needs to send out modelChanged(...) updates.

Overrides:
needsUpdate in class Model

resizeWindowModels

private void resizeWindowModels()

getSceneModel

public SceneModel getSceneModel()

setSceneModel

public void setSceneModel(SceneModel sceneModel)

getWidth

public float getWidth()

getNextColumn

public ColumnModel getNextColumn()

getPrevColumn

public ColumnModel getPrevColumn()

sortWindows

public void sortWindows()

getPosition

public int getPosition(WindowModel model)

getStackedModel

public ColumnModel.Stacked getStackedModel()

isEmpty

public boolean isEmpty()

getSize

public int getSize()