Package uk.ac.starlink.ttools.plot2
Class ShadeAxis
java.lang.Object
uk.ac.starlink.ttools.plot2.ShadeAxis
Graphical representation of aux shading range which can be placed
near the plot.
- Since:
- 13 Feb 2013
- Author:
- Mark Taylor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateAxisIcon
(Rectangle rampBounds) Returns an icon containing a graphical representation of the shading axis including axis annotations (label and numbers).double
Returns the crowding factor for this axis.double
Returns the maximum data value represented on this axis.double
Returns the minimum data value represented on this axis.int
Returns a nominal number of pixels required at the top and bottom of the ramp icon to accommodated possible axis labels.getLabel()
Returns the text label for this axis.getRampInsets
(Rectangle rampBounds) Returns the insets that the bounds icon would like to have for annotating the axis given the dimensions of the actual scale ramp graphic.int
Preferred number of pixels in the lateral direction for the axis colour ramp.
-
Constructor Details
-
ShadeAxis
public ShadeAxis(Shader shader, Scaler scaler, String label, Captioner captioner, double crowding, int rampWidth) Constructor.- Parameters:
shader
- object performing the actual shadingscaler
- maps data values to unit rangelabel
- axis labelcaptioner
- text rendering objectcrowding
- 1 for normal tick density, lower for fewer labels, higher for morerampWidth
- preferred number of pixels in the lateral direction for the the ramp icon; this value is not used by this class, but this class serves as a useful place to keep it
-
-
Method Details
-
createAxisIcon
Returns an icon containing a graphical representation of the shading axis including axis annotations (label and numbers). The supplied rectangle gives the dimensions of the actual scale ramp, not including annotations.- Parameters:
rampBounds
- ramp position- Returns:
- axis icon, with equality semantics
-
getRampInsets
Returns the insets that the bounds icon would like to have for annotating the axis given the dimensions of the actual scale ramp graphic.- Parameters:
rampBounds
- ramp position- Returns:
- insets surrounding
rampBounds
required for annotation
-
getEndPadding
public int getEndPadding()Returns a nominal number of pixels required at the top and bottom of the ramp icon to accommodated possible axis labels. This is currently half the height of a digit caption.- Returns:
- ramp icon vertical padding for labels
-
getRampWidth
public int getRampWidth()Preferred number of pixels in the lateral direction for the axis colour ramp. Not enforced by any behaviour of this class.- Returns:
- preferred ramp width
-
getDataLow
public double getDataLow()Returns the minimum data value represented on this axis.- Returns:
- data lower limit
-
getDataHigh
public double getDataHigh()Returns the maximum data value represented on this axis.- Returns:
- data upper limit
-
getLabel
Returns the text label for this axis.- Returns:
- axis label
-
getCrowding
public double getCrowding()Returns the crowding factor for this axis.- Returns:
- 1 for normal tick density, lower for fewer labels, higher for more
-