ilog.views.prototypes
Class IlvRotateBehavior

java.lang.Object
  extended by ilog.views.prototypes.IlvBehavior
      extended by ilog.views.prototypes.IlvSingleBehavior
          extended by ilog.views.prototypes.IlvAnimationBehavior
              extended by ilog.views.prototypes.IlvRotateBehavior
All Implemented Interfaces:
IlvPersistentObject, Serializable

public class IlvRotateBehavior
extends IlvAnimationBehavior

The class IlvRotateBehavior is used to rotate a prototype element at a specified time interval.

See Also:
Serialized Form

Constructor Summary
IlvRotateBehavior(IlvInputStream in)
          Reads the behavior from an IlvInputStream stream.
IlvRotateBehavior(IlvRotateBehavior source)
          Creates a new behavior object by copying an existing one.
IlvRotateBehavior(String name, String period, String elementName, String angle, String centerX, String centerY)
          Creates a new rotate behavior object.
 
Method Summary
 IlvBehavior copy()
          Returns a copy of the behavior.
protected  void doit()
          Rotates the element specified by the elementName parameter according to the angle of rotation specified by the angle parameter, around the point specified by the centerX and centerY parameters.
 String getAngle()
          Gets the angle parameter for this behavior object.
 String getCenterX()
          Gets the centerX parameter for this behavior object.
 String getCenterY()
          Gets the centerY parameter of this behavior.
 String getElementName()
          Gets the elementName parameter for this behavior object.
 int getSynchronizationCount()
          Implementation of the Timer interface.
 void setAngle(String angle)
          Sets the angle parameter for this behavior object.
 void setCenterX(String centerX)
          Sets the centerX parameter for this behavior object.
 void setCenterY(String centerY)
          Sets the centerY parameter for this behavior object.
 void setElementName(String elementName)
          Sets the elementName parameter for this behavior object.
 String toString()
          Returns a short text describing this behavior object.
 void write(IlvOutputStream out)
          Writes the behavior to an IlvOutputStream.
 
Methods inherited from class ilog.views.prototypes.IlvAnimationBehavior
attach, detach, get, getPeriod, getTimerPeriod, set, setPeriod, start, stop, timerTicked
 
Methods inherited from class ilog.views.prototypes.IlvSingleBehavior
get, getName, getValueNames, set, setName
 
Methods inherited from class ilog.views.prototypes.IlvBehavior
getParameter, isOutput, isReadable, isWritable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IlvRotateBehavior

public IlvRotateBehavior(String name,
                         String period,
                         String elementName,
                         String angle,
                         String centerX,
                         String centerY)
Creates a new rotate behavior object.

Parameters:
name - the name of the Boolean value used to start or stop the rotation.
period - the time interval (in milliseconds) between two rotations. This value can be either a direct value (for example, 100), the name of another property, or an expression.
elementName - the name of the element to be rotated. This parameter can be set to "[all]" to rotate the whole prototype to which this behavior object is attached.
angle - the rotation angle (in degrees). This value can be either a direct value, the name of another property, or an expression.
centerX - the horizontal coordinate of the rotation center. This value can be either a direct value, the name of another property, or an expression.
centerY - the vertical coordinate of the rotation center. This value can be either a direct value, the name of another property, or an expression.

IlvRotateBehavior

public IlvRotateBehavior(IlvRotateBehavior source)
Creates a new behavior object by copying an existing one.

Parameters:
source - the behavior object to be copied.

IlvRotateBehavior

public IlvRotateBehavior(IlvInputStream in)
                  throws IlvReadFileException
Reads the behavior from an IlvInputStream stream. This constructor must be called by the input constructors of subclasses.

Parameters:
in - The input stream.
Throws:
IlvReadFileException - if the stream format is not correct.
Method Detail

write

public void write(IlvOutputStream out)
           throws IOException
Writes the behavior to an IlvOutputStream.

Specified by:
write in interface IlvPersistentObject
Overrides:
write in class IlvAnimationBehavior
Parameters:
out - The output stream.
Throws:
IOException - thrown when an exception occurs during the write operation for this object.

copy

public IlvBehavior copy()
Returns a copy of the behavior.

Specified by:
copy in class IlvBehavior

toString

public String toString()
Returns a short text describing this behavior object. This text can be used by GUI editors to display the behavior description.

Specified by:
toString in class IlvBehavior

doit

protected void doit()
             throws IlvValueException
Rotates the element specified by the elementName parameter according to the angle of rotation specified by the angle parameter, around the point specified by the centerX and centerY parameters. All these parameters are passed to the constructor.

Specified by:
doit in class IlvAnimationBehavior
Throws:
IlvValueException - if an error occurred while setting or reading a value.

setElementName

public void setElementName(String elementName)
Sets the elementName parameter for this behavior object.


getElementName

public String getElementName()
Gets the elementName parameter for this behavior object.


setAngle

public void setAngle(String angle)
Sets the angle parameter for this behavior object.


getAngle

public String getAngle()
Gets the angle parameter for this behavior object.


setCenterX

public void setCenterX(String centerX)
Sets the centerX parameter for this behavior object.


getCenterX

public String getCenterX()
Gets the centerX parameter for this behavior object.


setCenterY

public void setCenterY(String centerY)
Sets the centerY parameter for this behavior object.


getCenterY

public String getCenterY()
Gets the centerY parameter of this behavior.


getSynchronizationCount

public int getSynchronizationCount()
Implementation of the Timer interface. This method returns 360 divided by the rotation angle of the behavior.

Overrides:
getSynchronizationCount in class IlvAnimationBehavior


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.