public interface IlvResource extends IlvHierarchyNode
IlvResource
defines the abstract behavior of a Gantt resource.
Each resource has a name, an id, and a quantity. Storage and lookup of
IlvResource
's is expected to be identity-based. Therefore, the
default hashCode()
and equals()
methods inherited
from java.lang.Object
should not be overridden.
IlvResource
implementations are expected to route their property
change events to the Gantt data model
. Therefore,
although there is no accessor to the data model in this interface, the
resource implementation must have some method of obtaining the model it
belongs to. Here is an example of how the IlvResource
implementation should fire its property change events:
void fireEvent (ResourceEvent event) { IlvGanttModel model = ..... if (model != null) model.fireResourceEvent(event); }
Modifier and Type | Method and Description |
---|---|
IlvUnaryPredicate<ResourceEvent> |
getChildEventFilter()
Returns a predicate that will be used to determine the events from this
resource's children that should be dispatched to this resource's
processChildEvent(ilog.views.gantt.event.ResourceEvent) method. |
String |
getID()
Returns this resource's ID string.
|
String |
getName()
Returns the name of the resource.
|
float |
getQuantity()
Returns this resource's quantity.
|
void |
processChildEvent(ResourceEvent event)
This method is invoked by the
Gantt data model for
any events fired by the children of this resource and for which the
predicate returned by getChildEventFilter() evaluates to
true . |
void |
setGanttModelImpl(IlvGanttModel model)
This method is invoked by the
IlvGanttModel when the resource
is added or removed. |
void |
setID(String id)
Sets this resource's ID string.
|
void |
setName(String name)
Sets the name of the resource.
|
void |
setQuantity(float x)
Sets this resource's quantity.
|
String getID()
void setID(String id)
id
- The resource's ID string.String getName()
void setName(String name)
name
- A descriptive name for this resource.float getQuantity()
void setQuantity(float x)
x
- The amount of this resource.IlvUnaryPredicate<ResourceEvent> getChildEventFilter()
processChildEvent(ilog.views.gantt.event.ResourceEvent)
method. The Gantt data
model
applies the predicate to all ResourceEvent
s events fired by
the children of this resource. If the predicate evaluates to
true
, then the Gantt data model dispatches the child's event
to the processChildEvent()
method. This allows you to easily
implement a parent resource property that is automatically computed
from one or more properties of its children.void processChildEvent(ResourceEvent event)
Gantt data model
for
any events fired by the children of this resource and for which the
predicate returned by getChildEventFilter()
evaluates to
true
.
This allows you to easily implement a parent resource property that is
automatically computed from one or more properties of its children.event
- The child resource event.void setGanttModelImpl(IlvGanttModel model)
IlvGanttModel
when the resource
is added or removed.
Warning: This method is considered to be part of an
IlvResource
's internal implementation and is not a public API.
You should only invoke this method directly if you have created your own
IlvGanttModel
implementation.
model
- The data model that this resource has been added to, or
null
if this resource has been removed from the data model.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.