JMSLTM Numerical Library 4.0

com.imsl.chart3d
Class ColormapLegend

java.lang.Object
  extended bycom.imsl.chart.AbstractChartNode
      extended bycom.imsl.chart3d.ChartNode3D
          extended bycom.imsl.chart3d.ColormapLegend
All Implemented Interfaces:
Cloneable, Serializable

public class ColormapLegend
extends ChartNode3D
implements Serializable

Adds a legend for a Colormap gradient to the background of the canvas.

See Also:
Serialized Form

Field Summary
static long serialVersionUID
           
 
Fields inherited from class com.imsl.chart3d.ChartNode3D
AXIS_TITLE_AT_END, AXIS_TITLE_PARALLEL, DATA_TYPE_LINE, DATA_TYPE_MARKER, DATA_TYPE_PICTURE, DATA_TYPE_TUBE, MARKER_TYPE_CUBE, MARKER_TYPE_CUSTOM, MARKER_TYPE_PLUS, MARKER_TYPE_SIMPLE_CUBE, MARKER_TYPE_SIMPLE_PLUS, MARKER_TYPE_SIMPLE_TETRAHEDRON, MARKER_TYPE_SPHERE, MARKER_TYPE_TETRAHEDRON
 
Fields inherited from class com.imsl.chart.AbstractChartNode
AUTOSCALE_DATA, AUTOSCALE_DENSITY, AUTOSCALE_NUMBER, AUTOSCALE_OFF, AUTOSCALE_WINDOW, AXIS_X, AXIS_Y, AXIS_Z, LABEL_TYPE_NONE, LABEL_TYPE_TITLE, LABEL_TYPE_X, LABEL_TYPE_Y, LABEL_TYPE_Z, TRANSFORM_CUSTOM, TRANSFORM_LINEAR, TRANSFORM_LOG
 
Constructor Summary
ColormapLegend(Chart3D chart, Colormap colormap, double[] ticks)
          Creates a legend for a Colormap and adds it to the canvas.
ColormapLegend(Chart3D chart, Colormap colormap, double min, double max)
           
 
Method Summary
protected  void addToSceneGraph(Group parent)
          Called to add this object to the scene graph.
 int[] getPosition()
          Returns the position of the legend.
 double[] getTicks()
          Returns the value of the "Ticks" attribute, if set.
 double[] getWindow()
          Returns the window for a ColormapLegend.
 void setPosition(int x, int y)
          Sets the position of the legend.
 void setTicks(double[] ticks)
          Sets the value of the "Ticks" attribute.
 void setWindow(double[] window)
          Sets the window for a ColormapLegend.
 void setWindow(double min, double max)
          Sets the window for a ColormapLegend.
 
Methods inherited from class com.imsl.chart3d.ChartNode3D
getAxisTitlePosition, getBoundingSphere, getChildren, getColorFunction, getConcatenatedViewport, getDataType, getMarkerPulsingCycle, getMarkerPulsingCycleOffset, getMarkerPulsingMaximumScale, getMarkerPulsingMinimumScale, getMarkerRotatingAxis, getMarkerRotatingCycle, getMarkerRotatingCycleOffset, getMarkerType, getMaterial, getParent, getTitle, getViewport, getVirtualUniverse, getZ, setAxisTitlePosition, setBoundingSphere, setColorFunction, setDataType, setMarkerPulsingCycle, setMarkerPulsingCycleOffset, setMarkerPulsingMaximumScale, setMarkerPulsingMinimumScale, setMarkerRotatingAxis, setMarkerRotatingCycle, setMarkerRotatingCycleOffset, setMarkerType, setMaterial, setTitle, setViewport, setViewport, setZ
 
Methods inherited from class com.imsl.chart.AbstractChartNode
clone, clone, clone, clone, getAbstractParent, getAttribute, getAutoscaleInput, getAutoscaleMinimumTimeInterval, getAutoscaleOutput, getBooleanAttribute, getChildList, getColorAttribute, getCustomTransform, getDensity, getDoubleAttribute, getFillColor, getFont, getFontName, getFontSize, getFontStyle, getImage, getIntegerAttribute, getLabelType, getLightColor, getLineColor, getLineWidth, getLocale, getMarkerColor, getMarkerSize, getName, getNumber, getPaint, getStringAttribute, getTextColor, getTextFormat, getTickLength, getTransform, getX, getY, isAncestorOf, isAttributeSet, isAttributeSetAtThisNode, isBitSet, parseColor, remove, setAttribute, setAutoscaleInput, setAutoscaleMinimumTimeInterval, setAutoscaleOutput, setCustomTransform, setDensity, setFillColor, setFillColor, setFont, setFontName, setFontSize, setFontStyle, setImage, setLabelType, setLightColor, setLightColor, setLineColor, setLineColor, setLineWidth, setLocale, setMarkerColor, setMarkerColor, setMarkerSize, setName, setNumber, setPaint, setTextColor, setTextColor, setTextFormat, setTextFormat, setTickLength, setTransform, setX, setY, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

ColormapLegend

public ColormapLegend(Chart3D chart,
                      Colormap colormap,
                      double[] ticks)
Creates a legend for a Colormap and adds it to the canvas. If set, the attribute "Title" is used to provide a title for the legend.

The paint method in Canvas3DChart.Paint is written into an image of size width by height. Any whitespace around the image is trimmed. The trimmed image is then used to paint onto the canvas.

Parameters:
chart - is the Chart3D object on which the legend is to be painted.
colormap - is the Colormap for the legend.
ticks - is an array of values used to label the legend. These should be equally spaced.

ColormapLegend

public ColormapLegend(Chart3D chart,
                      Colormap colormap,
                      double min,
                      double max)
Method Detail

addToSceneGraph

protected void addToSceneGraph(Group parent)
Description copied from class: ChartNode3D
Called to add this object to the scene graph.

Specified by:
addToSceneGraph in class ChartNode3D
Parameters:
parent - is the node in the scene graph at which this object is to be added.

getPosition

public int[] getPosition()
Returns the position of the legend.

Returns:
an array containing the legend's position.

getTicks

public double[] getTicks()
Returns the value of the "Ticks" attribute, if set. If not set, then computed tick values are returned.

Returns:
the double value of the "Ticks" attribute, if defined. Otherwise, the computed tick values are returned.

getWindow

public double[] getWindow()
Returns the window for a ColormapLegend.

Returns:
window an array of length two containing the range of this colormap.

setPosition

public void setPosition(int x,
                        int y)
Sets the position of the legend. The default position is (0,0).

Parameters:
x - is the pixel position in the canvas of the left edge of the legend. If x is negative then |x| is the distance from the right edge of the legend to the right edge of the component.
y - is the pixel position in the canvas of the top edge of the legend. If y is negative then |y| is the distance from the bottom edge of the legend to the bottom edge of the component.

setTicks

public void setTicks(double[] ticks)
Sets the value of the "Ticks" attribute. The attribute Number is set to the length of the array.

Parameters:
ticks - an array of doubles which contain the location, in user coordinates, of the major tick marks. If set, this attribute overrides the automatic computation of the tick values.

setWindow

public void setWindow(double[] window)
Sets the window for a ColormapLegend.

Parameters:
window - is an array of length two containing the range of this axis.

setWindow

public void setWindow(double min,
                      double max)
Sets the window for a ColormapLegend.

Parameters:
min - is the value of the bottom end of the colormap legend labels.
max - is the value of the top of the colormap legend labels.

JMSLTM Numerical Library 4.0

Copyright 1970-2006 Visual Numerics, Inc.
Built June 1 2006.