public class ConstraintTypeEvent extends ConstraintPropertyEvent
ConstraintTypeEvent
is fired by an IlvConstraint
both before and after its type is modified. Immediately before its type is
modified, an IlvConstraint
fires an aboutToChange
ConstraintTypeEvent
in all listeners registered with the Gantt
data model.
Listeners can modify or constrain the proposed type by invoking
setNewType()
.
Alternatively, a listener can veto the proposed change by invoking
veto()
.
After its type is modified, an IlvConstraint
will fire a
changed ConstraintTypeEvent
in all listeners
registered with the Gantt data model. Listeners can access the old and new
values of the constraint's type, but cannot modify them via the event
mechanism.
source
Constructor and Description |
---|
ConstraintTypeEvent(IlvConstraint constraint,
IlvConstraintType oldType,
IlvConstraintType newType,
boolean aboutToChangeEvent)
Constructs a new
ConstraintTypeEvent generated
by the specified constraint and with the specified old and new
type values. |
Modifier and Type | Method and Description |
---|---|
IlvConstraintType |
getNewType()
Returns the constraint's new type.
|
IlvConstraintType |
getOldType()
Returns the constraint's old type.
|
void |
setNewType(IlvConstraintType type)
Sets the constraint's proposed new type.
|
getConstraint
getNewValue, getOldValue, isAboutToChangeEvent, isChangedEvent, isVetoed, setNewValue, veto
getSource, toString
public ConstraintTypeEvent(IlvConstraint constraint, IlvConstraintType oldType, IlvConstraintType newType, boolean aboutToChangeEvent)
ConstraintTypeEvent
generated
by the specified constraint and with the specified old and new
type values.constraint
- the constraint where the event originatedoldType
- the constraint's previous typenewType
- the constraint's new typeaboutToChangeEvent
- true
if this is an
constraintTypeAboutToChange
event or false
if
this is an constraintTypeChanged
event.public IlvConstraintType getOldType()
constraintTypeAboutToChange
event, then this will be the
same as the constraint's current type since the change has not actually
occurred yet. If this is a constraintTypeChanged
event, this
will be the constraint's type prior to the current modification being
reported.IlvConstraintType
.public IlvConstraintType getNewType()
constraintTypeAboutToChange
event, then this is will be
the constraint's proposed value. If this is a
constraintTypeChanged
event, this will be the constraint's
new type which is being reported.IlvConstraintType
.public void setNewType(IlvConstraintType type)
constraintTypeAboutToChange
event. By using this
method, a listener can constrain changes to the constraint's type.type
- the constraint's type© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.