ilog.views.prototypes
Class IlvBlinkBehavior

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.IlvBlinkBehavior
All Implemented Interfaces:
IlvPersistentObject, Serializable

public class IlvBlinkBehavior
extends IlvAnimationBehavior

The class IlvBlinkBehavior is a subclass of IlvAnimationBehavior that makes an object flash on and off at a specified time interval.

See Also:
Serialized Form

Constructor Summary
IlvBlinkBehavior(IlvBlinkBehavior source)
          Creates a new behavior object by copying an existing one.
IlvBlinkBehavior(IlvInputStream in)
          Reads the behavior from an IlvInputStream stream.
IlvBlinkBehavior(String name, String period, String blinkProperty)
          Creates a new IlvBlinkBehavior object that periodically toggles a given value between true and false.
 
Method Summary
 IlvBehavior copy()
          Returns a copy of the behavior.
protected  void doit()
          Reads the current blinkProperty of the group and sets it to its opposite value.
 String getBlinkProperty()
          Gets the blinkProperty parameter for this behavior object.
 int getSynchronizationCount()
          Implementation of the Timer interface.
 void setBlinkProperty(String blinkProperty)
          Sets the blinkProperty 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

IlvBlinkBehavior

public IlvBlinkBehavior(String name,
                        String period,
                        String blinkProperty)
Creates a new IlvBlinkBehavior object that periodically toggles a given value between true and false.

Parameters:
name - the name of the Boolean value used to start or stop the animation.
period - the time interval (in milliseconds) between two blinkings. This value can be either a direct value (for example, 100), the name of another property, or an expression.
blinkProperty - the name of the property that will be toggled between true and false. This value is generally the visible value of a group element, but it can also be any other value.

IlvBlinkBehavior

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

Parameters:
source - the behavior object to be copied.

IlvBlinkBehavior

public IlvBlinkBehavior(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
Reads the current blinkProperty of the group and sets it to its opposite value.

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

setBlinkProperty

public void setBlinkProperty(String blinkProperty)
Sets the blinkProperty parameter for this behavior object.


getBlinkProperty

public String getBlinkProperty()
Gets the blinkProperty parameter for this behavior object.


getSynchronizationCount

public int getSynchronizationCount()
Implementation of the Timer interface. This method returns 2 to ensure that the object's visibility will change an even number of times so that the object is always left in its initial state.

Overrides:
getSynchronizationCount in class IlvAnimationBehavior


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