|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectubc.cs.JLog.Animation.aAttributeTranslation
ubc.cs.JLog.Animation.aAnimationShape
public abstract class aAnimationShape
This abstract class represents a simple graphical shape. A shape belongs to an AnimationObject, and the position and rotation of this shape is given as offset from position and rotation of the enclosing object.
Field Summary | |
---|---|
protected java.lang.String |
name
|
static java.lang.String |
NAME_ATTR_KEY
|
protected aAnimationObject |
object
|
static java.lang.String |
OBJECT_ATTR_KEY
|
static java.lang.String |
ROTATION_ATTR_KEY
|
protected float |
rotation_offset
|
static java.lang.String |
TYPE_ATTR_KEY
|
static java.lang.String |
X_ATTR_KEY
|
protected float |
x_offset
|
static java.lang.String |
Y_ATTR_KEY
|
protected float |
y_offset
|
Constructor Summary | |
---|---|
aAnimationShape(aAnimationObject ao,
java.lang.String n)
The constructor. |
Method Summary | |
---|---|
abstract void |
draw(java.awt.Graphics g)
Draw the shape in the Graphics environment
provided. |
java.util.Hashtable |
getAttributes()
Returns a hashtable of every attribute associated with this object. |
abstract java.awt.Rectangle |
getBounds()
Returns the bounding rectangle for this shape, given in global coordinates. |
aAnimationObject |
getEnclosingObject()
Returns the parent, enclosing object. |
java.lang.String |
getName()
|
jTermTranslation |
getTermTranslation()
Get the current translation unit for this object. |
abstract java.lang.String |
getType()
Sub-classes should return their type value (i.e., the value used to specify the shape type to create in the animation<addshape> predicate command). |
void |
setAttributes(java.util.Hashtable attributes)
Set the attributes of the object to those in the given Hashtable. |
static void |
setDefaultsForTranslation(jTermTranslation t)
|
void |
setLocalPosition(float x,
float y)
Set the new location of the shape to the given offset values. |
void |
setLocalRotation(float r)
Set the object relative rotation of the shape to the given angle in radians. |
void |
setName(java.lang.String n)
|
void |
updateMagnification()
Update notification. |
void |
updatePosition()
Update notification. |
void |
updateRotation()
Update notification. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String X_ATTR_KEY
public static final java.lang.String Y_ATTR_KEY
public static final java.lang.String ROTATION_ATTR_KEY
public static final java.lang.String TYPE_ATTR_KEY
public static final java.lang.String NAME_ATTR_KEY
public static final java.lang.String OBJECT_ATTR_KEY
protected aAnimationObject object
protected java.lang.String name
protected float x_offset
protected float y_offset
protected float rotation_offset
Constructor Detail |
---|
public aAnimationShape(aAnimationObject ao, java.lang.String n)
aAnimationObject
, and a name.
ao
- The graphical object composed from this shape.
Animation shapes can only belong to one object.n
- The name of the shape.Method Detail |
---|
public abstract void draw(java.awt.Graphics g)
Graphics
environment
provided.
g
- The Graphics
environment to draw into.public java.lang.String getName()
public void setName(java.lang.String n)
public abstract java.lang.String getType()
public aAnimationObject getEnclosingObject()
aAnimationObject
containing this shape.public abstract java.awt.Rectangle getBounds()
Rectangle
bounding this shape.public void setLocalPosition(float x, float y)
x
- The new x position component, relative to enclosing object.y
- The new y position component, relative to enclosing object.public void setLocalRotation(float r)
r
- The new angle of the shape in radians.public static void setDefaultsForTranslation(jTermTranslation t)
public jTermTranslation getTermTranslation()
aAttributeTranslation
getTermTranslation
in class aAttributeTranslation
jTermTranslation
translation unit.public java.util.Hashtable getAttributes()
iAttributes
public void setAttributes(java.util.Hashtable attributes)
iAttributes
attributes
- The Hashtable of attribute name-value pairings.public void updatePosition()
public void updateRotation()
public void updateMagnification()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |