edu.cmu.sun.view
Class ItemView

java.lang.Object
  extended by Component3D
      extended by edu.cmu.sun.view.ItemView
All Implemented Interfaces:
ModelListener

public class ItemView
extends Component3D
implements ModelListener

Draws the line-item that represents a file and handles click-events. An ItemView is based on an ItemModel and updates its appearance whenever the underlying model changes. It also functions as a listener to itself. When a mouse event occours, the ItemView sends off the appropriate action to a controller.

Author:
Braden Kowitz, Jessica Smith

Field Summary
(package private)  BoxComponent backdropComp
           
(package private)  ItemController controller
           
(package private) static float HEIGHT
           
(package private) static float HIGHLIGHT_DEPTH
           
private static float HIGHLIGHT_WIDTH
           
(package private) static float ICON_SIZE
           
(package private) static float INSET
           
private static float LABEL_WIDTH
           
(package private) static float LINE_WIDTH
           
(package private)  ItemModel model
           
(package private) static javax.vecmath.Color4f PINNED_OUTLINE_C4F
           
(package private) static Appearance pinnedAppearance
           
(package private)  Component3D pinnedComp
           
(package private) static Geometry pinnedGeometry
           
(package private) static float RIGHT_INSET
           
(package private) static Appearance SELECTED_APP
           
(package private)  BoxComponent selectionComp
           
(package private) static float SPACING
           
(package private)  TextComponent textComp
           
(package private) static float WIDTH
           
(package private) static float Z_LAYER_1
           
(package private) static float Z_LAYER_2
           
 
Constructor Summary
ItemView(ItemModel model)
           
 
Method Summary
 ItemModel getModel()
           
private  Appearance getPinnedAppearance()
           
private  Geometry getPinnedGeometry()
           
 java.lang.Class<LgEvent>[] getTargetEventClasses()
           
private  void initialize()
           
 void modelChanged(Model m)
           
 void processEvent(LgEvent e)
           
private  java.lang.String truncate(java.lang.String name)
           
 void update()
          update the visual appearance of this view from the model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

model

ItemModel model

controller

ItemController controller

textComp

TextComponent textComp

selectionComp

BoxComponent selectionComp

pinnedComp

Component3D pinnedComp

backdropComp

BoxComponent backdropComp

WIDTH

static final float WIDTH
See Also:
Constant Field Values

HEIGHT

static final float HEIGHT
See Also:
Constant Field Values

HIGHLIGHT_DEPTH

static final float HIGHLIGHT_DEPTH
See Also:
Constant Field Values

Z_LAYER_1

static final float Z_LAYER_1
See Also:
Constant Field Values

Z_LAYER_2

static final float Z_LAYER_2
See Also:
Constant Field Values

SPACING

static final float SPACING
See Also:
Constant Field Values

ICON_SIZE

static final float ICON_SIZE
See Also:
Constant Field Values

INSET

static final float INSET
See Also:
Constant Field Values

RIGHT_INSET

static final float RIGHT_INSET
See Also:
Constant Field Values

HIGHLIGHT_WIDTH

private static final float HIGHLIGHT_WIDTH
See Also:
Constant Field Values

SELECTED_APP

static final Appearance SELECTED_APP

PINNED_OUTLINE_C4F

static final javax.vecmath.Color4f PINNED_OUTLINE_C4F

LINE_WIDTH

static final float LINE_WIDTH
See Also:
Constant Field Values

LABEL_WIDTH

private static final float LABEL_WIDTH
See Also:
Constant Field Values

pinnedAppearance

static Appearance pinnedAppearance

pinnedGeometry

static Geometry pinnedGeometry
Constructor Detail

ItemView

public ItemView(ItemModel model)
Method Detail

initialize

private void initialize()

truncate

private java.lang.String truncate(java.lang.String name)

getPinnedGeometry

private Geometry getPinnedGeometry()

getPinnedAppearance

private Appearance getPinnedAppearance()

update

public void update()
update the visual appearance of this view from the model.


processEvent

public void processEvent(LgEvent e)

getTargetEventClasses

public java.lang.Class<LgEvent>[] getTargetEventClasses()

modelChanged

public void modelChanged(Model m)
Specified by:
modelChanged in interface ModelListener

getModel

public ItemModel getModel()