|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectGameCanvas
LeGaGameCanvas
Custom grahpical MIDP 2.0 canvas Created by IntelliJ IDEA. User: ofsdahl Date: 23.feb.2007 Time: 14:34:33 To change this template use File | Settings | File Templates.
Field Summary | |
private boolean |
answerSent
|
private ClientNetworkThread |
clientNetwork
|
private CommandListener |
cmdL
|
private java.lang.String[] |
currentAlternatives
|
private boolean |
currentAnswerWasCorrect
|
private java.lang.String |
currentMaxScore
|
private java.lang.String |
currentQuestion
|
private java.lang.String |
currentScore
|
(package private) java.lang.String[] |
drawStringList
|
private java.lang.String |
lastResults
|
protected Image |
middleBarLine
|
private int |
nextFreeStringIndex
|
protected boolean |
readyToClose
|
private long |
resultTimer
|
protected int |
scoreCounter
|
private int |
screenState
|
private boolean |
timesUp
|
protected Image |
topBarLine
|
Constructor Summary | |
protected |
LeGaGameCanvas(boolean b)
Load pictures |
Method Summary | |
void |
answerSent()
Flag telling the graphical rendering that the answer has been sent. |
private void |
drawEndResults(Graphics g)
Draws the en result when the game is about to finish. |
private void |
drawIdleScreen(Graphics g)
Draws the idle screen. |
void |
drawQuestion(Graphics g)
Draws a quesiton and the appropriate alternatives. |
void |
drawResults(Graphics g)
Draw the temporary result after a question is answered. |
protected void |
keyPressed(int keyCode)
Interprets keystrokes |
void |
readyToClose()
Flags the program as ready to close after the user has seen his final score. |
void |
resetTimesUp()
Reset the times up flag after usage. |
void |
run()
The forever running gaphical rendering thread runs here. |
void |
setCommandListener(CommandListener cmdL)
Set the apporpriate commandlistener interface class. |
void |
setCurrentAlternatives(java.lang.String[] alternatives)
Set the alterniatives to be displayed |
void |
setCurrentQuestion(java.lang.String string)
Set the question to be displayed |
void |
setNetwork(ClientNetworkThread clientNetwork)
Makes a member reference to the network Thread. |
void |
timesUp()
Triggered from a timertask when the time is up to display the appropriate graphics. |
private void |
updateGameScreen(Graphics g)
Routs the graphical processing to the appropriate methods according to the current state of the program. |
void |
updateLastResults(java.lang.String s,
java.lang.String m)
Updates the logical representation of the end score before displaying it to the user. |
void |
updateReslts(boolean isCorrect,
java.lang.String currentScore,
java.lang.String maxScore)
Updates the logical representation of the current score before displaying it to the user. |
void |
updateScreenState(int i)
Update the current screen state according to the logical flow in the program. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
java.lang.String[] drawStringList
private int screenState
private int nextFreeStringIndex
private java.lang.String currentQuestion
private java.lang.String[] currentAlternatives
private CommandListener cmdL
private boolean answerSent
private long resultTimer
private boolean timesUp
private boolean currentAnswerWasCorrect
private java.lang.String currentScore
private java.lang.String currentMaxScore
private java.lang.String lastResults
private ClientNetworkThread clientNetwork
protected Image topBarLine
protected Image middleBarLine
protected int scoreCounter
protected boolean readyToClose
Constructor Detail |
protected LeGaGameCanvas(boolean b)
b
- supress keystrokesMethod Detail |
public void setCommandListener(CommandListener cmdL)
cmdL
- public void setCurrentAlternatives(java.lang.String[] alternatives)
alternatives
- public void setCurrentQuestion(java.lang.String string)
string
- public void run()
run
in interface java.lang.Runnable
private void updateGameScreen(Graphics g)
g
- grahpics object for rendering.private void drawIdleScreen(Graphics g)
g
- private void drawEndResults(Graphics g)
g
- public void drawQuestion(Graphics g)
g
- protected void keyPressed(int keyCode)
keyCode
- public void drawResults(Graphics g)
g
- public void updateScreenState(int i)
i
- The constant describing the state.public void answerSent()
public void updateReslts(boolean isCorrect, java.lang.String currentScore, java.lang.String maxScore)
isCorrect
- currentScore
- maxScore
- public void updateLastResults(java.lang.String s, java.lang.String m)
s
- m
- public void readyToClose()
public void timesUp()
public void resetTimesUp()
public void setNetwork(ClientNetworkThread clientNetwork)
clientNetwork
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |