Package uk.ac.starlink.ttools.plot2
Class ShadeAxis
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.ShadeAxis
-
public class ShadeAxis extends java.lang.Object
Graphical representation of aux shading range which can be placed near the plot.- Since:
- 13 Feb 2013
- Author:
- Mark Taylor
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.swing.Icon
createAxisIcon(java.awt.Rectangle rampBounds)
Returns an icon containing a graphical representation of the shading axis including axis annotations (label and numbers).double
getCrowding()
Returns the crowding factor for this axis.double
getDataHigh()
Returns the maximum data value represented on this axis.double
getDataLow()
Returns the minimum data value represented on this axis.int
getEndPadding()
Returns a nominal number of pixels required at the top and bottom of the ramp icon to accommodated possible axis labels.java.lang.String
getLabel()
Returns the text label for this axis.java.awt.Insets
getRampInsets(java.awt.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
getRampWidth()
Preferred number of pixels in the lateral direction for the axis colour ramp.
-
-
-
Constructor Detail
-
ShadeAxis
public ShadeAxis(Shader shader, Scaler scaler, java.lang.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 Detail
-
createAxisIcon
@Equality public javax.swing.Icon createAxisIcon(java.awt.Rectangle rampBounds)
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
public java.awt.Insets getRampInsets(java.awt.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.- 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
public java.lang.String 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
-
-