Package uk.ac.starlink.topcat.plot
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 java.lang.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, java.util.BitSet used)
Constructs a new StyleSet.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getName()
uk.ac.starlink.ttools.plot.Style
getStyle(int index)
void
reset()
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.
-
-
-
Constructor Detail
-
PoolStyleSet
public PoolStyleSet(uk.ac.starlink.ttools.plot.StyleSet base, java.util.BitSet used)
Constructs a new StyleSet.- Parameters:
base
- style set which supplies the actual symbolsused
- a bit vector, shared between a group of PoolStyleSet, which keeps track of which styles (indices intobase
) are currently in use
-
-
Method Detail
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceuk.ac.starlink.ttools.plot.StyleSet
-
getStyle
public uk.ac.starlink.ttools.plot.Style getStyle(int index)
- Specified by:
getStyle
in interfaceuk.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 interfaceMutableStyleSet
- Parameters:
index
- style indexstyle
- 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.
-
-