ChartCat 1.2

li.netcat.chart.util
Class CartesianGraphPart

java.lang.Object
  extended byli.netcat.chart.util.AbstractPart
      extended byli.netcat.chart.util.GraphPart
          extended byli.netcat.chart.util.CartesianGraphPart
All Implemented Interfaces:
Part
Direct Known Subclasses:
AreaPart, BarPart, LinePart

public abstract class CartesianGraphPart
extends GraphPart

Abstract super class of all graph parts with a Cartesian coordinate system. The orientation of these parts can be set to HORIZONTAL or VERTICAL.

Author:
Arthur Marxer

Field Summary
static int HORIZONTAL
          Equal to ChartConstants.HORIZONTAL
static int VERTICAL
          Equal to ChartConstants.VERTICAL
 
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
CartesianGraphPart(int stackType, int stackStrategy, boolean centered, int orientation)
          Constructs a new CartesianGraphPart using the given parameters.
 
Method Summary
 float getHeight()
          Returns the height of the underlying coordinate system.
 ScaleModel getHorizontalScaleModel()
          Returns the scale model that defines the axis in X direction.
 int getOrientation()
          Returns the orientation of this CartesianGraphPart.
 ValueLocation getValueLocation(int rowIndex, int columnIndex)
          Abstract function that calculates a ValueLocation for a given cell.
 ScaleModel getVerticalScaleModel()
          Returns the scale model that defines the axis in Y direction.
 float getWidth()
          Returns the width of the underlying coordinate system.
 void setHorizontalScaleModel(ScaleModel horizontalScaleModel)
          Sets the scale model that defines the axis in X direction.
 void setOrientation(int orientation)
          Sets the logical orientation of this CartesianGraphPart.
 void setSize(float width, float height)
          Sets the size of the of the underlying coordinate system.
 void setVerticalScaleModel(ScaleModel verticalScaleModel)
          Sets the scale model that defines the axis in Y direction.
 
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, invalidate, 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

VERTICAL

public static final int VERTICAL
Equal to ChartConstants.VERTICAL

See Also:
Constant Field Values

HORIZONTAL

public static final int HORIZONTAL
Equal to ChartConstants.HORIZONTAL

See Also:
Constant Field Values
Constructor Detail

CartesianGraphPart

public CartesianGraphPart(int stackType,
                          int stackStrategy,
                          boolean centered,
                          int orientation)
Constructs a new CartesianGraphPart 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 HORIZONTAL or VERTICAL.
Method Detail

getOrientation

public int getOrientation()
Returns the orientation of this CartesianGraphPart.

Returns:
Either HORIZONTAL or VERTICAL.

setOrientation

public void setOrientation(int orientation)
Sets the logical orientation of this CartesianGraphPart. The size of the underlying coordinate system is retained.

Parameters:
orientation - Specify either HORIZONTAL or VERTICAL.

getHorizontalScaleModel

public ScaleModel getHorizontalScaleModel()
Returns the scale model that defines the axis in X direction.

Returns:
The horizontal scale model, it is never null and depends on the orientation.

setHorizontalScaleModel

public void setHorizontalScaleModel(ScaleModel horizontalScaleModel)
Sets the scale model that defines the axis in X direction.

Parameters:
horizontalScaleModel - The horizontal scale model, not null. If the orientation is vertical, this argument must be an instance of NumericScaleModel.

getVerticalScaleModel

public ScaleModel getVerticalScaleModel()
Returns the scale model that defines the axis in Y direction.

Returns:
The vertical scale model, it is never null and depends on the orientation.

setVerticalScaleModel

public void setVerticalScaleModel(ScaleModel verticalScaleModel)
Sets the scale model that defines the axis in Y direction.

Parameters:
verticalScaleModel - The vertical scale model, not null. If the orientation is horizontal, this argument must be an instance of NumericScaleModel.

getWidth

public float getWidth()
Returns the width of the underlying coordinate system.


getHeight

public float getHeight()
Returns the height of the underlying coordinate system.


setSize

public void setSize(float width,
                    float height)
Sets the size of the of the underlying coordinate system.

Parameters:
width - The new width.
height - The new height.

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.

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