public class IlvGeneralActivity extends IlvSimpleActivity implements IlvPropertyHolderActivity
IlvGeneralActivity
is an extension of IlvSimpleActivity
that adds support for user-defined properties.
IlvGeneralActivity
fires an ActivityUserPropertyEvent
both before and after a user-defined property is modified. Immediately
before a property is modified, IlvGeneralActivity
fires an
aboutToChange ActivityUserPropertyEvent
to all
listeners
registered with the Gantt data model
.
This gives the listeners an opportunity to constrain or veto the proposed
property change. If the property change is not vetoed, then the change
is applied and IlvGeneralActivity
fires a changed
ActivityUserPropertyEvent
to all listeners registered with the
Gantt data model.
IlvGeneralActivity
predefines 6 properties that are
inherited from its IlvSimpleActivity
superclass. These predefined
properties can be accessed through the getProperty(java.lang.String)
and
setProperty(java.lang.String, java.lang.Object)
methods in the same manner as user-defined properties.
However, the predefined properties fire specific event types. They
do not fire ActivityUserPropertyEvent
s as described
above for user-defined properties. The predefined events are shown in the
following table:
Property | Value Type | Equivalent getXXX Method | Equivalent setXXX Method | Event Type |
id |
String |
|
|
ActivityIDEvent |
name |
String |
|
|
ActivityNameEvent |
startTime |
Date |
|
|
ActivityTimeIntervalEvent |
endTime |
Date |
|
|
ActivityTimeIntervalEvent |
duration |
IlvDuration |
|
|
ActivityTimeIntervalEvent |
timeInterval |
IlvTimeInterval |
|
|
ActivityTimeIntervalEvent |
Modifier and Type | Class and Description |
---|---|
static class |
IlvGeneralActivity.Factory
IlvGeneralActivity.Factory is a factory that creates
instances of IlvGeneralActivity . |
Modifier and Type | Field and Description |
---|---|
static String |
DURATION_PROPERTY
Identifies the activity's duration property.
|
static String |
ID_PROPERTY
Identifies the activity's ID property.
|
static String |
NAME_PROPERTY
Identifies the activity's name property.
|
static String |
TIME_INTERVAL_PROPERTY
Identifies the activity's time interval property.
|
END_TIME_PROPERTY, START_TIME_PROPERTY, TIME_PROPERTIES_PROPERTY
Constructor and Description |
---|
IlvGeneralActivity(String id,
String name,
Date start,
Date end)
Creates a new
IlvGeneralActivity from the specified ID,
name, and time interval. |
IlvGeneralActivity(String id,
String name,
Date start,
IlvDuration duration)
Creates a new
IlvGeneralActivity from the specified ID,
name, start time, and duration. |
IlvGeneralActivity(String id,
String name,
IlvTimeInterval interval)
Creates a new
IlvGeneralActivity from the specified ID,
name, and time interval. |
Modifier and Type | Method and Description |
---|---|
protected ActivityUserPropertyEvent |
firePropertyAboutToChange(String property,
Object oldValue,
Object newValue)
Fires a user property aboutToChange event and returns the event
after dispatching it to all listeners.
|
protected void |
firePropertyChanged(String property,
Object oldValue,
Object newValue)
Fires a user property changed event.
|
Object |
getProperty(String property)
Returns the value of a user-defined property or
null if
the property does not exist. |
Collection<String> |
getPropertyNames()
Returns a collection that contains the names of all the properties of
this activity.
|
String[] |
getTimeProperties()
Returns the names of the properties that denote the specific time points
of this activity.
|
boolean |
isUserProperty(String name)
Returns
true if the property is a user-defined property. |
protected String |
paramString()
Returns a parameter string that represents the state of this activity.
|
Iterator<String> |
propertyNameIterator()
Returns an iterator over all the property names of this activity.
|
Object |
setProperty(String property,
Object value)
Stores a user-defined property in this activity's property table.
|
void |
setTimeInterval(IlvTimeInterval interval)
Overridden to take into account the
getTimeProperties() result. |
void |
setTimeProperties(String[] timeProperties)
Changes the set of properties that are the specific time points of this activity and
from which the start time and the end time are computed.
|
computeTimeIntervalFromChildren, getAutoCalcTimeIntervalFromChildren, getChildEventFilter, getID, getName, getTimeInterval, processChildEvent, setAutoCalcTimeIntervalFromChildren, setGanttModelImpl, setID, setName, updateTimeInterval
fireEvent, fireIDAboutToChange, fireIDChanged, fireNameAboutToChange, fireNameChanged, fireTimeIntervalAboutToChange, fireTimeIntervalChanged, getDuration, getEndTime, getGanttModel, getStartTime, setDuration, setEndTime, setStartTime, setTimeInterval, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getChildEventFilter, getEndTime, getID, getName, getStartTime, getTimeInterval, processChildEvent, setEndTime, setGanttModelImpl, setID, setName, setStartTime, setTimeInterval
public static final String ID_PROPERTY
public static final String NAME_PROPERTY
public static final String DURATION_PROPERTY
public static final String TIME_INTERVAL_PROPERTY
public IlvGeneralActivity(String id, String name, IlvTimeInterval interval)
IlvGeneralActivity
from the specified ID,
name, and time interval.id
- The activity ID.name
- The descriptive activity name.interval
- The start and end time of the activity.public IlvGeneralActivity(String id, String name, Date start, Date end)
IlvGeneralActivity
from the specified ID,
name, and time interval.id
- The activity ID.name
- The descriptive activity name.start
- The activity start time.end
- The activity end time.public IlvGeneralActivity(String id, String name, Date start, IlvDuration duration)
IlvGeneralActivity
from the specified ID,
name, start time, and duration.id
- The activity ID.name
- The descriptive activity name.start
- The activity start time.duration
- The activity duration.public final String[] getTimeProperties()
The default value in this class is null
.
getTimeProperties
in interface IlvPropertyHolderActivity
null
.public void setTimeProperties(String[] timeProperties)
setTimeProperties
in interface IlvPropertyHolderActivity
timeProperties
- A nonempty set of properties whose values are always of type
Date
, excluding IlvPropertyHolderActivity.START_TIME_PROPERTY
and IlvPropertyHolderActivity.END_TIME_PROPERTY
, or null
.public void setTimeInterval(IlvTimeInterval interval)
getTimeProperties()
result.setTimeInterval
in interface IlvActivity
setTimeInterval
in class IlvSimpleActivity
interval
- The start and end times.public Object getProperty(String property)
null
if
the property does not exist.getProperty
in interface IlvUserPropertyHolder
property
- The name of the property.null
if the property
does not exist.setProperty(java.lang.String, java.lang.Object)
,
getPropertyNames()
public Object setProperty(String property, Object value)
setProperty
in interface IlvUserPropertyHolder
property
- The name of the property.value
- The value of the property. If the value is null
then the property is removed.getProperty(java.lang.String)
,
getPropertyNames()
public Iterator<String> propertyNameIterator()
propertyNameIterator
in interface IlvUserPropertyHolder
public Collection<String> getPropertyNames()
public boolean isUserProperty(String name)
true
if the property is a user-defined property.isUserProperty
in interface IlvUserPropertyHolder
name
- The name of the property.true
if the property is a user-defined property,
false
otherwise.protected ActivityUserPropertyEvent firePropertyAboutToChange(String property, Object oldValue, Object newValue)
property
- The name of the property being changed.oldValue
- The property's value before the change.newValue
- The property's value after the change.ActivityUserPropertyEvent
protected void firePropertyChanged(String property, Object oldValue, Object newValue)
property
- The name of the property that has changed.oldValue
- The property's value before the change.newValue
- The property's value after the change.ActivityUserPropertyEvent
protected String paramString()
paramString
in class IlvAbstractActivity
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.