|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.malai.instrument.Instrument
public abstract class Instrument
Defines an abstract model of an instrument.
This file is part of libMalai.
Copyright (c) 2009-2012 Arnaud BLOUIN
libMalan is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later version.
libMalan is distributed without any warranty; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
Field Summary | |
---|---|
protected boolean |
activated
Defines if the instrument is activated or not. |
protected java.util.List<Eventable> |
eventables
The eventable objects that the instrument uses. |
protected java.util.List<Link<?,?,?>> |
links
The links of the instrument. |
protected boolean |
modified
Defined if the instrument has been modified. |
Constructor Summary | |
---|---|
Instrument()
Creates and initialises the instrument. |
Method Summary | |
---|---|
void |
addEventable(Eventable eventable)
Binds the interaction of the links of the instrument to a Eventable object that produces events used by the interactions. |
protected void |
addLink(Link<?,?,?> link)
Adds the given link to the list of links of the instrument. |
void |
clearEvents()
Stops the interactions of the instrument and clears all its events waiting for a process. |
java.util.List<Link<?,?,?>> |
getLinks()
|
int |
getSizeLinks()
|
boolean |
hasLinks()
|
protected abstract void |
initialiseLinks()
Initialises the links of the instrument. |
void |
interimFeedback()
Reinitialises the interim feedback of the instrument. |
boolean |
isActivated()
|
boolean |
isModified()
|
void |
load(boolean generalPreferences,
java.lang.String nsURI,
org.w3c.dom.Element meta)
Loads data save in an XML document. |
void |
onActionAborted(Action action)
Notifies the handler when the given action is aborted. |
void |
onActionAdded(Action action)
Notifies the handler when the given action is added to the registry. |
void |
onActionCancelled(Action action)
Notifies the handler when the given action is cancelled. |
void |
onActionDone(Action action)
Notifies the handler when the given action is done. |
void |
onActionExecuted(Action action)
Notifies the handler when the given action is executed. |
void |
onUndoableAdded(Undoable undoable)
Actions to do when an undoable object is added to the undo register. |
void |
onUndoableRedo(Undoable undoable)
Actions to do when an undoable object is redone. |
void |
onUndoableUndo(Undoable undoable)
Actions to do when an undoable object is undone. |
void |
reinit()
Reinitialises the object. |
protected boolean |
removeLink(Link<?,?,?> link)
Removes the given link from the list of links of the instrument. |
void |
save(boolean generalPreferences,
java.lang.String nsURI,
org.w3c.dom.Document document,
org.w3c.dom.Element root)
Saves the parameters of the instrument into an XML tag. |
void |
setActivated(boolean activated)
Activates or deactivates the instrument. |
void |
setModified(boolean modified)
Sets the Modifiable object as modified. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean activated
protected java.util.List<Link<?,?,?>> links
protected boolean modified
protected java.util.List<Eventable> eventables
Constructor Detail |
---|
public Instrument()
Method Detail |
---|
public int getSizeLinks()
public boolean hasLinks()
public java.util.List<Link<?,?,?>> getLinks()
protected abstract void initialiseLinks()
protected void addLink(Link<?,?,?> link)
link
- The link to add. If null, nothing is done.protected boolean removeLink(Link<?,?,?> link)
link
- The link to remove.
public void addEventable(Eventable eventable)
eventable
- The eventable object that gathers event used by the interactions.public void clearEvents()
public boolean isActivated()
public void setActivated(boolean activated)
activated
- True = activation.public void interimFeedback()
public void save(boolean generalPreferences, java.lang.String nsURI, org.w3c.dom.Document document, org.w3c.dom.Element root)
Preferenciable
save
in interface Preferenciable
generalPreferences
- True: this operation is called to save the general preferences of the interactive system.
Otherwise, it is called to save a presentation in a document. This parameter is useful when different information
must be saved during a presentation backup or a general preferences backup.nsURI
- The namespace that must be added to tags corresponding to the instrument's parameters.document
- The XML document.root
- The root element that will contains the instrument's parameters.public void load(boolean generalPreferences, java.lang.String nsURI, org.w3c.dom.Element meta)
Preferenciable
load
in interface Preferenciable
generalPreferences
- True: this operation is called to load the general preferences of the interactive system.
Otherwise, it is called to load a presentation in a document. This parameter is useful when different information
must be loaded during a presentation backup or a general preferences backup.nsURI
- The namespace that must be added to tags corresponding to the instrument's parameters.meta
- The meta data element.public void setModified(boolean modified)
Modifiable
setModified
in interface Modifiable
modified
- True: the element is will tagged as modified.public boolean isModified()
isModified
in interface Modifiable
public void reinit()
Reinitialisable
reinit
in interface Reinitialisable
public void onUndoableAdded(Undoable undoable)
UndoHandler
onUndoableAdded
in interface UndoHandler
undoable
- The undoable object added to the undo register.public void onUndoableUndo(Undoable undoable)
UndoHandler
onUndoableUndo
in interface UndoHandler
undoable
- The undone object.public void onUndoableRedo(Undoable undoable)
UndoHandler
onUndoableRedo
in interface UndoHandler
undoable
- The redone object.public void onActionCancelled(Action action)
ActionHandler
onActionCancelled
in interface ActionHandler
action
- The cancelled action.public void onActionAdded(Action action)
ActionHandler
onActionAdded
in interface ActionHandler
action
- The added action.public void onActionAborted(Action action)
ActionHandler
onActionAborted
in interface ActionHandler
action
- The aborted action.public void onActionExecuted(Action action)
ActionHandler
onActionExecuted
in interface ActionHandler
action
- The executed action.public void onActionDone(Action action)
ActionHandler
onActionDone
in interface ActionHandler
action
- The action that ends.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |