public class IlvInvertBehavior extends IlvAnimationBehavior
IlvInvertBehavior
is a subclass of
IlvAnimationBehavior
that inverts two values of an object at a
specified time interval. It can be used, for example, to invert two colors.Constructor and Description |
---|
IlvInvertBehavior(IlvInputStream in)
Reads the behavior from an
IlvInputStream stream. |
IlvInvertBehavior(IlvInvertBehavior source)
Creates a new behavior object by copying an existing one.
|
IlvInvertBehavior(String name,
String period,
String value1,
String value2)
Creates a new
IlvInvertBehavior object that inverts the values
of two properties at a specified time interval. |
Modifier and Type | Method and Description |
---|---|
IlvBehavior |
copy()
Returns a copy of the behavior.
|
protected void |
doit()
Inverts the values specified by the
value1 and
value2 parameters passed to the constructor. |
int |
getSynchronizationCount()
Implementation of the Timer interface.
|
String |
getValue1()
Gets the name of the first value to be inverted.
|
String |
getValue2()
Gets the name of the second value to be inverted.
|
void |
setValue1(String value1)
Sets the name of the first value to be inverted.
|
void |
setValue2(String value2)
Sets the name of the second value to be inverted.
|
String |
toString()
Returns a short text describing this behavior object.
|
void |
write(IlvOutputStream out)
Writes the behavior to an
IlvOutputStream . |
attach, detach, get, getPeriod, getTimerPeriod, set, setPeriod, start, stop, timerTicked
get, getName, getValueNames, set, setName
getParameter, isOutput, isReadable, isWritable
public IlvInvertBehavior(String name, String period, String value1, String value2)
IlvInvertBehavior
object that inverts the values
of two properties at a specified time interval.name
- the name of the property defined by this behavior, which is a
boolean value used to start or stop the animation.period
- the animation period in milliseconds. This value can be either an
immediate value (for example, 100
), or the name of
another behavior which will be read to get the actual period
value.value1
- the name of the first value to be inverted.value2
- the name of the second value to be inverted.public IlvInvertBehavior(IlvInvertBehavior source)
source
- the behavior object to be copied.public IlvInvertBehavior(IlvInputStream in) throws IlvReadFileException
IlvInputStream
stream. This
constructor must be called by the input constructors of subclasses.in
- The input stream.IlvReadFileException
- if the stream format is not correct.public void write(IlvOutputStream out) throws IOException
IlvOutputStream
.write
in interface IlvPersistentObject
write
in class IlvAnimationBehavior
out
- The output stream.IOException
- thrown when an exception occurs during
the write operation for this object.public IlvBehavior copy()
copy
in class IlvBehavior
public String toString()
toString
in class IlvBehavior
protected void doit() throws IlvValueException
value1
and
value2
parameters passed to the constructor.doit
in class IlvAnimationBehavior
IlvValueException
- if an error occurred while setting or reading a value.public void setValue1(String value1)
public String getValue1()
public void setValue2(String value2)
public String getValue2()
public int getSynchronizationCount()
getSynchronizationCount
in class IlvAnimationBehavior
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.