graphics
Class MeasureUpMode

java.lang.Object
  extended by graphics.MeasureUpMode
All Implemented Interfaces:
GameMode

public class MeasureUpMode
extends Object
implements GameMode


Field Summary
private  boolean allBarsStoppedAssumer
           
private  ArrayList<BarGraphics> barList
           
private  ArrayList<Color> colorList
           
private  boolean continueRequested
           
private  String correctAnswer
           
private  float correctZ
           
private  boolean done
           
private  com.sun.opengl.util.j2d.TextRenderer hiresTextRenderer
           
private  QuestionGraphics question
           
private  long roundInfoStartTime
           
private  Respondent[] roundRespondents
           
private  float rtri
           
private  boolean soundPlayed
           
private  com.sun.opengl.util.j2d.TextRenderer textRenderer
           
 
Constructor Summary
MeasureUpMode()
           
 
Method Summary
 boolean displayFeedback(javax.media.opengl.GLAutoDrawable glDrawable, boolean isLastQuestion)
          Displays the actual feedback graphics.
 boolean displayRoundIntro(javax.media.opengl.GLAutoDrawable glDrawable)
          Displays the actual intro to the following round.
 void initFeedback(QuestionGraphics question, Respondent[] respondents, javax.media.opengl.GLAutoDrawable glDrawable)
          Method is called prior to every time feedback is shown.
 void initMode(com.sun.opengl.util.j2d.TextRenderer textRenderer)
          Calld before starting to display a new mode.
 void initRoundIntro()
          Method is called prior to every round.
 void nextStep()
          This method is called when the user wishes to conticue to the next step.
 void resetFeedBack(javax.media.opengl.GLAutoDrawable glDrawable)
          Called once after displayFeedback returns.
 void setRoundRespondents(Respondent[] respondents)
          This method is called every time a feedbakc from the server is received.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rtri

private float rtri

correctZ

private float correctZ

textRenderer

private com.sun.opengl.util.j2d.TextRenderer textRenderer

done

private boolean done

correctAnswer

private String correctAnswer

barList

private ArrayList<BarGraphics> barList

colorList

private ArrayList<Color> colorList

question

private QuestionGraphics question

roundInfoStartTime

private long roundInfoStartTime

hiresTextRenderer

private com.sun.opengl.util.j2d.TextRenderer hiresTextRenderer

roundRespondents

private Respondent[] roundRespondents

allBarsStoppedAssumer

private boolean allBarsStoppedAssumer

soundPlayed

private boolean soundPlayed

continueRequested

private boolean continueRequested
Constructor Detail

MeasureUpMode

public MeasureUpMode()
Method Detail

initMode

public void initMode(com.sun.opengl.util.j2d.TextRenderer textRenderer)
Description copied from interface: GameMode
Calld before starting to display a new mode. Can be used to load textures, initialize counters and reset parameters.

Specified by:
initMode in interface GameMode
Parameters:
textRenderer - a TextRenderer object can be optionally provided for use in later methods.

initRoundIntro

public void initRoundIntro()
Description copied from interface: GameMode
Method is called prior to every round. Optional implementation of texture loading, counter reset or variable implementation can be added in this method.

Specified by:
initRoundIntro in interface GameMode

displayRoundIntro

public boolean displayRoundIntro(javax.media.opengl.GLAutoDrawable glDrawable)
Description copied from interface: GameMode
Displays the actual intro to the following round. The method is continuously called per frame until it returns false. The developper may freely use the previously initialized textRenderer or draw as he wishes on the glDrawable object.

Specified by:
displayRoundIntro in interface GameMode
Returns:

initFeedback

public void initFeedback(QuestionGraphics question,
                         Respondent[] respondents,
                         javax.media.opengl.GLAutoDrawable glDrawable)
Description copied from interface: GameMode
Method is called prior to every time feedback is shown. Optional implementation of texture loading, counter reset or variable implementation can be added in this method.

Specified by:
initFeedback in interface GameMode

displayFeedback

public boolean displayFeedback(javax.media.opengl.GLAutoDrawable glDrawable,
                               boolean isLastQuestion)
Description copied from interface: GameMode
Displays the actual feedback graphics. The method is continuously called per frame until it returns false. The developper may freely use the previously initialized textRenderer or draw as he wishes on the glDrawable object.

Specified by:
displayFeedback in interface GameMode
isLastQuestion - boolean telling wether the recently posed question is the last in a round.
Returns:

resetFeedBack

public void resetFeedBack(javax.media.opengl.GLAutoDrawable glDrawable)
Description copied from interface: GameMode
Called once after displayFeedback returns. The method is intended for clenup and resetting of variables after the feedback graphics is displayed.

Specified by:
resetFeedBack in interface GameMode

setRoundRespondents

public void setRoundRespondents(Respondent[] respondents)
Description copied from interface: GameMode
This method is called every time a feedbakc from the server is received. Thei mplementation of this method is meant to update the internal model of the respondents and their game mode specific response number.

Specified by:
setRoundRespondents in interface GameMode
Parameters:
respondents - Array of Respondent object containing their game mode specific integer e.g. last answer.

nextStep

public void nextStep()
Description copied from interface: GameMode
This method is called when the user wishes to conticue to the next step. Normally this should result in the dispalyFeedback method to return.

Specified by:
nextStep in interface GameMode