public abstract class IlvBehavior extends Object implements IlvPersistentObject, Serializable
IlvBehavior
is the base class for all the objects that
handle a particular behavior. These objects are attached to an
IlvGroup
and define the behavior of the related group when a
given property or set of properties is set to a new value or is read.
An IlvBehavior
object can handle several properties
simultaneously. For example, an IlvBehavior
object implementing
the position of an object will handle the properties x
and
y
. However, most of these objects handle only one property at a
time through the IlvSingleBehavior
subclass.
The Perforce JViews Prototypes package contains a number of predefined
subclasses of IlvBehavior
. The behavior of a prototype is
defined by attaching instances of these classes to the prototype with the
addBehavior
method.
The actual effect of a given behavior class is determined by the way its
set
and get
methods are implemented.
IlvGroup
,
IlvGroup.addBehavior(ilog.views.prototypes.IlvBehavior)
,
IlvGroup
,
IlvSingleBehavior
,
IlvGroupBehavior
,
IlvActionBehavior
,
IlvAnimationBehavior
,
IlvBlinkBehavior
,
IlvCompositeBehavior
,
IlvConditionBehavior
,
IlvConnectBehavior
,
IlvCounterBehavior
,
IlvDebugBehavior
,
IlvExportBehavior
,
IlvExportOutputBehavior
,
IlvExpressionBehavior
,
IlvFormatBehavior
,
IlvInheritBehavior
,
IlvInvertBehavior
,
IlvJavaBehavior
,
IlvMinMaxBehavior
,
IlvMultiRepBehavior
,
IlvOutputBehavior
,
IlvRotateBehavior
,
IlvRotationBehavior
,
IlvScaleBehavior
,
IlvToggleBehavior
,
IlvTranslateBehavior
,
IlvTriggerBehavior
,
IlvValueBehavior
,
Serialized FormModifier | Constructor and Description |
---|---|
protected |
IlvBehavior()
Creates a new behavior object.
|
protected |
IlvBehavior(IlvBehavior source)
Creates a new behavior object by copying an existing one.
|
protected |
IlvBehavior(IlvInputStream in)
Reads the
private and runtime fields of an
IlvBehavior object. |
Modifier and Type | Method and Description |
---|---|
protected void |
attach(IlvGroup group)
Called when this behavior object is added to the specified group.
|
abstract IlvBehavior |
copy()
The implementation of this method must return a copy of the behavior.
|
protected void |
detach(IlvGroup group)
Called when this behavior object is removed from the specified group.
|
protected abstract void |
get(IlvGroup group,
String[] names,
Object[] values,
boolean[] done)
Called for all the
IlvBehavior objects attached to the
specified group when a set of values is retrieved for the group via a call
to the get method. |
protected Object |
getParameter(IlvGroup group,
String valueString,
Class<?> valueType)
Retrieves a value handled by the group to which this behavior object is
attached and converts it.
|
protected abstract String[] |
getValueNames(IlvGroup group)
Returns the names of the properties handled by this
IlvBehavior object. |
boolean |
isOutput()
Returns
true if this behavior object defines one or more
output values. |
boolean |
isReadable()
Returns
true if this behavior object is activated when values
are read. |
boolean |
isWritable()
Returns
true if this behavior object is activated when values
are set. |
protected abstract void |
set(IlvGroup group,
String[] names,
Object[] values,
boolean[] done)
Called for all
IlvBehavior objects attached to the specified
group when a set of properties is set for the group via a call to the
set method. |
void |
setName(String name)
Sets the name of the behavior.
|
abstract String |
toString()
Returns a short text describing this behavior object.
|
void |
write(IlvOutputStream out)
Writes the behavior to an
IlvOutputStream . |
protected IlvBehavior()
protected IlvBehavior(IlvBehavior source)
source
- the behavior object to be copied.protected IlvBehavior(IlvInputStream in) throws IlvReadFileException
private
and runtime
fields of an
IlvBehavior
object. This constructor must be called by the
input constructors of subclasses.in
- the input stream.IlvReadFileException
- if the stream format is not correct.protected abstract void set(IlvGroup group, String[] names, Object[] values, boolean[] done) throws IlvValueException
IlvBehavior
objects attached to the specified
group when a set of properties is set for the group via a call to the
set
method.group
- the group to which this behavior object is attached.names
- the names of the properties to be set.values
- the new values.done
- an array of boolean values. The IlvBehavior
object is
responsible for setting to true
the element of the
done
array corresponding to each property in the
names
/values
arrays that it handles.IlvValueException
- if an error occurred while setting a property.IlvSingleBehavior.set(ilog.views.prototypes.IlvGroup,
java.lang.String, java.lang.Object)
protected abstract void get(IlvGroup group, String[] names, Object[] values, boolean[] done) throws IlvValueException
IlvBehavior
objects attached to the
specified group when a set of values is retrieved for the group via a call
to the get
method.group
- the group to which this behavior object is attached.names
- the names of the properties read.values
- an array of objects where values handled by the
IlvBehavior
object will be stored.done
- an array of boolean values. The IlvBehavior
object is
responsible for setting to true
the element of the
done
array corresponding to the value in the
names
/values
arrays that it handles.IlvValueException
- if an error occurred while reading a property.IlvSingleBehavior.get(ilog.views.prototypes.IlvGroup,
java.lang.String)
protected abstract String[] getValueNames(IlvGroup group) throws IlvValueException
IlvBehavior
object.group
- the group to which this behavior object is attached.IlvValueException
- if the values could not be listed.public void write(IlvOutputStream out) throws IOException
IlvOutputStream
.write
in interface IlvPersistentObject
out
- The output stream.IOException
- thrown when an exception occurs during
the write operation for this object.public abstract IlvBehavior copy()
public abstract String toString()
public boolean isWritable()
true
if this behavior object is activated when values
are set.public boolean isReadable()
true
if this behavior object is activated when values
are read.public boolean isOutput()
true
if this behavior object defines one or more
output values.protected void attach(IlvGroup group)
group
- the group to which this behavior object is attached.IlvGroup.addBehavior(ilog.views.prototypes.IlvBehavior)
protected void detach(IlvGroup group)
group
- the group to which this behavior object is attached.IlvGroup.removeBehavior(ilog.views.prototypes.IlvBehavior)
public void setName(String name)
name
- The new name.protected final Object getParameter(IlvGroup group, String valueString, Class<?> valueType) throws IlvValueException
IlvBehavior
to convert parameters from the string used to
represent them.group
- the group to which this behavior object is attached.valueString
- the string representing the value.valueType
- the class specifying the type to which the value should be
converted.IlvValueException
- if an error occurred while reading a property.IlvGroup.removeBehavior(ilog.views.prototypes.IlvBehavior)
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.