lt.monarch.chart.chart3D.series
Class Line3DStrategy

java.lang.Object
  extended by lt.monarch.chart.chart3D.series.AbstractLine3DStrategy
      extended by lt.monarch.chart.chart3D.series.Line3DStrategy
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Spline3DStrategy, SteppedLine3DStrategy

public class Line3DStrategy
extends AbstractLine3DStrategy

Direct line series strategy.

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
protected  Polygon3D[] bottomPolygon
          bottom line polygon
protected  double[] firstX
          First x coordinates
protected  boolean isSortedSeries
          If true series is sorted
protected  double[] lastX
          Last x coordinates
protected  double lineWidth
          Line depth value
protected  Polygon3D[] polygon
          Line series polygon array, new polygon if null values are present
protected  PseudoArrayDataModel3D pseudoModel
          Data pseudo model
 
Fields inherited from class lt.monarch.chart.chart3D.series.AbstractLine3DStrategy
baseValue, dirty, isConnected, mapper, metaModel, minMaxValues, model, paintMode, planePoint, projector, showNullValues, style, tempPoint, xMapper, yMapper, zMapper, zoomMultiplier
 
Constructor Summary
Constructor and Description
Line3DStrategy()
          Line3D strategy constructor
 
Method Summary
Modifier and Type Method and Description
protected  void appendSeriesRectangles(Line3DSeries series, Polygon3D polygon, Area areaFull)
           
protected  int buildSeriesPolygons(Polygon3D[] linePolygon, double[] firstX, double[] lastX, Polygon3D[] bottomPolygon, boolean drawNulls)
          Builds polygons that are used to render series line and toFill it's area if toFill color is set.
 void dispose()
          Disposes the object
 void draw(AbstractGraphics g, Projector projector, PlaneMapper3D mapper, HotSpotMap hotMap, boolean showNullValues, Style style, java.lang.Object baseValue, Line3DSeries series)
          Draws the series in the chart area.
protected  void drawLine(AbstractGraphics g, Line3DSeries series, HotSpotMap hotMap)
          Paints the connected series line in the specified Graphics context.
protected  int formNewPolygon(Polygon3D[] polygon, double[] firstX, double[] lastX, Polygon3D[] bottomPolygon, int pi)
          Forms a new polygon if previous polygon contains at least one point
protected  double getDataValueMappingHeight(java.lang.Object value, int index)
          Gets value of data height
 double getLineWidth()
           
protected  Point3D getPointPosition(int markerIndex)
          Computes the marker's specified by the index position.
protected  void initDrawing()
          Initializes polygon arrays and other arrays Also determines line direction
protected  boolean isDataInverted()
          Checks if the data of the line is inverted
protected  boolean isStacked()
          Checks if the data model is stacked
protected  Polygon3D projectPolygon(Polygon3D polygon)
           
 void setLineWidth(double width)
           
protected  boolean showNullPoints()
          Checks and returns if user has set nullLineColor or nullFillColor objects.
 
Methods inherited from class lt.monarch.chart.chart3D.series.AbstractLine3DStrategy
finalize, getMinMaxValues, getX, getY, getZ, projectPoint
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isSortedSeries

protected boolean isSortedSeries
If true series is sorted


firstX

protected double[] firstX
First x coordinates


lastX

protected double[] lastX
Last x coordinates


polygon

protected Polygon3D[] polygon
Line series polygon array, new polygon if null values are present


bottomPolygon

protected Polygon3D[] bottomPolygon
bottom line polygon


pseudoModel

protected PseudoArrayDataModel3D pseudoModel
Data pseudo model


lineWidth

protected double lineWidth
Line depth value

Constructor Detail

Line3DStrategy

public Line3DStrategy()
Line3D strategy constructor

Method Detail

dispose

public void dispose()
Description copied from class: AbstractLine3DStrategy
Disposes the object

Specified by:
dispose in class AbstractLine3DStrategy

isDataInverted

protected boolean isDataInverted()
Checks if the data of the line is inverted

Returns:
True if inverted

draw

public void draw(AbstractGraphics g,
                 Projector projector,
                 PlaneMapper3D mapper,
                 HotSpotMap hotMap,
                 boolean showNullValues,
                 Style style,
                 java.lang.Object baseValue,
                 Line3DSeries series)
Description copied from class: AbstractLine3DStrategy
Draws the series in the chart area.

Overrides:
draw in class AbstractLine3DStrategy
Parameters:
g - graphics context
projector - projector instance
mapper - plane mapper
hotMap - hot spot map
showNullValues - boolean value indicating whether to show the null values
style - style object
baseValue - base value
series - scatter series instance

drawLine

protected void drawLine(AbstractGraphics g,
                        Line3DSeries series,
                        HotSpotMap hotMap)
Paints the connected series line in the specified Graphics context.

Parameters:
g - the Graphics context in which to paint the series line. NOTE: setShowNullValues(boolean) works a little different here. When set to true, the line is broken and started from the next non-null point value. When set to false, the null values are simply ignored: the line connects all non-null value points.
series - lt.monarch.chart.chart3D.series.Line3DSeries
hotMap - lt.monarch.chart.engine.HotSpotMap
See Also:
AbstractChartSeries.setShowNullValues(boolean)

initDrawing

protected void initDrawing()
Initializes polygon arrays and other arrays Also determines line direction


buildSeriesPolygons

protected int buildSeriesPolygons(Polygon3D[] linePolygon,
                                  double[] firstX,
                                  double[] lastX,
                                  Polygon3D[] bottomPolygon,
                                  boolean drawNulls)
Builds polygons that are used to render series line and toFill it's area if toFill color is set.

Parameters:
linePolygon - array of polygons that forms series polyline
firstX - array of series segments start positions [0;1]
lastX - array of series segments end positions [0;1]
bottomPolygon - array of polygons that forms bottom polyline of series area
drawNulls - declares when to calculate values and build polygons for null values in data model.
Returns:
number of polygons that forms series line

getPointPosition

protected Point3D getPointPosition(int markerIndex)
Computes the marker's specified by the index position.

Parameters:
markerIndex - index of the marker to compute position for

projectPolygon

protected Polygon3D projectPolygon(Polygon3D polygon)

formNewPolygon

protected int formNewPolygon(Polygon3D[] polygon,
                             double[] firstX,
                             double[] lastX,
                             Polygon3D[] bottomPolygon,
                             int pi)
Forms a new polygon if previous polygon contains at least one point

Parameters:
polygon - Line polygon array
firstX - First point array
lastX - Last point array
bottomPolygon - Bottom line polygon array
pi - Count of the polygons currently in polygon array
Returns:
Returns count of current line polygon

getDataValueMappingHeight

protected double getDataValueMappingHeight(java.lang.Object value,
                                           int index)
Gets value of data height

Parameters:
value - value of Object
index - number in array of object
Returns:
double value of data height

isStacked

protected boolean isStacked()
Checks if the data model is stacked

Returns:
true if data model is stacked on something

showNullPoints

protected boolean showNullPoints()
Checks and returns if user has set nullLineColor or nullFillColor objects. This means that user would like to see the probable values instead of nulls (if it is possible).

Returns:
boolean showing that null values should be drawn.

setLineWidth

public void setLineWidth(double width)

getLineWidth

public double getLineWidth()

appendSeriesRectangles

protected void appendSeriesRectangles(Line3DSeries series,
                                      Polygon3D polygon,
                                      Area areaFull)