Code example for PropertyChangeEvent

Methods: getNewValue, getOldValue, getPropertyName, getSource

0
     
    /** If from this Sensor's mover, re-broadcast the event. 
     * @param e Heard PropertyChangeEvent 
     */     
    public void propertyChange(PropertyChangeEvent e) {
        if (e.getSource() == mover) {
            firePropertyChange(e.getPropertyName(), e.getOldValue(), e.getNewValue());
        } 
    } 
     
/** 
* Returns this Set of contacts currently held by this Sensor. 
**/ 
    public Set<Moveable> getContacts() {
        return new LinkedHashSet<Moveable>(contacts);
    } 
 
//    @Override 
    public void setMaxRange(double r) {
        this.maxRange = r;
    }