algoanim.properties.items
Class AnimationPropertyItem

java.lang.Object
  extended by algoanim.properties.items.AnimationPropertyItem
All Implemented Interfaces:
Visitable, java.lang.Cloneable
Direct Known Subclasses:
BooleanPropertyItem, ColorPropertyItem, DoublePropertyItem, EnumerationPropertyItem, FontPropertyItem, IntegerPropertyItem, StringPropertyItem

public abstract class AnimationPropertyItem
extends java.lang.Object
implements java.lang.Cloneable, Visitable

This class defines the base for the distinct PropertyItems, which are responsible to hold exactly one instance of one value. The method set() provides a definition for each PropertyItem. The derived PropertyItem just overrides the method which belongs to its type. Hence each try to set a PropertyItem to an invalid type results in an IllegalArgumentException as preimplemented in this class.

Author:
Jens Pfau, Stephan Mehlhase, T. Ackermann

Constructor Summary
AnimationPropertyItem()
           
 
Method Summary
abstract  void accept(Visitor v)
          Defines the interface for a Visitor to access a Visitable.
 java.lang.Object clone()
          we need this because we clone the default value from the "normal" data value.
abstract  java.lang.Object get()
          Returns a represantation of the internal value.
 boolean set(boolean value)
          Sets the internal value to a new one, if this object contains a boolean value.
 boolean set(java.awt.Color value)
          Sets the internal value to a new one, if this object contains a Color value.
 boolean set(java.awt.Font value)
          Sets the internal value to a new one, if this object contains a Font value.
 boolean set(int value)
          Sets the internal value to a new one, if this object contains an int value.
 boolean set(java.lang.Object value)
          Sets the internal value to a new one, using an Object.
 boolean set(java.lang.String value)
          Sets the internal value to a new one, if this object contains a String value.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnimationPropertyItem

public AnimationPropertyItem()
Method Detail

set

public boolean set(int value)
            throws java.lang.IllegalArgumentException
Sets the internal value to a new one, if this object contains an int value.

Parameters:
value - a new int value.
Returns:
whether the operation was successful.
Throws:
java.lang.IllegalArgumentException

set

public boolean set(java.lang.String value)
            throws java.lang.IllegalArgumentException
Sets the internal value to a new one, if this object contains a String value.

Parameters:
value - a new String value.
Returns:
whether the operation was successful.
Throws:
java.lang.IllegalArgumentException

set

public boolean set(boolean value)
            throws java.lang.IllegalArgumentException
Sets the internal value to a new one, if this object contains a boolean value.

Parameters:
value - a new boolean value.
Returns:
whether the operation was successful.
Throws:
java.lang.IllegalArgumentException

set

public boolean set(java.awt.Color value)
            throws java.lang.IllegalArgumentException
Sets the internal value to a new one, if this object contains a Color value.

Parameters:
value - a new Color value.
Returns:
whether the operation was successful.
Throws:
java.lang.IllegalArgumentException

set

public boolean set(java.awt.Font value)
            throws java.lang.IllegalArgumentException
Sets the internal value to a new one, if this object contains a Font value.

Parameters:
value - a new Font value.
Returns:
whether the operation was successful.
Throws:
java.lang.IllegalArgumentException

set

public boolean set(java.lang.Object value)
            throws java.lang.IllegalArgumentException
Sets the internal value to a new one, using an Object.

Parameters:
value - the new value.
Returns:
true, if no errors occurred.
Throws:
java.lang.IllegalArgumentException - if the item doesn't exist.

get

public abstract java.lang.Object get()
Returns a represantation of the internal value.

Returns:
A represantation of the internal value.

clone

public java.lang.Object clone()
we need this because we clone the default value from the "normal" data value.

Overrides:
clone in class java.lang.Object
See Also:
AnimationProperties.fillAdditional()

accept

public abstract void accept(Visitor v)
Description copied from interface: Visitable
Defines the interface for a Visitor to access a Visitable.

Specified by:
accept in interface Visitable
Parameters:
v - the visitor
See Also:
Visitable.accept(algoanim.properties.Visitor)