JIDE 3.5.15

com.jidesoft.chart.render
Class DefaultLineRenderer

java.lang.Object
  extended by com.jidesoft.chart.render.AbstractLineRenderer
      extended by com.jidesoft.chart.render.DefaultLineRenderer
All Implemented Interfaces:
LineRenderer

public class DefaultLineRenderer
extends AbstractLineRenderer

A renderer for drawing lines on a chart. Consecutive points in the ChartModel are joined by straight line segments.


Field Summary
static String PROPERTY_CHART
           
static String PROPERTY_USE_DRAW_POLYLINE
           
 
Constructor Summary
DefaultLineRenderer(Chart chart)
          Creates a DefaultLineRenderer using the supplied chart object as the chart object onto which lines should be drawn.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a property change listener to this object
 Chart getChart()
          Returns the chart associated with this renderer
 boolean getUseDrawPolyline()
          Returns whether we are using the drawPolyLine() method for calls on the Graphics context to draw lines
 void removePropertyChangeListener(PropertyChangeListener listener)
          Remove the supplied property change listener from this object
 Shape renderLine(Graphics g, ChartModel m, int[] xPoints, int[] yPoints, ChartStyle style)
          Render lines using the supplied arrays of x and y pixel coordinates onto the supplied Graphics context.
 void setChart(Chart chart)
          Sets the chart onto which the lines should be drawn
 void setUseDrawPolyline(boolean useDrawPolyline)
          Specify whether to use drawPolyline() to paint multiple line segments.
 
Methods inherited from class com.jidesoft.chart.render.AbstractLineRenderer
calculateXHorizontalExtent, calculateYVerticalExtent, createLineFillPaint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_CHART

public static final String PROPERTY_CHART
See Also:
Constant Field Values

PROPERTY_USE_DRAW_POLYLINE

public static final String PROPERTY_USE_DRAW_POLYLINE
See Also:
Constant Field Values
Constructor Detail

DefaultLineRenderer

public DefaultLineRenderer(Chart chart)
Creates a DefaultLineRenderer using the supplied chart object as the chart object onto which lines should be drawn.

Parameters:
chart - the chart object
Method Detail

getChart

public Chart getChart()
Returns the chart associated with this renderer

Returns:
the chart object associated with this renderer

setChart

public void setChart(Chart chart)
Sets the chart onto which the lines should be drawn

Parameters:
chart - the Chart object

getUseDrawPolyline

public boolean getUseDrawPolyline()
Returns whether we are using the drawPolyLine() method for calls on the Graphics context to draw lines

Returns:
whether we are using drawPolyline for calls on the Graphics context to draw lines

setUseDrawPolyline

public void setUseDrawPolyline(boolean useDrawPolyline)
Specify whether to use drawPolyline() to paint multiple line segments. The choice of this parameter can affect performance, particularly for larger data sets.

Parameters:
useDrawPolyline - boolean value to indicate whether to use drawPolyline on the underlying platform. If set to false (the default), the chart package will iterate through the line segments to be drawn.

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a property change listener to this object

Parameters:
listener - a property change listener

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Remove the supplied property change listener from this object

Parameters:
listener - the property change listener to remove

renderLine

public Shape renderLine(Graphics g,
                        ChartModel m,
                        int[] xPoints,
                        int[] yPoints,
                        ChartStyle style)
Render lines using the supplied arrays of x and y pixel coordinates onto the supplied Graphics context.

Parameters:
g - the Graphics context
m - the ChartModel from which the points originated
xPoints - an array of x coordinates
yPoints - an array of y coordinates
style - the suggested style for rendering (a custom renderer may choose to ignore this)

JIDE 3.5.15