|
JavaView® v2.00.008 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--jv.object.PsObject
|
+--jv.project.PgGeometry
|
+--jv.anim.PsKeyframe
Collection of keys which is a pair of an object and a unique time associated with each object. The objects must be of the same class, and must implement the interpolation method 'blend'.
Instance of this class can be used a the dynamic in an animation.
PsAnimation,
PsTimeListenerIf,
PsKeyframeIf, Serialized Form| Field Summary | |
protected PsAnimation |
m_anim
Supervising animation control, empty if not used. |
protected boolean |
m_bShowKeysOnly
Flag determines whether smooth interpolation or key objects only are shown. |
protected java.lang.String |
m_className
Class name of objects in list. |
protected double |
m_currentTime
Current time of the interpolated object. |
protected PgGeometry |
m_inter
Dynamic, interpolated object corresponding to current time. |
protected java.util.Vector |
m_list
Vector wit list of keys sorted with increasing time. |
| Fields inherited from class jv.project.PgGeometry |
m_ambientProj, m_ambientSpace, m_authorInfo, m_bShowBndBox, m_bShowCenter, m_bShowing, m_bShowTitle, m_center, m_dim, m_dimOfSimplex, m_displayList, m_geometryInfo, m_labelAttribute, m_methodMenu, m_modelMatrix, m_title, m_version, m_versionType |
| Fields inherited from class jv.object.PsObject |
HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_MATERIAL_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_SELECTED, IS_USED, m_infoPanel, m_name, m_panelList, m_parent, m_tag, m_updateList, NUM_TAGS |
| Constructor Summary | |
PsKeyframe()
Constructor with empty list of keyframes. |
|
| Method Summary | |
int |
addKey(PgGeometry object,
double time)
Add key at specified time and return index of key. |
PsAnimation |
getAnimation()
Get the animation object of the project which handles the projects animations. |
PgGeometry |
getDynamic()
Get the geometry which is used for interpolation between keyframes. |
protected int |
getIndexOfKey(PsKey key)
Get the index of the first occurrence of the key in list of keys. |
protected PsKey |
getKey(double time)
Get last key with currentTime<=time. |
protected PsKey |
getKey(int ind)
Get key with given index. |
protected PsKey |
getNextKey(double time)
Get first key with currentTime>time, or null if no more keys. |
PgGeometry |
getNextObject(double time)
Get geometry of keyframe return by getNextKey(double). |
int |
getNumOfKeys()
Get number of keyframes of this instance. |
PgGeometry |
getObject(double time)
Get geometry of keyframe return by getKey(double). |
PgGeometry |
getObject(int ind)
Get geometry of keyframe return by getKey(int). |
double |
getTimeOfFirstKey()
Minimal value of animation interval if instance has keyframes. |
double |
getTimeOfLastKey()
Maximal value of animation interval if instance has keyframes. |
double |
getTimeOfNextKey()
Current time plus time step increment if instance has keyframes. |
double |
getTimeOfPreviousKey()
Current time minus time step increment if instance has keyframes. |
boolean |
hasAnimation()
Check whether this project is registered as listener of an animation object. |
void |
init()
Initialize instance variables. |
boolean |
isEnabledKeysOnly()
Get flag which determines smooth interpolation or displaying of key objects only. |
void |
removeKey(double time)
Remove key at specified time within EPS tolerance. |
void |
removeKey(int ind)
Remove key at specified index. |
void |
setAnimation(PsAnimation anAnimation)
Assign the animation object where this listener is registered. |
void |
setDynamic(PgGeometry geom)
Set the geometry which is used for interpolation between keyframes. |
void |
setEnabledKeysOnly(boolean flag)
Set flag to avoid smooth interpolation but displaying key objects only. |
void |
setName(java.lang.String name)
Set name of instance, and set name of interpolation object. |
boolean |
setTime(double time)
Refresh the interpolation geometry at the given time. |
boolean |
setTime(PsTimeEvent timeEvent)
Refresh the interpolation geometry at the given time. |
boolean |
update(java.lang.Object event)
Update method of geometry updates registered panels, update listeners, and invokes a repaint in the registered displays. |
| Methods inherited from class jv.object.PsObject |
addInspector, addUpdateListener, clearTag, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, removeInspector, removeUpdateListener, setParent, setTag, updatePanels |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface jv.anim.PsTimeListenerIf |
getName |
| Methods inherited from interface jv.project.PgGeometryIf |
getInfoPanel, getName |
| Methods inherited from interface jv.object.PsUpdateIf |
getFather, setParent |
| Field Detail |
protected double m_currentTime
protected PgGeometry m_inter
protected java.util.Vector m_list
protected java.lang.String m_className
protected boolean m_bShowKeysOnly
protected PsAnimation m_anim
| Constructor Detail |
public PsKeyframe()
| Method Detail |
public void init()
init in class PgGeometrypublic void setName(java.lang.String name)
setName in class PsObjectpublic boolean update(java.lang.Object event)
update in class PgGeometryjv.object.PsUpdateIfevent - carries a lot of informationPsObject,
PsUpdateIf.getFather(),
PsUpdateIf.setParent(PsUpdateIf)public PgGeometry getDynamic()
public void setDynamic(PgGeometry geom)
This keyframe class is set as the parent of the dynamic geometry.
geometry - used to store a dynamic section of the keyframe animation.public void setEnabledKeysOnly(boolean flag)
flag - Set true to avoid smooth interpolationpublic boolean isEnabledKeysOnly()
true if no smooth interpolationpublic PgGeometry getObject(int ind)
getKey(int).ind - Index of a keyframe in [0, numKeys-1].getKey(int)public PgGeometry getObject(double time)
getKey(double).time - Time of the requested key.getKey(double)public PgGeometry getNextObject(double time)
getNextKey(double).time - Time of the requested key.getNextKey(double)public boolean setTime(PsTimeEvent timeEvent)
HACK: Method should be moved to applications.
setTime in interface PsTimeListenerIfpublic boolean setTime(double time)
public int getNumOfKeys()
protected int getIndexOfKey(PsKey key)
public int addKey(PgGeometry object,
double time)
public void removeKey(double time)
public void removeKey(int ind)
protected PsKey getKey(double time)
currentTime<=time.getObject(double)protected PsKey getNextKey(double time)
currentTime>time, or null if no more keys.null if no more keys.getNextObject(double)protected PsKey getKey(int ind)
ind - Index of a keyframe in [0, numKeys-1].getObject(int)public double getTimeOfFirstKey()
getTimeOfFirstKey in interface PsKeyframeIfPsAnimation.enableKeys(boolean)public double getTimeOfPreviousKey()
getTimeOfPreviousKey in interface PsKeyframeIfpublic double getTimeOfNextKey()
getTimeOfNextKey in interface PsKeyframeIfPsAnimation.enableKeys(boolean)public double getTimeOfLastKey()
getTimeOfLastKey in interface PsKeyframeIfPsAnimation.enableKeys(boolean)public PsAnimation getAnimation()
setAnimation(PsAnimation).getAnimation in interface PsTimeListenerIfhasAnimation(),
setAnimation(PsAnimation)public boolean hasAnimation()
hasAnimation in interface PsTimeListenerIfgetAnimation(),
setAnimation(PsAnimation)public void setAnimation(PsAnimation anAnimation)
If this project has an animation object assigned in its constructor or
init() method, then the animation panel is shown when the project's
start() method is invoked during loading of the project.
Only one animation object may be assigned to this listener. Subsequent assignments will replace the previous assignment.
setAnimation in interface PsTimeListenerIfgetAnimation(),
hasAnimation()
|
JavaView® v2.00.008 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||