edu.cmu.sun.model
Class ItemModel

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

public class ItemModel
extends Model

An state model of an item in a list that represents a file or directory. Contains the basic state of each list item of a file that is displayed on the screen. Also, has some high level calls that help to handle model changes after user actions.

Author:
Braden Kowitz, Jake Pierson, Jessica Smith

Field Summary
static float CONTENT_HEIGHT
          Height of a line of text with an icon
(package private)  FileNodeModel file
           
static float HEIGHT
          Standard window height for 1 line of text;
(package private)  ListModel parentList
           
(package private)  int pinnedCount
           
(package private)  boolean selected
           
static float SPACING
          Spacing to be set between each text/icon line
 
Constructor Summary
ItemModel(FileNodeModel file, ListModel parentList)
           
 
Method Summary
 void decrementPinCount()
           
 void deselectSiblings()
           
 FileNodeModel getFile()
          returns the file that this item is based on.
 ListModel getParentListModel()
           
 int getPosition()
           
 void incrementPinCount()
           
 boolean isForcedVisible()
           
 boolean isPinned()
           
 boolean isSelected()
           
 void setSelected(boolean selected)
           
 
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

CONTENT_HEIGHT

public static final float CONTENT_HEIGHT
Height of a line of text with an icon

See Also:
Constant Field Values

SPACING

public static final float SPACING
Spacing to be set between each text/icon line

See Also:
Constant Field Values

HEIGHT

public static final float HEIGHT
Standard window height for 1 line of text;

See Also:
Constant Field Values

file

FileNodeModel file

parentList

ListModel parentList

selected

boolean selected

pinnedCount

int pinnedCount
Constructor Detail

ItemModel

public ItemModel(FileNodeModel file,
                 ListModel parentList)
Method Detail

getFile

public FileNodeModel getFile()
returns the file that this item is based on.

Returns:

isPinned

public boolean isPinned()

incrementPinCount

public void incrementPinCount()

decrementPinCount

public void decrementPinCount()

isSelected

public boolean isSelected()

setSelected

public void setSelected(boolean selected)

isForcedVisible

public boolean isForcedVisible()

deselectSiblings

public void deselectSiblings()

getParentListModel

public ListModel getParentListModel()

getPosition

public int getPosition()