Class PoolStyleSet

java.lang.Object
uk.ac.starlink.topcat.plot.PoolStyleSet
All Implemented Interfaces:
MutableStyleSet, uk.ac.starlink.ttools.plot.StyleSet

public class PoolStyleSet extends Object implements MutableStyleSet
StyleSet which obtains styles from a base StyleSet, but only dispenses ones which are not already used. A global list of used indices, which is shared with other instances of this class, ensures that markers are not shared between them. Since this also implements MutableStyleSet, individual styles can be overwritten.
Since:
4 Nov 2005
Author:
Mark Taylor
  • Constructor Summary

    Constructors
    Constructor
    Description
    PoolStyleSet(uk.ac.starlink.ttools.plot.StyleSet base, BitSet used)
    Constructs a new StyleSet.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    uk.ac.starlink.ttools.plot.Style
    getStyle(int index)
     
    void
    Resets all the symbols to be ones from the base set.
    void
    setStyle(int index, uk.ac.starlink.ttools.plot.Style style)
    Explicitly sets the style at a given index to be a specified one.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PoolStyleSet

      public PoolStyleSet(uk.ac.starlink.ttools.plot.StyleSet base, BitSet used)
      Constructs a new StyleSet.
      Parameters:
      base - style set which supplies the actual symbols
      used - a bit vector, shared between a group of PoolStyleSet, which keeps track of which styles (indices into base) are currently in use
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface uk.ac.starlink.ttools.plot.StyleSet
    • getStyle

      public uk.ac.starlink.ttools.plot.Style getStyle(int index)
      Specified by:
      getStyle in interface uk.ac.starlink.ttools.plot.StyleSet
    • setStyle

      public void setStyle(int index, uk.ac.starlink.ttools.plot.Style style)
      Explicitly sets the style at a given index to be a specified one.
      Specified by:
      setStyle in interface MutableStyleSet
      Parameters:
      index - style index
      style - style to use
    • reset

      public void reset()
      Resets all the symbols to be ones from the base set. This also has the effect of returning any styles owned by this set to the pool.