JMSLTM Numerical Library 5.0.1

com.imsl.chart
Class Dendrogram

java.lang.Object
  extended by com.imsl.chart.AbstractChartNode
      extended by com.imsl.chart.ChartNode
          extended by com.imsl.chart.Data
              extended by com.imsl.chart.Dendrogram
All Implemented Interfaces:
Serializable, Cloneable

public class Dendrogram
extends Data

A Dendrogram chart for cluster analysis.

See Also:
Example, Chart Programmer's Guide: Dendrogram, Serialized Form

Field Summary
static long serialVersionUID
           
 
Fields inherited from class com.imsl.chart.ChartNode
AXIS_X_TOP, AXIS_Y_RIGHT, BAR_TYPE_HORIZONTAL, BAR_TYPE_VERTICAL, DASH_PATTERN_DASH, DASH_PATTERN_DASH_DOT, DASH_PATTERN_DOT, DASH_PATTERN_SOLID, DATA_TYPE_FILL, DATA_TYPE_LINE, DATA_TYPE_MARKER, DATA_TYPE_PICTURE, DATA_TYPE_TUBE, DENDROGRAM_TYPE_HORIZONTAL, DENDROGRAM_TYPE_VERTICAL, FILL_TYPE_GRADIENT, FILL_TYPE_NONE, FILL_TYPE_PAINT, FILL_TYPE_SOLID, LABEL_TYPE_PERCENT, MARKER_TYPE_ASTERISK, MARKER_TYPE_CIRCLE_CIRCLE, MARKER_TYPE_CIRCLE_PLUS, MARKER_TYPE_CIRCLE_X, MARKER_TYPE_DIAMOND_PLUS, MARKER_TYPE_FILLED_CIRCLE, MARKER_TYPE_FILLED_DIAMOND, MARKER_TYPE_FILLED_SQUARE, MARKER_TYPE_FILLED_TRIANGLE, MARKER_TYPE_HOLLOW_CIRCLE, MARKER_TYPE_HOLLOW_DIAMOND, MARKER_TYPE_HOLLOW_SQUARE, MARKER_TYPE_HOLLOW_TRIANGLE, MARKER_TYPE_OCTAGON_PLUS, MARKER_TYPE_OCTAGON_X, MARKER_TYPE_PLUS, MARKER_TYPE_SQUARE_PLUS, MARKER_TYPE_SQUARE_X, MARKER_TYPE_X, TEXT_X_CENTER, TEXT_X_LEFT, TEXT_X_RIGHT, TEXT_Y_BOTTOM, TEXT_Y_CENTER, TEXT_Y_TOP
 
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
Dendrogram(AxisXY axis, ClusterHierarchical clusterHierarchical)
          Constructs a vertical dendrogram chart using supplied ClusterHierarchical object.
Dendrogram(AxisXY axis, ClusterHierarchical clusterHierarchical, int type)
          Constructs a dendrogram chart using supplied ClusterHierarchical object.
Dendrogram(AxisXY axis, double[] clusterLevel, int[] leftSons, int[] rightSons)
          Constructs a vertical dendrogram chart using supplied data.
Dendrogram(AxisXY axis, double[] clusterLevel, int[] leftSons, int[] rightSons, int type)
          Constructs a dendrogram chart using supplied data.
 
Method Summary
 void dataRange(double[] range)
          Update the data range, range = {xmin,xmax,ymin,ymax}.
 double[][] getCoordinates()
          Convenience routine to get the "Coordinates" attribute.
 int[] getLeftSons()
          Convenience routine to get the "LeftSons" attribute.
 double[] getLevels()
          Convenience routine to get the "Levels" attribute.
 int[] getOrder()
          Convenience routine to get the "Order" attribute.
 int[] getRightSons()
          Convenience routine to get the "RightSons" attribute.
 void paint(Draw draw)
          Paints this node and all of its children.
 void setCoordinates(double[][] value)
          Convenience routine to set the "Coordinates" attribute.
 void setLabels(String[] labels)
          Sets up the axis labels for dendrogram plot.
 void setLeftSons(int[] value)
          Convenience routine to set the "LeftSons" attribute.
 void setLevels(double[] value)
          Convenience routine to set the "Levels" attribute.
 void setLineColor(Color[] colors)
          Define colors for individual clusters.
 void setLineColor(String[] colors)
          Define colors for individual clusters.
 void setOrder(int[] value)
          Convenience routine to set the "Order" attribute.
 void setRightSons(int[] value)
          Convenience routine to set the "RightSons" attribute.
 
