public abstract class Activity extends Object implements Constants, Editable, Domable
Activity
is the abstract base class for JClic activities. It
defines also the inner class Activity.Panel
, wich is
responsible of the user interaction with the activity content.
Activities should extend both Activity
and
Activity.Panel
classes in order to become fully operative.
JClic stores activities in memory as Element
objects. So,
all non-transient data must be stored to and retrieved from JDom elements.Modifier and Type | Class and Description |
---|---|
class |
Activity.Panel |
Modifier and Type | Field and Description |
---|---|
static int |
AB |
ActiveBagContent[] |
abc |
Point |
absolutePosition
Position of the activity panel into the
Player . |
boolean |
absolutePositioned
Whether to place the activity panel at the point specified by
absolutePosition , or leave it centered in the main window of the player. |
protected AutoContentProvider |
acp |
static String |
ACTION_HELP |
static String |
ACTION_MATCH |
static String |
ACTION_PLACE |
static String |
ACTION_SELECT |
static String |
ACTION_WRITE |
static String |
ACTIONS |
protected Color |
activityBgColor |
protected Gradient |
activityBgGradient |
static int |
AUB |
static int |
BA |
protected boolean |
bActionsCounter |
static String |
BASE_CLASS |
static String |
BASE_CLASS_TAG |
Color |
bgColor
Background color of the activity panel.
|
static String |
BGCOLOR |
Gradient |
bgGradient
Gradient used to draw the background of the activity panel.
|
String |
bgImageFile
Filename of the image painted in the panel background.
|
boolean |
border
Whether to draw a border around the activity panel.
|
static String |
BORDER |
int |
boxGridPos |
protected boolean |
bScoreCounter |
protected boolean |
bTimeCounter |
static int |
BUA |
static String |
CLUE |
static String |
CLUES |
String |
code
Code used in reports to filter queries.
|
static String |
CODE |
static String[][] |
COMPATIBLE_ACTIVITIES |
static String |
CONTAINER |
static String |
COUNT_DOWN_ACTIONS |
static String |
COUNT_DOWN_TIME |
boolean |
countDownActions
Whether the actions counter should display a countdown when
maxActions > 0. |
boolean |
countDownTime
Whether the time counter should display a countdown when
maxTime > 0. |
static String |
COUNTERS |
static Color |
DEFAULT_BG_COLOR |
static int |
DEFAULT_GRID_ELEMENT_SIZE |
static int |
DEFAULT_HEIGHT |
static int |
DEFAULT_MARGIN |
static String |
DEFAULT_NAME |
static int |
DEFAULT_SHUFFLES |
static int |
DEFAULT_WIDTH |
String |
description
Description of the activity.
|
static String |
DESCRIPTION |
static String |
DRAG_CELLS |
boolean |
dragCells
Wheter the cells of the activity will be dragged across the screen.
|
static String |
ELEMENT_NAME |
static int |
END
Identifier of the message displayed when the user successfully ends the
activity.
|
static int |
END_ERROR
Identifier of the message displayed when the user exceeds the maximum amount of time
or actions allowed.
|
EventSounds |
eventSounds
Specific set of
EventSounds used in the activity. |
static String |
FILE |
static String |
GRID |
static String |
HEIGHT |
static String |
HELP_SHOW_SOLUTION |
static String |
HELP_WINDOW |
String |
helpMsg
Message to show in the help window when
showSolution is false . |
boolean |
helpWindow
Whether to have a help window or not.
|
static String |
IMAGE |
boolean |
includeInReports
Whether to generate usage reports.
|
static String |
INFO_CMD |
static String |
INFO_URL |
String |
infoCmd
System command to be executed when the user clicks the info button.
|
String |
infoUrl
String with the URL to be displayed when the user clicks on the info button.
|
boolean |
invAss |
static String |
LAYOUT |
static String[] |
LAYOUT_NAMES |
static int |
MAIN
Identifier of the main message, displayed as long as the activity is playing.
|
int |
margin
Space, measured in pixels, between the activity components.
|
static String |
MARGIN |
static String |
MAX_ACTIONS |
static String |
MAX_TIME |
int |
maxActions
Maximum number of actions allowed to solve the activity.
|
int |
maxTime
Maximum amount of time (seconds) to solve the activity.
|
protected ActiveBoxContent[] |
messages |
static String |
MESSAGES |
static int |
MINIMUM_HEIGHT |
static int |
MINIMUM_WIDTH |
static String[] |
MSG_TYPE
String labels corresponding to the four identifiers of JClic messages:
PREVIOUS, MAIN, END and END_ERROR.
|
String |
name
The activity name
|
static String |
NAME |
static int |
NUM_MSG
Number of message types.
|
static String |
POSITION |
static int |
PREVIOUS
Identifier of the message displayed before the activity starts.
|
static String |
PRIMARY |
protected JClicProject |
project
The
JClicProject this activity belongs to. |
static String |
RANDOM_CHARS |
static String |
REPORT |
static String |
REPORT_ACTIONS |
boolean |
reportActions
Whether to send action events to the
Reporter . |
static String |
ROW |
static String |
SCORE |
boolean[] |
scramble |
static String |
SCRAMBLE |
static String |
SECONDARY |
static String |
SETTINGS |
boolean |
showSolution
Whether to show the solution on the help window.
|
protected int |
shuffles |
static String |
SIZE |
String |
skinFileName
File name of the Skin used by the activity.
|
static String |
SOLVED_PRIMARY |
static String |
SOLVED_SECONDARY |
TextGridContent |
tgc |
static String |
TILED |
boolean |
tiledBgImg
Whether the bgImage (if any) has to be tiled across the panel background.
|
static String |
TIME |
static String |
TIMES |
static String |
TRANSPARENT |
protected boolean |
transparentBg |
static String |
TYPE |
static String |
USE_ORDER |
boolean |
useOrder
Wheter the activity must be solved in a specific order.
|
static String |
WIDTH |
static String |
WINDOW |
protected Dimension |
windowSize |
static String |
X |
static String |
Y |
AC_MARGIN, ACTION_AUDIO, ACTION_HLP, ACTION_INFO, ACTION_NAME, ACTION_NEXT, ACTION_PREV, ACTION_REPORTS, ACTION_RESET, ACTION_RETURN, ACTIONS_COUNTER, ACTIVITY_OBJECT, AUDIO_ENABLED, BG_COLOR, COMMON_SETTINGS, COMPRESS_IMAGES, COOKIE, counterNames, DEFAULT, DEFAULT_BUNDLE, DEFAULT_RENDERING_HINTS, DYNAMIC_ACTIONS, ENABLED, EXIT_URL, EXTERNAL_OBJECT, FALSE, HAND_CURSOR, ID, INFO_URL_FRAME, JMF, LOGO_ICON, MEDIA_OBJECT, MEDIA_SYSTEM, MEDIA_SYSTEMS, MIN_CELL_SIZE, MYURL, NAV_BUTTONS_ALWAYS, NO_MEDIASYSTEM_WARN, NUM_ACTIONS, NUM_COUNTERS, OK_CURSOR, PRE_DRAW_IMAGES, PROGRAM, PROJECT_OBJECT, QT, QT61, REC_CURSOR, REPORTER_CLASS, REPORTER_PARAMS, SCORE_COUNTER, SEQUENCE_OBJECT, SKIN, SKIN_OBJECT, SYSTEM_SOUNDS, T_ACTIVITY, T_ANIM, T_AUDIO, T_CLIC, T_EXTERNAL, T_FONT, T_IMAGE, T_INST, T_JCLIC, T_MEDIA, T_MIDI, T_SEQUENCE, T_TEXT, T_UNKNOWN_MEDIA, T_URL, T_VIDEO, T_XML, TIME_COUNTER, TRACE, TRUE, URL_BASE, URL_OBJECT
Constructor and Description |
---|
Activity(JClicProject project)
Creates new edu.xtec.jclicActivity
|
protected JClicProject project
JClicProject
this activity belongs to.public String name
public String code
public String description
public int margin
public Color bgColor
public Gradient bgGradient
public boolean tiledBgImg
public String bgImageFile
public boolean border
public boolean absolutePositioned
absolutePosition
, or leave it centered in the main window of the player.public boolean includeInReports
public boolean reportActions
Reporter
.public boolean helpWindow
public boolean showSolution
public String helpMsg
showSolution
is false
.public EventSounds eventSounds
EventSounds
used in the activity. The default is null
,
meaning to use the Player
sounds.public boolean useOrder
false
.public boolean dragCells
false
,
a line will be painted to link elements.public String skinFileName
public int maxTime
0
,
meaning unlimited time.public boolean countDownTime
maxTime
> 0.public int maxActions
0
,
meaning unlimited actions.public boolean countDownActions
maxActions
> 0.public String infoUrl
null
.public String infoCmd
null
. Applets have this function disabled.public static final String[] MSG_TYPE
public static final int PREVIOUS
public static final int MAIN
public static final int END
public static final int END_ERROR
maxTime
,
maxActions
,
Constant Field Valuespublic static final int NUM_MSG
protected ActiveBoxContent[] messages
protected Dimension windowSize
protected boolean transparentBg
protected Color activityBgColor
protected Gradient activityBgGradient
protected boolean bTimeCounter
protected boolean bScoreCounter
protected boolean bActionsCounter
protected int shuffles
protected AutoContentProvider acp
public ActiveBagContent[] abc
public TextGridContent tgc
public int boxGridPos
public boolean[] scramble
public boolean invAss
public static final int AB
public static final int BA
public static final int AUB
public static final int BUA
public static final String[] LAYOUT_NAMES
public static final int DEFAULT_WIDTH
public static final int DEFAULT_HEIGHT
public static final int MINIMUM_WIDTH
public static final int MINIMUM_HEIGHT
public static final String DEFAULT_NAME
public static final int DEFAULT_MARGIN
public static final int DEFAULT_SHUFFLES
public static final int DEFAULT_GRID_ELEMENT_SIZE
public static final Color DEFAULT_BG_COLOR
public static final String ACTION_MATCH
public static final String ACTION_PLACE
public static final String ACTION_WRITE
public static final String ACTION_SELECT
public static final String ACTION_HELP
public static final String ELEMENT_NAME
public static final String NAME
public static final String BASE_CLASS
public static final String BASE_CLASS_TAG
public static final String CODE
public static final String DESCRIPTION
public static final String MESSAGES
public static final String TYPE
public static final String SETTINGS
public static final String LAYOUT
public static final String MARGIN
public static final String CONTAINER
public static final String BGCOLOR
public static final String IMAGE
public static final String TILED
public static final String COUNTERS
public static final String TIME
public static final String ACTIONS
public static final String SCORE
public static final String WINDOW
public static final String TRANSPARENT
public static final String BORDER
public static final String POSITION
public static final String X
public static final String Y
public static final String SIZE
public static final String WIDTH
public static final String HEIGHT
public static final String PRIMARY
public static final String SECONDARY
public static final String SOLVED_PRIMARY
public static final String SOLVED_SECONDARY
public static final String GRID
public static final String ROW
public static final String CLUES
public static final String CLUE
public static final String RANDOM_CHARS
public static final String SCRAMBLE
public static final String TIMES
public static final String REPORT
public static final String REPORT_ACTIONS
public static final String HELP_WINDOW
public static final String HELP_SHOW_SOLUTION
public static final String USE_ORDER
public static final String DRAG_CELLS
public static final String FILE
public static final String MAX_TIME
public static final String COUNT_DOWN_TIME
public static final String MAX_ACTIONS
public static final String COUNT_DOWN_ACTIONS
public static final String INFO_URL
public static final String INFO_CMD
public static final String[][] COMPATIBLE_ACTIVITIES
public Activity(JClicProject project)
public void initNew()
public String getPublicName()
public JClicProject getProject()
public Editor getEditor(Editor parent)
Editable
Editor
associated to this object.public String getShortClassName()
public String[] getSimilarActivityClasses()
public Element getJDomElement()
getJDomElement
in interface Domable
public static Activity getActivity(Object o, JClicProject project) throws Exception
Exception
public void setProperties(Element e, Object aux) throws Exception
setProperties
in interface Domable
Exception
public void setProperties(Clic3Activity c3a) throws Exception
Exception
public ActiveBoxContent[] getMessages()
public String toHtmlString(ResourceBridge rb)
public void initAutoContentProvider()
public boolean prepareMedia(PlayStation ps)
protected Activity getActivity()
public abstract Activity.Panel getActivityPanel(PlayStation ps)
public boolean helpSolutionAllowed()
public boolean helpWindowAllowed()
public abstract int getMinNumActions()
public boolean mustPauseSequence()
public boolean canReinit()
public boolean hasInfo()
public boolean hasRandom()
public boolean shuffleAlways()
public boolean needsKeyboard()
public void end()
public void clear()
public void finalize() throws Throwable
public Dimension getWindowSize()
public void setWindowSize(Dimension windowSize)
windowSize
- New value of property windowSize.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.