ChartCat 1.2

li.netcat.chart.util
Class RingPart

java.lang.Object
  extended byli.netcat.chart.util.AbstractPart
      extended byli.netcat.chart.util.GraphPart
          extended byli.netcat.chart.util.PolarGraphPart
              extended byli.netcat.chart.util.RingPart
All Implemented Interfaces:
Part

public class RingPart
extends PolarGraphPart

Represents a round graph that looks for example like this:

It can be used to paint pies and doughnuts. Each data segment can be empahsized by moving it in the radial direction.

Author:
Arthur Marxer

Field Summary
 
Fields inherited from class li.netcat.chart.util.PolarGraphPart
NET, RING
 
Fields inherited from class li.netcat.chart.util.GraphPart
STACK_STRATEGY_APPEND, STACK_STRATEGY_GROUP, STACK_TYPE_NOT_STACKED, STACK_TYPE_STACKED, STACK_TYPE_STACKED_PERCENT
 
Fields inherited from class li.netcat.chart.util.AbstractPart
BACKGROUND, FOREGROUND, PERSPECTIVE
 
Constructor Summary
RingPart(ChartModel model)
          Constructs a new RingPart using the given ChartModel and the type STACK_TYPE_STACKED_PERCENT.
RingPart(ChartModel model, int stackType)
          Constructs a new RingPart using the given ChartModel and the given type.
 
Method Summary
 void clearRadialMove()
          Clears all radial move entries.
 float getFlatness()
          Returns the maximum distance that the line segments used to approximate the curved segments are allowed.
 Layout getLayout(java.awt.Graphics g)
          Returns an instance of a layout that is able to report the bounds of this part and is able to paint this part.
 float getRadialMove(int rowIndex, int columnIndex)
          Returns the radial movement of a data element.
 ValueLocation getValueLocation(int rowIndex, int columnIndex)
          Abstract function that calculates a ValueLocation for a given cell.
 void setFlatness(float flatness)
          Sets the maximum distance that the line segments used to approximate the curved segments are allowed.
 void setRadialMove(int rowIndex, int columnIndex, float move)
          Sets a radial movement of a data element.
 
Methods inherited from class li.netcat.chart.util.PolarGraphPart
getCenterX, getCenterY, getConverter, getInnerRadius, getOrientation, getRadialScaleModel, getRadius, getStretch, getTangentialScaleModel, getThickness, invalidate, setRadialScaleModel, setSize, setStretch, setTangentialScaleModel
 
Methods inherited from class li.netcat.chart.util.GraphPart
getChartModel, getDiscreetLength, getDiscreetScaleModel, getGraphLook, getLegendModel, getNumericLength, getNumericScaleModel, getStackModel, setChartModel, setDiscreetLength, setDiscreetScaleModel, setGraphLook, setLegendModel, setNumericLength, setNumericScaleModel, setStackModel
 
Methods inherited from class li.netcat.chart.util.AbstractPart
getChart, getPerspective, setChart, setPerspective
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RingPart

public RingPart(ChartModel model)
Constructs a new RingPart using the given ChartModel and the type STACK_TYPE_STACKED_PERCENT.

Parameters:
model - The ChartModel that provides the data. null will be replaced by an empty ChartModel.

RingPart

public RingPart(ChartModel model,
                int stackType)
Constructs a new RingPart using the given ChartModel and the given type.

Parameters:
model - The ChartModel that provides the data. null will be replaced by an empty ChartModel.
stackType - The type of the resulting graph. Specify one of STACK_TYPE_NOT_STACKED, STACK_TYPE_STACKED or STACK_TYPE_STACKED_PERCENT. Note that values other than STACK_TYPE_STACKED_PERCENT are not usual.
Method Detail

getFlatness

public float getFlatness()
Returns the maximum distance that the line segments used to approximate the curved segments are allowed.

Returns:
The maximum distance that the line segments used to approximate the curved segments are allowed.

setFlatness

public void setFlatness(float flatness)
Sets the maximum distance that the line segments used to approximate the curved segments are allowed.

Parameters:
flatness - The maximum distance that the line segments used to approximate the curved segments are allowed. It must be >= 0.001f.

clearRadialMove

public void clearRadialMove()
Clears all radial move entries.


setRadialMove

public void setRadialMove(int rowIndex,
                          int columnIndex,
                          float move)
Sets a radial movement of a data element.

Parameters:
rowIndex - The row index of the data element in the model.
columnIndex - The column index of the data element in the model.
move - The amount of the movement in pixel. Negative values move the element towards the center.

getRadialMove

public float getRadialMove(int rowIndex,
                           int columnIndex)
Returns the radial movement of a data element.

Parameters:
rowIndex - The row index of the data element in the model.
columnIndex - The column index of the data element in the model.

getValueLocation

public ValueLocation getValueLocation(int rowIndex,
                                      int columnIndex)
Description copied from class: GraphPart
Abstract function that calculates a ValueLocation for a given cell.

Overrides:
getValueLocation in class PolarGraphPart

getLayout

public Layout getLayout(java.awt.Graphics g)
Description copied from interface: Part
Returns an instance of a layout that is able to report the bounds of this part and is able to paint this part.

Parameters:
g - The relevant graphics object.
Returns:
A layout that is able to report the bounds of this part and is able to paint this part. This method may also return null.

ChartCat 1.2

Copyright © 2003 - 2005 NetCat Inc.. All rights reserved. Feedback

Chart,Charting,Charts,Java,Java Chart,Java Charting,Java Charts,Chart Java,Charts Java,3D,3D Chart,3Dchart,Graph,Graphs,Chart Graph,Java Graph,Diagram,Diagrams,Java Diagram,Java Diagrams,Curve,Curves,Bar Chart,Pie Chart,Line Chart,Area Chart,Bar Graph,Pie Graph,Line Graph,Java Diagram,Chart Diagram,Package,Library,Chart Library,Chart Engine,Chart Package,Graph Package,Paint,Support,Graphic,Graphics,Print, Chart,Charting,Charts,Java,Java Chart,Java Charting,Java Charts,Chart Java,Charts Java,3D,3D Chart,3Dchart,Graph,Graphs,Chart Graph,Java Graph,Diagram,Diagrams,Java Diagram,Java Diagrams,Curve,Curves,Bar Chart,Pie Chart,Line Chart,Area Chart,Bar Graph,Pie Graph,Line Graph,Java Diagram,Chart Diagram,Package,Library,Chart Library,Chart Engine,Chart Package,Graph Package,Paint,Support,Graphic,Graphics,Print, Chart,Charting,Charts,Java,Java Chart,Java Charting,Java Charts,Chart Java,Charts Java,3D,3D Chart,3Dchart,Graph,Graphs,Chart Graph,Java Graph,Diagram,Diagrams,Java Diagram,Java Diagrams,Curve,Curves,Bar Chart,Pie Chart,Line Chart,Area Chart,Bar Graph,Pie Graph,Line Graph,Java Diagram,Chart Diagram,Package,Library,Chart Library,Chart Engine,Chart Package,Graph Package,Paint,Support,Graphic,Graphics,Print