uk.ac.starlink.ttools.plot2
Class ShadeAxis

java.lang.Object
  extended by uk.ac.starlink.ttools.plot2.ShadeAxis

public class ShadeAxis
extends Object

Graphical representation of aux shading range which can be placed near the plot.

Since:
13 Feb 2013
Author:
Mark Taylor

Constructor Summary
ShadeAxis(Shader shader, Scaling scaling, double dlo, double dhi, String label, Captioner captioner, double crowding)
          Constructor.
 
Method Summary
 Icon createAxisIcon(Rectangle rampBounds)
          Returns an icon containing a graphical representation of the shading axis including axis annotations (label and numbers).
 int getEndPadding()
          Returns a nominal number of pixels required at the top and bottom of the ramp icon to accommodated possible axis labels.
 Insets 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShadeAxis

public ShadeAxis(Shader shader,
                 Scaling scaling,
                 double dlo,
                 double dhi,
                 String label,
                 Captioner captioner,
                 double crowding)
Constructor.

Parameters:
shader - object performing the actual shading
scaling - maps data values to unit range
dlo - minimum data value
dhi - maximum data value
label - axis label
captioner - text rendering object
crowding - 1 for normal tick density, lower for fewer labels, higher for more
Method Detail

createAxisIcon

@Equality
public Icon createAxisIcon(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 Insets 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.

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


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.