Class SpecsPhoibosSequence

java.lang.Object
uk.ac.diamond.daq.devices.specs.phoibos.api.SpecsPhoibosSequence
All Implemented Interfaces:
Serializable

public class SpecsPhoibosSequence extends Object implements Serializable
A class for holding a list of SpecsPhoibosRegion's. It has property change support for use in dynamic GUIs. The sequence listens to events in each region to pass those through.

It implements Serializable to allow sequences to be passed over RMI.

See Also:
  • Constructor Details

    • SpecsPhoibosSequence

      public SpecsPhoibosSequence()
    • SpecsPhoibosSequence

      public SpecsPhoibosSequence(SpecsPhoibosSequence sequence)
      Copy constructor for creating a new sequence from an existing one
      Parameters:
      sequence - To be copied
  • Method Details

    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener listener)
    • removePropertyChangeListener

      public void removePropertyChangeListener(PropertyChangeListener listener)
    • getRegions

      public List<SpecsPhoibosRegion> getRegions()
      Gets all regions in the sequence
      Returns:
      List of all regions includes disabled
      See Also:
    • getEnabledRegions

      public List<SpecsPhoibosRegion> getEnabledRegions()
      Get the regions in the sequence that are enabled
      Returns:
      List of only the enabled regions
      See Also:
    • setRegions

      public void setRegions(List<SpecsPhoibosRegion> regions)
    • addRegion

      public void addRegion(SpecsPhoibosRegion region)
      Adds a region to the sequence.
      Parameters:
      region - The region to add
      Throws:
      IllegalArgumentException - If the sequence already contains a region with the same name as the region being added
    • removeRegion

      public void removeRegion(SpecsPhoibosRegion region)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getRegionNames

      public List<String> getRegionNames()
      Gets the names of all the regions in the sequence.
      Returns:
      List of the region names in the sequence
    • updateRegionListeners

      public void updateRegionListeners()
      This can be called to ensure that the sequence has one listener per region it contains. This is required after loading a sequence from XML because the XMLDecoder calls getRegions() than then adds the regions to the list.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object