ChartCat 1.2

li.netcat.chart.util
Class PolarGraphPart

java.lang.Object
  extended byli.netcat.chart.util.AbstractPart
      extended byli.netcat.chart.util.GraphPart
          extended byli.netcat.chart.util.PolarGraphPart
All Implemented Interfaces:
Part
Direct Known Subclasses:
RadarLinePart, RadarPart, RingPart

public abstract class PolarGraphPart
extends GraphPart

Abstract super class of all graph parts with a polar coordinate system. The orientation of these parts can be NET or RING and can not be changed after the construction.

Polar graphs might have a "hole" in the center like a doughnut. The (outer) radius calculates as follows: (outer)radius = inner radius + thickness.

Author:
Arthur Marxer

Field Summary
static int NET
          Equal to ChartConstants.NET
static int RING
          Equal to ChartConstants.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
PolarGraphPart(int stackType, int stackStrategy, boolean centered, int orientation)
          Constructs a new PolarGraphPart using the given parameters.
 
Method Summary
 float getCenterX()
          Returns the x-coordinate of the center of this polar graph.
 float getCenterY()
          Returns the y-coordinate of the center of this polar graph.
 PolarConverter getConverter()
          Returns an instance of a polar converter that can be used to transform coordinates from a Cartesian to a polar system.
 float getInnerRadius()
          Returns the radius of the "hole" in the center of this polar graph.
 int getOrientation()
          Returns the orientation of this polar graph.
 ScaleModel getRadialScaleModel()
          Returns the radial scale model of this polar graph.
 float getRadius()
          Returns the outer radius of this graph.
 float getStretch()
          Returns the strech value in x-direction.
 ScaleModel getTangentialScaleModel()
          Returns the tangential scale model of this polar graph.
 float getThickness()
          Returns the difference of outer and inner radius.
 ValueLocation getValueLocation(int rowIndex, int columnIndex)
          Abstract function that calculates a ValueLocation for a given cell.
 void invalidate()
          Calls invalidate() on the chart context if it's not null.
 void setRadialScaleModel(ScaleModel model)
          Sets the radial scale model of this polar graph.
 void setSize(float thickness, float innerRadius)
          Sets the size of this polar graph.
 void setStretch(float stretch)
          Sets the strech value in x-direction.
 void setTangentialScaleModel(ScaleModel model)
          Sets the tangential scale model of this polar graph.
 
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
 
Methods inherited from interface li.netcat.chart.Part
getLayout
 

Field Detail

NET

public static final int NET
Equal to ChartConstants.NET

See Also:
Constant Field Values

RING

public static final int RING
Equal to ChartConstants.RING

See Also:
Constant Field Values
Constructor Detail

PolarGraphPart

public PolarGraphPart(int stackType,
                      int stackStrategy,
                      boolean centered,
                      int orientation)
Constructs a new PolarGraphPart using the given parameters.

Parameters:
stackType - The type of the resulting graph. Specify one of STACK_TYPE_NOT_STACKED, STACK_TYPE_STACKED or STACK_TYPE_STACKED_PERCENT.
stackStrategy - The strategy that defines how to stack values. Especially the handling of negative values might be different in different graphs. Specify one of STACK_STRATEGY_*.
centered - Specify true for a centered row scale model. See ScaleModel.isCentered() for details.
orientation - The orientation of the resulting graph. Specify NET or RING.
Method Detail

getOrientation

public int getOrientation()
Returns the orientation of this polar graph.

Returns:
Either NET or RING.

getTangentialScaleModel

public ScaleModel getTangentialScaleModel()
Returns the tangential scale model of this polar graph.

Returns:
The tangential scale model of this polar graph, never null.

setTangentialScaleModel

public void setTangentialScaleModel(ScaleModel model)
Sets the tangential scale model of this polar graph.

Parameters:
model - The tangential scale model of this polar graph, not null. If the orientation is RING, this parameter must be of type NumericScaleModel.

getRadialScaleModel

public ScaleModel getRadialScaleModel()
Returns the radial scale model of this polar graph.

Returns:
The radial scale model of this polar graph, never null.

setRadialScaleModel

public void setRadialScaleModel(ScaleModel model)
Sets the radial scale model of this polar graph.

Parameters:
model - The radial scale model of this polar graph, not null. If the orientation is NET, this parameter must be of type NumericScaleModel.

getThickness

public float getThickness()
Returns the difference of outer and inner radius.

Returns:
The thickness of this polar graph.

getInnerRadius

public float getInnerRadius()
Returns the radius of the "hole" in the center of this polar graph.

Returns:
The inner radius.

setSize

public void setSize(float thickness,
                    float innerRadius)
Sets the size of this polar graph.

Parameters:
thickness - The thickness of the graph, that is the difference of outer and inner radius.
innerRadius - The inner radius of this graph, must be >= 0.0f.

getRadius

public float getRadius()
Returns the outer radius of this graph.

Returns:
The outer radius of this graph.

getCenterX

public float getCenterX()
Returns the x-coordinate of the center of this polar graph.

Returns:
The x-coordinate of the center of this polar graph.

getCenterY

public float getCenterY()
Returns the y-coordinate of the center of this polar graph.

Returns:
The y-coordinate of the center of this polar graph.

getConverter

public PolarConverter getConverter()
Returns an instance of a polar converter that can be used to transform coordinates from a Cartesian to a polar system.

Returns:
An instance of a configured polar converter.

getStretch

public float getStretch()
Returns the strech value in x-direction. The default is 1.0f.

Returns:
The strech value in x-direction.

setStretch

public void setStretch(float stretch)
Sets the strech value in x-direction. The default is 1.0f.

Parameters:
stretch - The stretch value in x-direction.

getValueLocation

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

Specified by:
getValueLocation in class GraphPart
Parameters:
rowIndex - The index of the row. It must lie in a valid range of the current stack model.
columnIndex - The index of the column. It must lie in a valid range of the current stack model.
Returns:
The ValueLocation for the given cell or null if not available.

invalidate

public void invalidate()
Description copied from class: AbstractPart
Calls invalidate() on the chart context if it's not null.

Overrides:
invalidate in class AbstractPart

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