Search in sources :

Example 6 with ThrottleListener

use of jmri.ThrottleListener in project JMRI by JMRI.

the class AbstractThrottle method removePropertyChangeListener.

// register for notification if any of the properties change
@Override
public void removePropertyChangeListener(PropertyChangeListener l) {
    log.debug("Removing property change " + l);
    if (listeners.contains(l)) {
        listeners.removeElement(l);
    }
    log.debug("remove listeners size is " + listeners.size());
    if ((listeners.isEmpty())) {
        log.debug("No listeners so will call the dispose in the InstanceManger with an empty throttleListenr null value");
        InstanceManager.throttleManagerInstance().disposeThrottle(this, new ThrottleListener() {

            @Override
            public void notifyFailedThrottleRequest(DccLocoAddress address, String reason) {
            }

            @Override
            public void notifyThrottleFound(DccThrottle t) {
            }
        });
    }
}
Also used : ThrottleListener(jmri.ThrottleListener) DccThrottle(jmri.DccThrottle) DccLocoAddress(jmri.DccLocoAddress)

Example 7 with ThrottleListener

use of jmri.ThrottleListener in project JMRI by JMRI.

the class AbstractThrottleTest method testDispatch_ThrottleListener.

/**
     * Test of dispatch method, of class AbstractThrottle.
     */
public void testDispatch_ThrottleListener() {
    ThrottleListener l = null;
    AbstractThrottle instance = new AbstractThrottleImpl();
    instance.dispatch(l);
}
Also used : ThrottleListener(jmri.ThrottleListener)

Example 8 with ThrottleListener

use of jmri.ThrottleListener in project JMRI by JMRI.

the class AbstractThrottleTest method testDispose_ThrottleListener.

/**
     * Test of dispose method, of class AbstractThrottle.
     */
public void testDispose_ThrottleListener() {
    ThrottleListener l = null;
    AbstractThrottle instance = new AbstractThrottleImpl();
    instance.dispose(l);
}
Also used : ThrottleListener(jmri.ThrottleListener)

Aggregations

ThrottleListener (jmri.ThrottleListener)8 DccThrottle (jmri.DccThrottle)3 PropertyChangeEvent (java.beans.PropertyChangeEvent)2 PropertyChangeListener (java.beans.PropertyChangeListener)2 DccLocoAddress (jmri.DccLocoAddress)2 ThrottleManager (jmri.ThrottleManager)2