public class ConstraintPropertyEvent extends IlvPropertyEvent implements ConstraintEvent
ConstraintPropertyEvent
is the superclass of all property
aboutToChange and changed events fired by
IlvConstraint
's.
Basic support is provided for storing the property's old and new values,
along with veto capabilities for aboutToChange events. Concrete
subclasses should provide typesafe accessors for the property's values. For
example:
class ConstraintFooEvent extends ConstraintPropertyEvent { public ConstraintFooEvent (IlvConstraint constraint, Foo oldVal, Foo newVal, boolean aboutToChangeEvent) { super(constraint, oldVal, newVal, aboutToChangeEvent);} public Foo getOldFoo () { return (Foo)getOldValue();} public Foo getNewFoo () { return (Foo)getNewValue();} public void setNewFoo (Foo newVal) { setNewValue(newVal);} }Interested
ConstraintListener
's must register with the gantt
data model to receive these events. IlvConstraint
does not
handle direct listener subscriptions.source
Constructor and Description |
---|
ConstraintPropertyEvent(IlvConstraint constraint,
Object oldValue,
Object newValue,
boolean aboutToChangeEvent)
Constructs a new
ConstraintPropertyEvent generated by the
specified constraint. |
Modifier and Type | Method and Description |
---|---|
IlvConstraint |
getConstraint()
Returns the constraint where this event originated.
|
getNewValue, getOldValue, isAboutToChangeEvent, isChangedEvent, isVetoed, setNewValue, veto
getSource, toString
public ConstraintPropertyEvent(IlvConstraint constraint, Object oldValue, Object newValue, boolean aboutToChangeEvent)
ConstraintPropertyEvent
generated by the
specified constraint.constraint
- the constraint where the event originatedoldValue
- the property's previous valuenewValue
- the property's new valueaboutToChangeEvent
- true
if this is a property
aboutToChange event or false
if this is a property
changed event.public IlvConstraint getConstraint()
getConstraint
in interface ConstraintEvent
IlvConstraint
where this event originated.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.