Class SelectionModelGroup<T,​V>

  • All Implemented Interfaces:
    java.io.Serializable

    public abstract class SelectionModelGroup<T,​V>
    extends java.lang.Object
    implements java.io.Serializable
    This class is used to create a multiple-exclusion scope for a set of any selection model so that one selection model can have selected index at a time.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      SelectionModelGroup()
      Creates a new SelectionModelGroup.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int index, T model)
      Adds the ListSelectionModel to the group.
      void add​(T model)
      Adds the ListSelectionModel to the group.
      protected abstract void addSelectionListener​(T model, V listener)  
      protected abstract V createSelectionListener()  
      java.util.List<T> getElements()
      Gets the registered models.
      int getModelCount()
      Returns the number of T in the group.
      java.util.List<T> getModels()
      Returns all the T that are participating in this group.
      void remove​(T model)
      Removes the T from the group.
      void removeAll()
      Removes all T's from the group.
      protected abstract void removeSelectionListener​(T model, V listener)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • _models

        protected java.util.List<T> _models
      • _selectionListener

        protected V _selectionListener
    • Constructor Detail

      • SelectionModelGroup

        public SelectionModelGroup()
        Creates a new SelectionModelGroup.
    • Method Detail

      • createSelectionListener

        protected abstract V createSelectionListener()
      • addSelectionListener

        protected abstract void addSelectionListener​(T model,
                                                     V listener)
      • removeSelectionListener

        protected abstract void removeSelectionListener​(T model,
                                                        V listener)
      • add

        public void add​(T model)
        Adds the ListSelectionModel to the group.
        Parameters:
        model - the ListSelectionModel to be added
      • add

        public void add​(int index,
                        T model)
        Adds the ListSelectionModel to the group.
        Parameters:
        model - the ListSelectionModel to be added
        index - the index
      • remove

        public void remove​(T model)
        Removes the T from the group.
        Parameters:
        model - the T to be removed
      • removeAll

        public void removeAll()
        Removes all T's from the group.
      • getElements

        public java.util.List<T> getElements()
        Gets the registered models.
        Returns:
        the models.
      • getModels

        public java.util.List<T> getModels()
        Returns all the T that are participating in this group.
        Returns:
        an array of all Ts
      • getModelCount

        public int getModelCount()
        Returns the number of T in the group.
        Returns:
        the T count