edu.cmu.sun.model
Class WindowModel

java.lang.Object
  extended by edu.cmu.sun.model.Model
      extended by edu.cmu.sun.model.WindowModel
All Implemented Interfaces:
java.lang.Comparable<WindowModel>

public class WindowModel
extends Model
implements java.lang.Comparable<WindowModel>

A state model of the windows (, or panels,) seen in the interface. The WindowModel is based on a ListModel. The window is then tasked to displaying the contents of the list. This class handles a lot of the high level behavior needed after a user action. Adjacent columns need to be modified, etc.

Author:
Braden Kowitz, Jessica Smith

Field Summary
(package private)  boolean closeable
           
(package private)  ColumnModel columnModel
           
(package private)  int indexOfInterest
           
(package private)  Layout layout
           
(package private)  LayoutCreator layoutManager
           
(package private)  ListModel listModel
           
(package private)  ItemModel parentItemModel
           
(package private)  boolean pinned
           
 
Constructor Summary
WindowModel(FileNodeModel file)
           
WindowModel(ItemModel item)
           
WindowModel(ListModel listModel)
           
 
Method Summary
 void close()
           
 int compareTo(WindowModel other)
           
 ColumnModel getColumnModel()
           
 float getHeight()
           
 int getIndexOfInterest()
           
 Layout getLayout()
           
 ListModel getListModel()
           
 float getMinHeight()
           
 ItemModel getParentItemModel()
           
private  int getParentItemPosition()
           
private  WindowModel getParentWindow()
           
private  int getParentWindowPosition()
           
 float getPerferedHeight()
           
private  int getPosition()
           
 java.lang.String getTitle()
           
 boolean isCloseable()
           
 boolean isPinned()
           
 void makeActive()
           
 void setCloseable(boolean closeable)
           
 void setColumnModel(ColumnModel columnModel)
           
 void setIndexOfInterest(int primaryIndex)
           
 void setMaxHeight(float maxHeight)
           
 void setParentItemModel(ItemModel parentItemModel)
           
 void setPinned(boolean pinned)
           
 void updateChildrenWindows()
           
private  void updateParentPinnedState(boolean isPinned)
          set's this parentItem's state, then, called recusrively on parent window to call the same down the line.
 
Methods inherited from class edu.cmu.sun.model.Model
addModelListener, needsUpdate, notifyAllListeners, notifyListeners, removeModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listModel

ListModel listModel

columnModel

ColumnModel columnModel

layoutManager

LayoutCreator layoutManager

layout

Layout layout

parentItemModel

ItemModel parentItemModel

closeable

boolean closeable

pinned

boolean pinned

indexOfInterest

int indexOfInterest
Constructor Detail

WindowModel

public WindowModel(ItemModel item)

WindowModel

public WindowModel(FileNodeModel file)

WindowModel

public WindowModel(ListModel listModel)
Method Detail

getTitle

public java.lang.String getTitle()

isPinned

public boolean isPinned()

setPinned

public void setPinned(boolean pinned)

updateParentPinnedState

private void updateParentPinnedState(boolean isPinned)
set's this parentItem's state, then, called recusrively on parent window to call the same down the line.

Parameters:
isPinned -

getListModel

public ListModel getListModel()

getIndexOfInterest

public int getIndexOfInterest()

setIndexOfInterest

public void setIndexOfInterest(int primaryIndex)

getColumnModel

public ColumnModel getColumnModel()

setColumnModel

public void setColumnModel(ColumnModel columnModel)

getMinHeight

public float getMinHeight()

getPerferedHeight

public float getPerferedHeight()

setMaxHeight

public void setMaxHeight(float maxHeight)

getHeight

public float getHeight()

getLayout

public Layout getLayout()

makeActive

public void makeActive()

updateChildrenWindows

public void updateChildrenWindows()

close

public void close()

getParentItemModel

public ItemModel getParentItemModel()

setParentItemModel

public void setParentItemModel(ItemModel parentItemModel)

compareTo

public int compareTo(WindowModel other)
Specified by:
compareTo in interface java.lang.Comparable<WindowModel>

getParentItemPosition

private int getParentItemPosition()

getParentWindowPosition

private int getParentWindowPosition()

getPosition

private int getPosition()

getParentWindow

private WindowModel getParentWindow()

isCloseable

public boolean isCloseable()

setCloseable

public void setCloseable(boolean closeable)