edu.cmu.sun.view
Class AbstractFoldView

java.lang.Object
  extended by Component3D
      extended by edu.cmu.sun.view.AbstractListView
          extended by edu.cmu.sun.view.AbstractFoldView
Direct Known Subclasses:
BottomFoldView, MiddleFoldView, TopFoldView

public abstract class AbstractFoldView
extends AbstractListView

Parent class of all Fold Views (top, middle, and bottom). This class provides all of the geometry drawing for the fold views. It also draws the labels that are common between views, and picks up events from mouse clicks and passes the events to the controllers to handle the user's request.

Author:
Braden Kowitz, Jessica Smith

Field Summary
(package private) static Geometry BottomBackGeometry
           
(package private) static Geometry BottomFrontGeometry
           
protected  FoldViewController controller
           
(package private) static float CRINKLE_PINCH_X
           
(package private) static float CRINKLE_PINCH_Y
           
(package private) static float CRINKLE_PINCH_Z
           
protected static float crinkle_x1
           
protected static float crinkle_x2
           
protected static float crinkle_x3
           
protected static float crinkle_x4
           
protected static float crinkle_y1
           
protected static float crinkle_y2
           
protected static float crinkle_z1
           
protected static float crinkle_z2
           
protected  Component3D leftText
           
protected  Component3D middleNumber
           
private  int NUM_QUADS_PER_CRINKLE
           
protected  Component3D rightText
           
protected  float TEXT_LEFT_OFFSET
           
protected  float TEXT_RIGHT_OFFSET
           
protected  float TEXT_SIZE
           
protected  Component3D textLayer
           
(package private) static Geometry TopBackGeometry
           
(package private) static Geometry TopFrontGeometry
           
(package private) static float WINDOW_DEPTH
           
(package private) static float WINDOW_WIDTH
           
 
Fields inherited from class edu.cmu.sun.view.AbstractListView
layout
 
Constructor Summary
AbstractFoldView(LayoutComponent layout)
          basic constructor (duh, I know this isn't helpful)
 
Method Summary
 Component3D getFirstItemText()
           
 float getHeight()
           
 Component3D getLastItemText()
           
protected  Component3D getNumberText()
           
 java.lang.Class<LgEvent>[] getTargetEventClasses()
           
private  void initialize()
           
protected  java.lang.String makeAbreviation(ItemModel lim)
           
protected  Component3D makeBottomCrinkleShape()
           
private  Component3D makeCrinkle(Geometry front, Geometry back)
           
private  Geometry makeCrinkleGeometry(CompositeInterpolator3D leftEdge, CompositeInterpolator3D rightEdge, boolean forwardNormals)
          returns a top crinkle shape to be used in the layout
protected  Component3D makeSlabShape()
          the slab is a box that grows accomidate extra space in the crinkle.
protected  Component3D makeTopCrinkleShape()
           
 void processEvent(LgEvent e)
           
 void update(AnimationPlan plan, int msec)
           
 
Methods inherited from class edu.cmu.sun.view.AbstractListView
getAppearance, getLayout, setLayout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NUM_QUADS_PER_CRINKLE

private final int NUM_QUADS_PER_CRINKLE
See Also:
Constant Field Values

WINDOW_WIDTH

static final float WINDOW_WIDTH
See Also:
Constant Field Values

WINDOW_DEPTH

static final float WINDOW_DEPTH
See Also:
Constant Field Values

CRINKLE_PINCH_X

static final float CRINKLE_PINCH_X
See Also:
Constant Field Values

CRINKLE_PINCH_Y

static final float CRINKLE_PINCH_Y
See Also:
Constant Field Values

CRINKLE_PINCH_Z

static final float CRINKLE_PINCH_Z
See Also:
Constant Field Values

crinkle_x1

protected static final float crinkle_x1
See Also:
Constant Field Values

crinkle_x2

protected static final float crinkle_x2
See Also:
Constant Field Values

crinkle_x3

protected static final float crinkle_x3
See Also:
Constant Field Values

crinkle_x4

protected static final float crinkle_x4
See Also:
Constant Field Values

crinkle_y1

protected static final float crinkle_y1
See Also:
Constant Field Values

crinkle_y2

protected static final float crinkle_y2
See Also:
Constant Field Values

crinkle_z1

protected static final float crinkle_z1
See Also:
Constant Field Values

crinkle_z2

protected static final float crinkle_z2
See Also:
Constant Field Values

textLayer

protected Component3D textLayer

leftText

protected Component3D leftText

middleNumber

protected Component3D middleNumber

rightText

protected Component3D rightText

controller

protected FoldViewController controller

TEXT_SIZE

protected final float TEXT_SIZE
See Also:
Constant Field Values

TEXT_RIGHT_OFFSET

protected final float TEXT_RIGHT_OFFSET
See Also:
Constant Field Values

TEXT_LEFT_OFFSET

protected final float TEXT_LEFT_OFFSET
See Also:
Constant Field Values

TopFrontGeometry

static Geometry TopFrontGeometry

TopBackGeometry

static Geometry TopBackGeometry

BottomFrontGeometry

static Geometry BottomFrontGeometry

BottomBackGeometry

static Geometry BottomBackGeometry
Constructor Detail

AbstractFoldView

public AbstractFoldView(LayoutComponent layout)
basic constructor (duh, I know this isn't helpful)

Parameters:
listModel -
range -
Method Detail

initialize

private void initialize()

update

public void update(AnimationPlan plan,
                   int msec)
Specified by:
update in class AbstractListView

getHeight

public float getHeight()
Specified by:
getHeight in class AbstractListView

makeAbreviation

protected java.lang.String makeAbreviation(ItemModel lim)

getFirstItemText

public Component3D getFirstItemText()

getLastItemText

public Component3D getLastItemText()

getNumberText

protected Component3D getNumberText()

makeTopCrinkleShape

protected Component3D makeTopCrinkleShape()

makeBottomCrinkleShape

protected Component3D makeBottomCrinkleShape()

makeCrinkleGeometry

private Geometry makeCrinkleGeometry(CompositeInterpolator3D leftEdge,
                                     CompositeInterpolator3D rightEdge,
                                     boolean forwardNormals)
returns a top crinkle shape to be used in the layout

Returns:

makeCrinkle

private Component3D makeCrinkle(Geometry front,
                                Geometry back)

makeSlabShape

protected Component3D makeSlabShape()
the slab is a box that grows accomidate extra space in the crinkle. width: window_width - crinkle_pinch_x height: 1 meter! So, you need to scale this component in the Y dirrection when you get it.

Returns:

processEvent

public void processEvent(LgEvent e)

getTargetEventClasses

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