001package jmri.jmrit.throttle;
002
003
004import jmri.DccLocoAddress;
005
006/**
007 * 
008 * An interface for containers of throttle controllers user interface
009 *  (ThrottleWindow for Swing throttles for instance)
010 * 
011 * @author Lionel Jeanson 2026
012 */
013public interface ThrottleControllersUIContainer {
014
015    /**
016     * Return the number of thottle controlS containerS (ThrottleWindows forinstance)
017     *
018     * @return the number of active thottle controls containers.
019     */    
020    int getNbThrottlesControllers();
021    
022    /**
023     * Created a new throttle controller
024     *
025     * @return the newly created throttle controller
026     */    
027    ThrottleControllerUI newThrottleController();
028    
029    /**
030     * Adds an existing throttle controller to that container list at position n
031     *
032     * @param tf the throttle controller to add
033     * @param n position that it will inserted at
034     */
035    void addThrottleControllerAt(ThrottleControllerUI tf, int n);
036    
037    /**
038     * Remove a throttle controller from that container
039     *
040     * @param tf the throttle controller to add
041     */
042    void removeThrottleController(ThrottleControllerUI tf);
043    
044    /**
045     * Get the throttle controller at position n
046     *
047     * @param n position
048     * @return the throttle controller
049     */
050    ThrottleControllerUI getThrottleControllerAt(int n);
051    
052    /**
053     * Force estop all throttles managed by that controllers container
054     *
055     */    
056    void emergencyStopAll();
057
058    /**
059     * Get the number of usages of a particular Loco Address.
060     * @param la the Loco Address, can be null.
061     * @return 0 if no usages, else number of AddressPanel usages.
062     */    
063    public int getNumberOfEntriesFor(DccLocoAddress la);
064
065}