Package uk.ac.starlink.ttools.plot
Class DensityStyle
- java.lang.Object
-
- uk.ac.starlink.ttools.plot.DensityStyle
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDensityStyle.ChannelEnumeration class which describes a colour channel.
-
Field Summary
Fields Modifier and Type Field Description static DensityStyle.ChannelBLUEBlue colour channel.static DensityStyle.ChannelGREENGreen colour channel.static DensityStyle.ChannelREDRed colour channel.
-
Constructor Summary
Constructors Constructor Description DensityStyle(DensityStyle.Channel channel)Constructs a new style which plots in a given colour channel.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intgetIconHeight()intgetIconWidth()javax.swing.IcongetLegendIcon()Returns an icon suitable for displaying in a legend for this style.ShadergetShader()Returns the shader to use in indexed (non-RGB) mode.protected abstract booleanisRGB()Indicates whether the plotting is currently to be treated as three-channel RGB plotting or as single-channel intensity plotting.intlevelBits(byte level)Defines how the style looks.voidpaintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)voidsetShader(Shader shader)Sets the shader to use in indexed (non-RGB) mode.java.lang.StringtoString()
-
-
-
Field Detail
-
RED
public static final DensityStyle.Channel RED
Red colour channel.
-
GREEN
public static final DensityStyle.Channel GREEN
Green colour channel.
-
BLUE
public static final DensityStyle.Channel BLUE
Blue colour channel.
-
-
Constructor Detail
-
DensityStyle
public DensityStyle(DensityStyle.Channel channel)
Constructs a new style which plots in a given colour channel.- Parameters:
channel- colour channel
-
-
Method Detail
-
setShader
public void setShader(Shader shader)
Sets the shader to use in indexed (non-RGB) mode. This should be an absolute shader.- Parameters:
shader- shader
-
getShader
public Shader getShader()
Returns the shader to use in indexed (non-RGB) mode. This should be an absolute shader.- Returns:
- shader
-
levelBits
public int levelBits(byte level)
Defines how the style looks. This converts an unsigned byte value (that is a value in the range 0-255 got by doingvalue=0x000000ff&level) to a bitmask which can be OR-ed with an existing integer to give a 32-type ARGB colour value.- Parameters:
level- unsigned byte value- Returns:
- ORable bit mask for modifying a colour value
-
isRGB
protected abstract boolean isRGB()
Indicates whether the plotting is currently to be treated as three-channel RGB plotting or as single-channel intensity plotting.- Returns:
- true iff plotting is currently three-channel
-
getLegendIcon
public javax.swing.Icon getLegendIcon()
Description copied from interface:StyleReturns an icon suitable for displaying in a legend for this style.- Specified by:
getLegendIconin interfaceStyle
-
getIconHeight
public int getIconHeight()
- Specified by:
getIconHeightin interfacejavax.swing.Icon
-
getIconWidth
public int getIconWidth()
- Specified by:
getIconWidthin interfacejavax.swing.Icon
-
paintIcon
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)- Specified by:
paintIconin interfacejavax.swing.Icon
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-