Class ColourScheme
- java.lang.Object
-
- uk.ac.rdg.resc.edal.graphics.style.ColourScheme
-
- Direct Known Subclasses:
EnumeratedColourScheme
,MappedColourScheme
,RGBColourScheme
,SegmentColourScheme
public abstract class ColourScheme extends Object
-
-
Constructor Summary
Constructors Constructor Description ColourScheme()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Color
getColor(Number value)
Returns the colour associated with the given valueBufferedImage
getScaleBar(int width, int height, float fracOutOfRange, boolean vertical, boolean labels, Color textColor, Color bgColor)
Gets a scale bar for thisColourScheme
BufferedImage
getScaleBar(int width, int height, float fracOutOfRangeLow, float fracOutOfRangeHigh, boolean vertical, boolean labels, Color textColor, Color bgColor)
Gets a scale bar for thisColourScheme
abstract Float
getScaleMax()
abstract Float
getScaleMin()
-
-
-
Method Detail
-
getScaleBar
public BufferedImage getScaleBar(int width, int height, float fracOutOfRange, boolean vertical, boolean labels, Color textColor, Color bgColor)
Gets a scale bar for thisColourScheme
- Parameters:
width
- The desired width of the scale barheight
- The desired height of the scale barfracOutOfRange
- The amount of out of range to show as a fraction of the coloured partvertical
- Whether or not the scale bar should be verticallabels
- Whether to show numerical labelstextColor
- The colour of the text labelsbgColor
- The background colour for the text labels- Returns:
- The scale bar image
-
getScaleBar
public BufferedImage getScaleBar(int width, int height, float fracOutOfRangeLow, float fracOutOfRangeHigh, boolean vertical, boolean labels, Color textColor, Color bgColor)
Gets a scale bar for thisColourScheme
- Parameters:
width
- The desired width of the scale barheight
- The desired height of the scale barfracOutOfRangeLow
- The amount below the minimum to show as a fraction of the coloured partfracOutOfRangeHigh
- The amount above the maximum to show as a fraction of the coloured partvertical
- Whether or not the scale bar should be verticallabels
- Whether to show numerical labelstextColor
- The colour of the text labelsbgColor
- The background colour for the text labels- Returns:
- The scale bar image
-
getColor
public abstract Color getColor(Number value)
Returns the colour associated with the given value- Parameters:
value
- The value to get a colour for- Returns:
- The
Color
according to thisColourScheme
-
getScaleMin
public abstract Float getScaleMin()
- Returns:
- The minimum value of this colour scale
-
getScaleMax
public abstract Float getScaleMax()
- Returns:
- The maximum value of this colour scale
-
-