Methods inherited from class com.imsl.chart.Data
formatLabel
 
Methods inherited from class com.imsl.chart.ChartNode
addPickListener, firePickListeners, getALT, getAxis, getBackground, getBarGap, getBarType, getBarWidth, getChart, getChartTitle, getChildren, getClipData, getComponent, getConcatenatedViewport, getDataType, getDoubleBuffering, getExplode, getFillOutlineColor, getFillOutlineType, getFillPaint, getFillType, getGradient, getHREF, getLegend, getLineDashPattern, getMarkerDashPattern, getMarkerThickness, getMarkerType, getParent, getReference, getScreenAxis, getScreenSize, getScreenViewport, getSize, getSkipWeekends, getTextAngle, getTextColor, getTitle, getToolTip, getViewport, isBitSet, prePaint, removePickListener, setALT, setBarGap, setBarType, setBarWidth, setChartTitle, setClipData, setCustomTransform, setDataType, setDoubleBuffering, setExplode, setFillOutlineColor, setFillOutlineColor, setFillOutlineType, setFillPaint, setFillPaint, setFillPaint, setFillType, setGradient, setGradient, setGradient, setHREF, setImage, setLineDashPattern, setMarkerDashPattern, setMarkerThickness, setMarkerType, setReference, setScreenSize, setSize, setSkipWeekends, setTextAngle, setTextColor, setTextColor, setTitle, setTitle, setToolTip, setViewport, setViewport
 
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, getTextFormat, getTickLength, getTransform, getX, getY, isAncestorOf, isAttributeSet, isAttributeSetAtThisNode, parseColor, remove, setAttribute, setAutoscaleInput, setAutoscaleMinimumTimeInterval, setAutoscaleOutput, setDensity, setFillColor, setFillColor, setFont, setFontName, setFontSize, setFontStyle, setImage, setLabelType, setLightColor, setLightColor, setLineColor, setLineColor, setLineWidth, setLocale, setMarkerColor, setMarkerColor, setMarkerSize, setName, setNumber, setPaint, 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

Dendrogram

public Dendrogram(AxisXY axis,
                  ClusterHierarchical clusterHierarchical)
Constructs a vertical dendrogram chart using supplied ClusterHierarchical object.

Parameters:
axis - the AxisXY parent of this node
clusterHierarchical - a ClusterHierarchical object

Dendrogram

public Dendrogram(AxisXY axis,
                  ClusterHierarchical clusterHierarchical,
                  int type)
Constructs a dendrogram chart using supplied ClusterHierarchical object.

Parameters:
axis - the AxisXY parent of this node
clusterHierarchical - a ClusterHierarchical object
type - an int which specifies the DendrogramType. Legal values are DENDROGRAM_TYPE_VERTICAL or DENDROGRAM_TYPE_HORIZONTAL.
See Also:
ChartNode.DENDROGRAM_TYPE_VERTICAL, ChartNode.DENDROGRAM_TYPE_HORIZONTAL

Dendrogram

public Dendrogram(AxisXY axis,
                  double[] clusterLevel,
                  int[] leftSons,
                  int[] rightSons)
Constructs a vertical dendrogram chart using supplied data.

Parameters:
axis - the AxisXY parent of this node
clusterLevel - a double array which contains the levels at which the clusters are joined
leftSons - an int array which contains the left sons of each merged cluster
rightSons - an int array which contains the right sons of each merged cluster

