public interface PlayStation extends ResourceBridge
PlayStation
is a container for activities. All the classes capables of showing and running JClic activities must implement
this interface. It describes the necessary methods to make JClic
activities work. These methods are called by the activities to get resources, play
media or notify events.Modifier and Type | Method and Description |
---|---|
void |
activityFinished(boolean completedOk)
Activity panels use this method to notify Players that the user has finished the
current activity.
|
Action |
getAction(int id)
The action corresponding to this index.
|
ActiveMediaPlayer |
getActiveMediaPlayer(MediaContent mediaContent)
Provides an appropiated
MediaPlayer suitable for a specific media. |
int |
getCounterValue(int counterId)
Gets the current value of the specified counter.
|
Cursor |
getCustomCursor(int type)
Obtains the
Cursor resource of the specified type. |
FressaFunctions |
getFressa()
FressaFunctions offers special accessibility features
like atomatic scanning and voice synthesis.
|
void |
incCounterValue(int counterId)
Increments the value of the specified counter, or decrements it when in
countDown mode.
|
void |
playMedia(MediaContent mediaContent,
ActiveBox mediaPlacement)
Plays, performs or executes a MediaContent.
|
void |
playMsg()
Performs or executes the media associated with the current content of the
player's message box, if any.
|
void |
reportEndActivity(Activity act,
boolean solved)
Notifies the
Reporter (if any) that an action has
been finished. |
void |
reportNewAction(Activity act,
String type,
String source,
String dest,
boolean ok,
int currentScore)
Notifies the
Reporter (if any) that an action has
been performed. |
void |
reportNewActivity(Activity act,
int currentScore)
Notifies the player that the activity has been
started.
|
void |
setCountDown(int counterId,
int maxValue)
Changes the mode of operation of the specified counter to count down, starting
by the indicated value and stopping at zero.
|
void |
setCounterEnabled(int counterId,
boolean bEnabled)
Enables or disables the specified counter.
|
void |
setCounterValue(int counterId,
int newValue)
Sets the specified counter to a specific value.
|
void |
setMsg(ActiveBoxContent abc)
Sets the content of the messages area of the player.
|
void |
setSystemMessage(String msg1,
String msg2)
Sets the text of the system messages, usually displayed in the status bar of the
player.
|
void |
setWaitCursor(boolean state)
Enables or disables the wait cursor (hourglass).
|
boolean |
showHelp(JComponent hlpComponent,
String hlpMsg)
Instructs the Player to show a help dialog window displaying a content associated with the current
activity.
|
void |
startActivity(Activity.Panel actp)
Turns on the specified
Activity.Panel . |
void |
stopMedia(int level)
Stops all the media content currently playing that has a priority level equal or
below the specified.
|
displayUrl, getComponent, getMsg, getOptions, getProgressInputStream
Action getAction(int id)
edu.xtec.jclic.Constants
.id
- The index for the requested action.void setMsg(ActiveBoxContent abc)
abc
- The content to show in the message box.void playMsg()
void setSystemMessage(String msg1, String msg2)
msg1
- Text of the main message.msg2
- Text of the secondary message.void setWaitCursor(boolean state)
true
or false
params.
The hourglass is maintained while the counter remains >0.state
- To enable or disable the wait cursor.Cursor getCustomCursor(int type)
Cursor
resource of the specified type. Identifiers for all the available cursors are
defined in edu.xtec.jclic.Constants
.type
- The type of cursor requested (hand, stop, record...)Cursor
resource, or null if it does no exist.ActiveMediaPlayer getActiveMediaPlayer(MediaContent mediaContent)
MediaPlayer
suitable for a specific media.mediaContent
- The MediaContent
to be used in this MediaPlayer
.MediaPlayer
useful for this MediaContent
.void playMedia(MediaContent mediaContent, ActiveBox mediaPlacement)
mediaContent
- The MediaContent
to be performed.mediaPlacement
- The ActiveBox
where the graphical content of the media (if any) will be
displayed.void stopMedia(int level)
level
- The priority level under wich all media contents will be halted, or -1 to stop
all media.void setCounterEnabled(int counterId, boolean bEnabled)
counterId
- The identifier of the counter to enable or disable, as specified in
edu.xtec.jclic.Constants
.bEnabled
- true
to enable the counter, false
otherwise.void setCountDown(int counterId, int maxValue)
counterId
- The identifier of the counter, as specified in
edu.xtec.jclic.Constants
.maxValue
- The value to initially assign to the counter.void incCounterValue(int counterId)
counterId
- The identifier of the counter, as specified in
edu.xtec.jclic.Constants
.void setCounterValue(int counterId, int newValue)
counterId
- The identifier of the counter, as specified in
edu.xtec.jclic.Constants
.newValue
- The value to be assigned to the counter.int getCounterValue(int counterId)
counterId
- The identifier of the counter, as specified in
edu.xtec.jclic.Constants
.void startActivity(Activity.Panel actp)
Activity.Panel
.actp
- The activity panel that will be started.void activityFinished(boolean completedOk)
completedOk
- true
if the activity was successfully finished.void reportNewActivity(Activity act, int currentScore)
act
- The Activity
that has been started.currentScore
- The score at the beggining of the activity (usually zero, but can be different
in some cases)void reportNewAction(Activity act, String type, String source, String dest, boolean ok, int currentScore)
Reporter
(if any) that an action has
been performed. This method is only used by activities that explicity have the
reportActions
flag set.act
- The activity in wich panel the action has been performed.type
- The type of action, as defined in Activity
.source
- The description of the object (cell, word, letter...) in wich the action has
been performed.dest
- If the action involves more than one object, the description of the second one.ok
- true
if the action was successful, false
otherwise.currentScore
- Score obtained just after the action.void reportEndActivity(Activity act, boolean solved)
Reporter
(if any) that an action has
been finished.act
- The Activity yhat has been finished.solved
- true
if the activity was solved, false
otherwise.boolean showHelp(JComponent hlpComponent, String hlpMsg)
hlpComponent
- The JComponent
to be placed in the help dialog, or null
if no special
content must be used. Activities usually use HelpActivityComponent
objects for this param.hlpMsg
- A message to be displayed on the help window, usually used in place of a
specific JComponent. This parameter can be null
.true
if the user clicks on the OK button of the help dialog, false
otherwise.FressaFunctions getFressa()
null
if accessibility features are not enabledCopyright © 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.