Modifier and Type | Class and Description |
---|---|
protected class |
PlayerHistory.HistoryElement
PlayerHistory uses this inner class to store history elements. |
Modifier and Type | Field and Description |
---|---|
protected Player |
player
The
Player this PlayerHistory belongs to |
protected Stack<PlayerHistory.HistoryElement> |
sequenceStack
This is the main member of the class.
|
protected boolean |
testMode
When in test mode (for instance, in the
Player used by JClic author
to preview activities), jumps are only simulated. |
Constructor and Description |
---|
PlayerHistory(Player player)
Creates a new PlayerHistory
|
Modifier and Type | Method and Description |
---|---|
void |
clearHistory()
Removes all the elements from the history stack
|
boolean |
isTestMode()
Getter for property testMode.
|
boolean |
pop()
Retrieves the history element placed at the top of the stack (if any) and makes
the
Player to load it. |
boolean |
processJump(JumpInfo ji,
boolean allowReturn)
Processes the provided
JumpInfo object, instructing the Player
to go back, stop or jump to another point in the sequence. |
void |
push()
Adds the current
Player 's project and activity to the top of the
history stack. |
void |
setTestMode(boolean testMode)
Setter for property testMode.
|
int |
storedElementsCount()
Counts the number of history elements stored in the stack
|
protected Player player
Player
this PlayerHistory
belongs toprotected Stack<PlayerHistory.HistoryElement> sequenceStack
PlayerHistory
puts and retrieves
on it information about the proects and activities done by the current user.protected boolean testMode
Player
used by JClic author
to preview activities), jumps are only simulated.public PlayerHistory(Player player)
player
- The Player
this PlayerHistory
belongs topublic int storedElementsCount()
public void clearHistory()
public void push()
Player
's project and activity to the top of the
history stack.public boolean pop()
Player
to load it. The obtained effect is to "rewind" or "go back",
usually to a caller menu or activity.true
.public boolean processJump(JumpInfo ji, boolean allowReturn)
JumpInfo
object, instructing the Player
to go back, stop or jump to another point in the sequence.ji
- The JumpInfo
object to be processedallowReturn
- When this param is true
, the jump instructed by the JumpInfo
(if any) will be recorded, in order to make possible to go back to the current activity.true
if the jump can be processed without errors. false
otherwise.public boolean isTestMode()
public void setTestMode(boolean testMode)
testMode
- New value of property testMode.Copyright © 2004-15 Francesc Busquets (fbusquets@xtec.cat) & Departament d'Educació de la Generalitat de Catalunya (info@xtec.cat)
Licensed under the terms of the GNU General Public License.