Package xal.app.knobs

Class KnobGroup

    • Field Detail

      • MESSAGE_CENTER

        protected final xal.tools.messaging.MessageCenter MESSAGE_CENTER
        The message center for this group's originated events
      • EVENT_PROXY

        protected final KnobGroupListener EVENT_PROXY
        The proxy for posting KnobGroupListener events
      • _knobs

        protected final List<Knob> _knobs
        The list of knobs in this group
      • _label

        protected String _label
        The label for this group
    • Constructor Detail

      • KnobGroup

        public KnobGroup​(String label)
        Constructor
        Parameters:
        label - The label for the group
      • KnobGroup

        public KnobGroup​(String label,
                         List<Knob> knobs)
        Primary constructor
        Parameters:
        label - The label for the group
        knobs - The initial list of knobs to include in the group
    • Method Detail

      • dataLabel

        public String dataLabel()
        dataLabel() provides the name used to identify the class in an external data source.
        Specified by:
        dataLabel in interface xal.tools.data.DataListener
        Returns:
        The tag for this data node.
      • update

        public void update​(xal.tools.data.DataAdaptor adaptor)
        Instructs the receiver to update its data based on the given adaptor.
        Specified by:
        update in interface xal.tools.data.DataListener
        Parameters:
        adaptor - The data adaptor corresponding to this object's data node.
      • write

        public void write​(xal.tools.data.DataAdaptor adaptor)
        Instructs the receiver to write its data to the adaptor for external storage.
        Specified by:
        write in interface xal.tools.data.DataListener
        Parameters:
        adaptor - The data adaptor corresponding to this object's data node.
      • addKnobGroupListener

        public void addKnobGroupListener​(KnobGroupListener listener)
        Add a listener of KnobGroupListener events generated by this AppGroup
        Parameters:
        listener - The listener to add
      • removeKnobGroupListener

        public void removeKnobGroupListener​(KnobGroupListener listener)
        Remove a listener of KnobGroupListener events generated by this AppGroup
        Parameters:
        listener - The listener to remove
      • getLabel

        public String getLabel()
        Get the label for this group
        Returns:
        this group's label
      • setLabel

        public void setLabel​(String label)
        Set the label for this group
        Parameters:
        label - The new label for this group
      • allowsLabelEdit

        public boolean allowsLabelEdit()
        Determine if the group allows editing of its label
        Returns:
        true
      • getKnob

        public Knob getKnob​(int index)
        Get the knob at the specified index
        Parameters:
        index - The index of the knob to get
        Returns:
        The knob at the index in this group's list
      • getKnobs

        public List<Knob> getKnobs()
        Get the list of this group's applications
        Returns:
        The list of this group's applications
      • getKnobCount

        public int getKnobCount()
        Get the count of knobs in this group
        Returns:
        the count of knobs in this group
      • contains

        public boolean contains​(Knob knob)
        Determine if this group contains the specified knob
        Parameters:
        knob - The knob for which to check
        Returns:
        true if this group contains the knob and false if not
      • addKnobs

        public void addKnobs​(Collection<Knob> knobs)
        Add the collection of knobs to this group and notify listeners
        Parameters:
        knobs - The collection of knobs to add
      • addKnob

        public void addKnob​(Knob knob)
        Add a knob to this group and notify listeners
        Parameters:
        knob - The knob to add
      • removeKnobs

        public void removeKnobs​(List<Knob> knobs)
        Remove the specified knob from this group and notify listeners
        Parameters:
        knobs - The knobs to remove
      • removeKnob

        public void removeKnob​(Knob knob)
        Remove the specified knob from this group and notify listeners
        Parameters:
        knob - The knob to remove
      • toString

        public String toString()
        Provide a string representation of the group.
        Overrides:
        toString in class Object
        Returns:
        the group's label
        See Also:
        getLabel()
      • sortKnobs

        protected void sortKnobs()
        Sort the knobs alphabetically
      • compareTo

        public int compareTo​(KnobGroup group)
        Compare two instances. The two instances are compared by label and the comparison is based on alphebetical sorting.
        Specified by:
        compareTo in interface Comparable<KnobGroup>
        Parameters:
        group - the other object against which to compare this one
        Returns:
        a positive number if this comes after the argument, negative if this comes before and 0 if they are equal
        See Also:
        getLabel()
      • nameChanged

        public void nameChanged​(Knob knob,
                                String newName)
        event indicating that the specified knob's name has changed
        Specified by:
        nameChanged in interface KnobListener
      • limitsChanged

        public void limitsChanged​(Knob knob,
                                  double lowerLimit,
                                  double upperLimit)
        event indicating that the knob's limits have changed
        Specified by:
        limitsChanged in interface KnobListener
      • currentSettingChanged

        public void currentSettingChanged​(Knob knob,
                                          double value)
        event indicating that the knob's current value setting has changed
        Specified by:
        currentSettingChanged in interface KnobListener
      • valueSettingPublished

        public void valueSettingPublished​(Knob knob)
        event indicating that the knob's most previously pending set operation has completed
        Specified by:
        valueSettingPublished in interface KnobListener