Dendrogram

public Dendrogram(AxisXY axis,
                  double[] clusterLevel,
                  int[] leftSons,
                  int[] rightSons,
                  int type)
Constructs a dendrogram chart using supplied data.

Parameters:
axis - the AxisXY parent of this node
clusterLevel - a double array which contains the levels at which the clusters are joined
leftSons - an int array which contains the left sons of each merged cluster
rightSons - an int array which contains the right sons of each merged cluster
type - an int which specifies the DendrogramType. Legal values are DENDROGRAM_TYPE_VERTICAL or DENDROGRAM_TYPE_HORIZONTAL.
See Also:
ChartNode.DENDROGRAM_TYPE_VERTICAL, ChartNode.DENDROGRAM_TYPE_HORIZONTAL
Method Detail

dataRange

public void dataRange(double[] range)
Update the data range, range = {xmin,xmax,ymin,ymax}. The entries in range are updated to reflect the extent of the data in this node. The argument range is an input/output variable. Its value should be updated only if the data in this node is outside the range already in the array.

Overrides:
dataRange in class Data
Parameters:
range - a double array which contains the updated range, {xmin,xmax,ymin,ymax}

getCoordinates

public double[][] getCoordinates()
Convenience routine to get the "Coordinates" attribute.

Returns:
the double[][] array of coordinates.

getLeftSons

public int[] getLeftSons()
Convenience routine to get the "LeftSons" attribute.

Returns:
the int array of left sons.

getLevels

public double[] getLevels()
Convenience routine to get the "Levels" attribute.

Returns:
the double array of cluster levels.

getOrder

public int[] getOrder()
Convenience routine to get the "Order" attribute.

Returns:
an int array of the order of clusters as they appear in the dendrogram.

getRightSons

public int[] getRightSons()
Convenience routine to get the "RightSons" attribute.

Returns:
an int array of right sons.

paint

public void paint(Draw draw)
Paints this node and all of its children. This is normally called only by the paint method in this node's parent.

Overrides:
paint in class Data
Parameters:
draw - the Draw object to be painted

setCoordinates

public void setCoordinates(double[][] value)
Convenience routine to set the "Coordinates" attribute.

Parameters:
value - a double[][] array of coordinates.

setLabels

public void setLabels(String[] labels)
Sets up the axis labels for dendrogram plot. This turns off autoscaling on the axis and sets the Window attribute depending on the number of points being plotted.

Note that user-defined labels will be re-ordered to match the order of the clusters displayed in the plot.

Parameters:
labels - a String array with which to label the axis. The number of labels must equal the number of items.

setLeftSons

public void setLeftSons(int[] value)
Convenience routine to set the "LeftSons" attribute.

Parameters:
value - an int array of left sons.

setLevels

public void setLevels(double[] value)
Convenience routine to set the "Levels" attribute.

Parameters:
value - a double array of cluster levels.

setLineColor

public void setLineColor(Color[] colors)
Define colors for individual clusters. The color of the topmost level should be set using ChartNode.setLineColor(java.awt.Color color). This method will color N clusters, where N is the number of elements in the colors[] array.

Parameters:
colors - a Color array which contains each color to use for the subclusters.

setLineColor

public void setLineColor(String[] colors)
Define colors for individual clusters. The color of the topmost level should be set using ChartNode.setLineColor(String color). This method will color N clusters, where N is the number of elements in the colors[] array.

Parameters:
colors - a String array which contains each color to use for the subclusters.

setOrder

public void setOrder(int[] value)
Convenience routine to set the "Order" attribute.

Parameters:
value - an int array of the order of clusters as they appear in the dendrogram.

setRightSons

public void setRightSons(int[] value)
Convenience routine to set the "RightSons" attribute.

Parameters:
value - an int array of right sons.

JMSLTM Numerical Library 5.0.1

Copyright © 1970-2008 Visual Numerics, Inc.
Built July 8 2008.