|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.davisor.graphics.chart.ChartFactory
com.davisor.graphics.chart.AxisFactory
com.davisor.graphics.chart.ShapeFactory
ShapeFactory is a base class for chart producers that can make shape charts out of one- or multidimensional data. Shape charts support isometric 3D look and a wealth of chart attributes.
A single data series may be rendered as point symbols, as a continous stroked line, or both. Series may also be grouped, and the groups rendered with lines the connect the corresponding points in grouped series.
When line paint is set, the areas outlined by chart lines are filled with that paint. If the start and end points of a line are the same, the line defines a closed area, which is then filled. If the start end end points do not meet, the area is closed by the horizontal axis and two vertical lines that extend from the start and end points to it.
size
channel values. If such channel is present, the points associated
with the largest size values among all size
channels will have the biggest symbols, and the ones with the
smalles values will have the smallest symbols. The absolute values
of the size channel elements or shape sizes do not
matter, only their relative magnitudes against each other do.
The visible sizes of the largest and smallest shapes are controlled
with plot area
maxSize and
minSize attributes, respectively. maxSize tells
of how many tenths of the whole plot area size the maximum symbol
size will approximately be. The measurement is not exact nor
linear, but the bigger the value, the bigger the maximum symbols
will appear.
The ratio between plot area attributes minSize and
maxSize sets the approximate ratio between the visible
size of the smallest and largest scaled shape. minSize
may also be larger than maxSize, making the values
representing smaller values to appear bigger than those
representing larger values.
ShapeFactory supports them all:
Two settings control what strategy is used: plot area enclose attribute, and the presense or absense of magnitude visualization data:
| Enclose | Don't enclose | |
|---|---|---|
size channels present |
add axis steps | increase label margins |
size channels absent |
clip against plot area edge | increase label margins |
The details of how and if a top-level data channel is broken up into sub-channels is left for the sub-classes to implement. If sub-channels are present, the shape factory will render them by joining the corresponding sub-channel points within each group. The render attributes for these cross-channel lines are taken from plot area render attributes.
The ShapeFactory subclasses implement details about how exactly the charts are rendered. The subclasses do this by implementing the abstract interface that this class and its superclass define. In particular, the following suble choises affect how exactly shape factory behaves:
sumCumulativeValues() isCumulative(int, boolean[]))
absCumulativeValues(boolean) and isAbsolute(int, boolean[], com.davisor.graphics.chart.ChartData, com.davisor.graphics.chart.ChartAttributes, com.davisor.graphics.chart.PlotRenderAttributes, boolean))
zeroCumulativeValues() and isCumulative(int, boolean[]))
isCumulative(int, boolean[]))
getSubChannels(Type))
getSubChannel(DataValue,int))
AxisFactory.resolveLabels(com.davisor.graphics.chart.ChartAxes, com.davisor.graphics.chart.AxisFactory.AxisContext),
resolveLimits(com.davisor.graphics.chart.ChartDataSummary),
AxisFactory.createChart(com.davisor.graphics.chart.ChartFactory.ChartContext, com.davisor.graphics.chart.ChartFactory.ChartMetrics, com.davisor.graphics.chart.ChartAttributes, com.davisor.graphics.chart.Chart)| Nested Class Summary | |
class |
ShapeFactory.ShapeContext
ShapeContext implements a shape factory specific axis context. |
| Nested classes inherited from class com.davisor.graphics.chart.AxisFactory |
AxisFactory.AxisContext, AxisFactory.AxisMetrics |
| Nested classes inherited from class com.davisor.graphics.chart.ChartFactory |
ChartFactory.ChartContext, ChartFactory.ChartMetrics |
| Field Summary | |
protected static int |
BELOW
|
protected static int |
CENTER
|
protected static int |
LEFT
|
protected static int |
OVER
|
protected static int |
RIGHT
|
| Fields inherited from class com.davisor.graphics.chart.AxisFactory |
DEFAULTLABELTYPE, FLIPX, FLIPY, MAJORMARGIN, MINORMARGIN, MINSIZE |
| Fields inherited from class com.davisor.graphics.chart.ChartFactory |
ALL, BRIGHT, CHANNEL, COS, DARK, DOTSEQUENCE, DOTSTROKE, DOTSTROKEWIDTH, DUMPFACTORYNAME, ENCODERINFO, FONT, FRC, HAS_3D, I, LABEL, LABELFIELDNAMES, LABELFIELDS, MIME_DEFAULT, NONE, NORMAL, NULLSTROKE, PERCENT, PI2, SHAPE, SIN, STROKE, STROKEWIDTH, TIC, VALUE, X, Y, Z |
| Fields inherited from interface com.davisor.core.MIMETypes |
FILETYPE_BMP, FILETYPE_CSS, FILETYPE_DOC, FILETYPE_ECMA, FILETYPE_GIF, FILETYPE_HTML, FILETYPE_HTML_CSS, FILETYPE_INDEX, FILETYPE_INDEX_DOC, FILETYPE_INDEX_HTML, FILETYPE_INDEX_HTML_CSS, FILETYPE_INDEX_PDF, FILETYPE_INDEX_PPT, FILETYPE_INDEX_SVG, FILETYPE_INDEX_XHTML, FILETYPE_INDEX_XLS, FILETYPE_INDEX_XMSE, FILETYPE_INDEX_XMSP, FILETYPE_INDEX_XMSW, FILETYPE_INDEX_XSLFO, FILETYPE_JPEG, FILETYPE_PDF, FILETYPE_PNG, FILETYPE_PNG_WBMP, FILETYPE_PPM, FILETYPE_PPT, FILETYPE_SVG, FILETYPE_TEXT, FILETYPE_WBMP, FILETYPE_XHTML, FILETYPE_XLS, FILETYPE_XML, FILETYPE_XMSE, FILETYPE_XMSP, FILETYPE_XMSW, FILETYPE_XSLFO, FILETYPE_XSLFO_CSS, MIME_BMP, MIME_CSS, MIME_DOC, MIME_ECMA, MIME_GIF, MIME_HTML, MIME_HTML_CSS, MIME_INDEX, MIME_INDEX_DOC, MIME_INDEX_HTML, MIME_INDEX_HTML_CSS, MIME_INDEX_PDF, MIME_INDEX_PPT, MIME_INDEX_SVG, MIME_INDEX_XHTML, MIME_INDEX_XLS, MIME_INDEX_XMSE, MIME_INDEX_XMSP, MIME_INDEX_XMSW, MIME_INDEX_XSLFO, MIME_JPEG, MIME_OTHER, MIME_PDF, MIME_PNG, MIME_PNG_WBMP, MIME_PPM, MIME_PPT, MIME_SVG, MIME_TEXT, MIME_WBMP, MIME_XHTML, MIME_XLS, MIME_XML, MIME_XMSE, MIME_XMSP, MIME_XMSW, MIME_XSLFO, MIME_XSLFO_CSS |
| Constructor Summary | |
ShapeFactory()
Default constructor. |
|
ShapeFactory(ShapeFactory factory)
Copy constructor. |
|
| Method Summary | |
protected abstract boolean |
absCumulativeValues(boolean isometric)
Tests if the visualization strategy implemented by this shape factory instance requires that only absolute values should be used for cumulative data. |
protected AxisFactory.AxisContext |
createContext(ChartData data,
ChartAttributes attr,
ChartAxes axes,
short index)
Creates a shape chart. |
protected AxisFactory.AxisContext |
createContext(ChartData data,
ChartAttributes attr,
PlotRenderAttributes plot,
ChartDataSummary summary,
java.awt.Font[] labelFont,
java.awt.Font[] titleFont,
Type[] colorChannelTypes,
int lastPlotColorChannel,
Type[] paintChannelTypes,
int lastPlotPaintChannel,
Type urlChannelType,
EnumType labelType,
int[] valueChannels,
int[] colorChannels,
int[] paintChannels,
int[] urlChannels,
int[] altChannels,
int[] positionChannels,
float[] labelOffsets,
float[] markerOffsets,
float[][] titleSizes,
boolean isometric,
short index)
Creates a new shape factory specific axis context. |
protected AxisFactory.AxisContext |
createContext(ChartData data,
ChartAttributes attr,
PlotRenderAttributes plot,
ChartDataSummary summary,
java.awt.Font[] labelFont,
java.awt.Font[] titleFont,
Type colorChannelType,
Type paintChannelType,
Type urlChannelType,
EnumType labelType,
int[] valueChannels,
int[] colorChannels,
int[] paintChannels,
int[] urlChannels,
int[] altChannels,
int[] positionChannels,
float[] labelOffsets,
float[] markerOffsets,
float[][] titleSizes,
boolean isometric,
short index)
Deprecated. |
protected AxisFactory.AxisMetrics |
createMetrics(ChartAxes axes,
AxisFactory.AxisContext context,
boolean scaleMargins,
boolean conserveSpace)
Resolve final axis chart image and image component sizes. |
protected Chart |
drawChart(AxisFactory.AxisContext context,
AxisFactory.AxisMetrics metrics,
ChartAxes axes,
boolean fillGrid,
boolean drawAxes,
boolean drawLabel,
boolean drawGrid,
Chart chart)
Renders a shape chart. |
protected void |
drawGroup(java.awt.Graphics2D g,
int p,
boolean side,
java.awt.Paint color,
java.awt.Paint paint,
java.awt.Stroke stroke,
float[][] x,
float[][] y,
float x0,
float y0,
float dx,
float dy)
|
protected void |
drawLine(java.awt.Graphics2D g,
boolean side,
boolean skipMissingPoints,
java.awt.Paint pen,
java.awt.Paint[] color,
java.awt.Paint[] paint,
java.awt.Stroke stroke,
float[] x,
float[] y,
float[] prevX,
float[] prevY,
float baseLevel,
float x0,
float y0,
float dx,
float dy)
Draws an filled front- or sideface around the given points. |
protected void |
drawSegments(java.awt.Graphics2D g,
boolean side,
java.awt.Paint[] color,
java.awt.Paint[] paint,
java.awt.Stroke stroke,
int lineSegments,
java.awt.Paint linePaint,
java.awt.Shape drawPath,
java.awt.Shape fillPath,
float dx,
float dy)
|
protected java.awt.geom.Rectangle2D[] |
drawShapes(java.awt.Graphics2D g,
java.awt.Paint[] color,
java.awt.Paint[] paint,
java.awt.Stroke[] stroke,
java.awt.Shape[] shape,
float[] x,
float[] y,
float s,
float x0,
float y0,
float dx,
float dy)
Draws a shape at the given points. |
protected float[] |
drawSmoothedLine(java.awt.Graphics2D g,
boolean side,
boolean skipMissingPoints,
java.awt.Paint pen,
java.awt.Paint[] color,
java.awt.Paint[] paint,
java.awt.Stroke stroke,
float[] x,
float[] y,
float[] prevX,
float[] prevY,
float baseLevel,
float x0,
float y0,
float dx,
float dy,
int lineSmoothness,
float[] oldControlPoints)
Method for drawing smoothed lines. |
protected abstract void |
drawValues(java.awt.Graphics2D g,
java.awt.Paint color,
java.awt.Paint paint,
java.awt.Font font,
java.lang.String[] value,
AxisFactory.AxisMetrics info,
int alignment,
java.awt.geom.Rectangle2D[] shapeBounds,
boolean multiSeriesMode)
Draws values of one data channel or sub channel at the data points. |
protected double |
getAngle(float x0,
float y0,
float x1,
float y1,
float x2,
float y2)
This helper method will calculate angle (x0,y0), (x1,y1), (x2,y2) |
protected java.awt.Paint |
getDefaultLineColor(boolean multiSeriesMode)
Returns default line color. |
protected java.awt.Paint |
getDefaultLinePaint(boolean multiSeriesMode)
Returns default line paint. |
java.awt.Shape |
getLegendShape()
Gets the legend symbol shape preferred by this factory. |
protected abstract DataValue |
getSubChannel(DataValue channelValue,
int subChannel)
Gets a sub-channel value. |
protected abstract int |
getSubChannels(Type valueType)
Gets the number of sub-channels. |
protected boolean |
isAbsolute(int channel,
boolean[] cumulative,
ChartData data,
ChartAttributes attr,
PlotRenderAttributes plot,
boolean isometric)
Tests if given channel needs absolute point values. |
protected boolean |
isCumulative(int channel,
boolean[] cumulative)
Tests if given channel is a member of mutually cumulative channels. |
protected DataValue[][] |
resolveLimits(ChartDataSummary summary)
Computes chart factory specific limit values for the axes. |
protected abstract boolean |
sumCumulativeValues()
Tests if the visualization strategy implemented by this shape factory instance requires that cumulative data values should be summed together or not. |
protected abstract boolean |
zeroCumulativeValues()
Tests if the visualization strategy implemented by this shape factory instance requires that missing cumulative data values should be replaced by zero values. |
| Methods inherited from class com.davisor.graphics.chart.AxisFactory |
computeMinorMargin, createChart, createChart, createContext, createMetrics, createMetrics, createMetrics, drawAxis, drawMarkers, drawTics, drawXYAxes, drawXYZAxes, fillGrid, fillMarkers, formatDouble, getIdealSize, getIdealSize, hasGridLines, isSilent, labelAxis, labelMarkers, resolveLabels, resolveLabels, resolveMarkerSizes, resolveOverlap, titleAxis, transpose |
| Methods inherited from class com.davisor.graphics.chart.ChartFactory |
annotate, combineProperties, createChannelType, createChannelType, createChart, createChart, createChart, createChart, createChart, createFormat, createPaintChannelType, createPaintChannelType, createShapeChannelType, createShapeChannelType, createSummary, drawLabel, getContentType, getDefaultPaint, getFactory, getFactory, getGroup, getIsometricCoefficients, getName, has3D, hasSVG, isClassAvailable, isMultiSeriesMode, main, mayHaveLegend, registerFactory, resolveDataLimits, resolveDataLimits, rotateSize, shade, unregisterFactory |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.davisor.core.Dupable |
dup |
| Field Detail |
protected static final int OVER
protected static final int BELOW
protected static final int CENTER
protected static final int LEFT
protected static final int RIGHT
| Constructor Detail |
public ShapeFactory()
public ShapeFactory(ShapeFactory factory)
| Method Detail |
protected abstract boolean absCumulativeValues(boolean isometric)
isometric - tells if visualization will be isometric 3D or not
true if only cumulative absolute values
should be usedDataValue.abs(),
sumCumulativeValues(),
zeroCumulativeValues()
protected abstract DataValue getSubChannel(DataValue channelValue,
int subChannel)
channelValue - channel valuesubChannel - sub-channel index
protected abstract int getSubChannels(Type valueType)
valueType - channel type
protected abstract boolean sumCumulativeValues()
true if cumulative values should be summedDataValue.add(DataValue),
absCumulativeValues(boolean),
zeroCumulativeValues()protected abstract boolean zeroCumulativeValues()
true if missing cumulative absolute values
should be replaced with zero valuesType.zero(),
absCumulativeValues(boolean),
sumCumulativeValues()
protected abstract void drawValues(java.awt.Graphics2D g,
java.awt.Paint color,
java.awt.Paint paint,
java.awt.Font font,
java.lang.String[] value,
AxisFactory.AxisMetrics info,
int alignment,
java.awt.geom.Rectangle2D[] shapeBounds,
boolean multiSeriesMode)
g - the graphics' context to draw intocolor - label colorspaint - label paintsfont - label fontvalue - value textsinfo - axis infoalignment - label alignment in relation to shapeshapeBounds - value will be aligned in relation to shape boundsmultiSeriesMode - if this is false, palette colors will be rotatedpublic java.awt.Shape getLegendShape()
This factory prefers no default shape for legends and thus returns
null
getLegendShape in class ChartFactorynull
protected AxisFactory.AxisContext createContext(ChartData data,
ChartAttributes attr,
ChartAxes axes,
short index)
throws ChartException
context is expected to
contain initial information necessary to resolve final chart
size. Chart shapes are then computed and their maximum size
measured. Depending on current settings, label margins may then
be increased or new axis steps may be added to hold shapes drawn
near plot area edges.
This method first allows superclass to create a standard chart context. Chart shapes are then computed and their maximum size measured and stored into the extended, ShapeFactory specific context parameters.
See class documentation for more information about how axis chart generation is expected to proceed.
createContext in class AxisFactorydata - chart dataattr - chart attributesaxes - chart axesindex - context index among other contexts
ChartException - if chart generation failscreateMetrics(com.davisor.graphics.chart.ChartAxes, com.davisor.graphics.chart.AxisFactory.AxisContext, boolean, boolean),
AxisFactory.resolveLabels(com.davisor.graphics.chart.ChartAxes, com.davisor.graphics.chart.AxisFactory.AxisContext),
resolveLimits(com.davisor.graphics.chart.ChartDataSummary),
ChartAxes.computeValues(com.davisor.data.DataValue[][]),
ChartAxis.bumpValue(float,float,float),
ChartFactory.createSummary(com.davisor.graphics.chart.ChartData, com.davisor.graphics.chart.ChartAttributes, com.davisor.graphics.chart.ChartAxes, com.davisor.graphics.chart.PlotRenderAttributes, com.davisor.data.EnumType, int[], boolean, int[])
protected AxisFactory.AxisMetrics createMetrics(ChartAxes axes,
AxisFactory.AxisContext context,
boolean scaleMargins,
boolean conserveSpace)
throws ChartException
AxisFactoryAxisFactory.resolveLabels(com.davisor.graphics.chart.ChartAxes, com.davisor.graphics.chart.AxisFactory.AxisContext) method. Sub-class spesific ideal chart
size is computed next by invoking AxisFactory.getIdealSize(com.davisor.graphics.chart.ChartAxes, int, int, float[], float[][], float[][], float[][], float[]) methods.
Finally, and conflicts between chart ideal size and given size
constrains are resolved. The results are then collected into an
AxisFactory.AxisMetrics instance, which is returned.
Conflict resolution between chart ideal and given size scales ideal size components to fit into given size. If size is not explisitly set, the ideal size is used. If size is greater than ideal size, all chart components are scaled up evenly. If size is smaller than ideal size, more complex chart component size optimization is carried out.
First, an attempt to reduce the number of steps on the relevant
axis is made by calling ChartAxis.reduceSteps(float). A new
ideal size is then computed by using the reduced number of steps.
If this yields enough or more than space, chart components are
scaled evenly up to the new ideal size.
createMetrics in class AxisFactoryaxes - the axes that control this particular chartcontext - axis chart contextscaleMargins - if true, scales only the margins and plot areaconserveSpace - if true, does not scale beyoun ideal size
ChartException - if chart generation failsAxisFactory.createContext(com.davisor.graphics.chart.ChartData, com.davisor.graphics.chart.ChartAttributes),
AxisFactory.resolveLabels(com.davisor.graphics.chart.ChartAxes, com.davisor.graphics.chart.AxisFactory.AxisContext)
protected Chart drawChart(AxisFactory.AxisContext context,
AxisFactory.AxisMetrics metrics,
ChartAxes axes,
boolean fillGrid,
boolean drawAxes,
boolean drawLabel,
boolean drawGrid,
Chart chart)
throws InvalidDataException
drawChart in class AxisFactorycontext - chart contextmetrics - chart metricsaxes - chart axeschart - chart to render todrawAxes - determine which axes may be drawnfillGrid - enables or disables axis background fillingdrawLabel - determine if default labeling is to be applieddrawGrid - determine if grid drawing is to be enabled
InvalidDataException - if data is invalid for chart drawing
protected AxisFactory.AxisContext createContext(ChartData data,
ChartAttributes attr,
PlotRenderAttributes plot,
ChartDataSummary summary,
java.awt.Font[] labelFont,
java.awt.Font[] titleFont,
Type colorChannelType,
Type paintChannelType,
Type urlChannelType,
EnumType labelType,
int[] valueChannels,
int[] colorChannels,
int[] paintChannels,
int[] urlChannels,
int[] altChannels,
int[] positionChannels,
float[] labelOffsets,
float[] markerOffsets,
float[][] titleSizes,
boolean isometric,
short index)
createContext in class AxisFactorycreateContext(ChartData,ChartAttributes,PlotRenderAttributes,
ChartDataSummary,Font[],Font[],Type[],int,Type[],int,Type,EnumType,
int[],int[],int[],int[],int[],int[],float[],float[],float[][],
boolean,short)
protected AxisFactory.AxisContext createContext(ChartData data,
ChartAttributes attr,
PlotRenderAttributes plot,
ChartDataSummary summary,
java.awt.Font[] labelFont,
java.awt.Font[] titleFont,
Type[] colorChannelTypes,
int lastPlotColorChannel,
Type[] paintChannelTypes,
int lastPlotPaintChannel,
Type urlChannelType,
EnumType labelType,
int[] valueChannels,
int[] colorChannels,
int[] paintChannels,
int[] urlChannels,
int[] altChannels,
int[] positionChannels,
float[] labelOffsets,
float[] markerOffsets,
float[][] titleSizes,
boolean isometric,
short index)
createContext in class AxisFactorydata - chart dataattr - chart attributesplot - local plot area attributessummary - chart data summarylabelFont - axis label fonts [X,Y,Z,...]titleFont - axis title fonts [X,Y,Z,...]colorChannelTypes - color data channel typeslastPlotColorChannel - last color channel for plotpaintChannelTypes - paint data channel typeslastPlotPaintChannel - last paint channel for ploturlChannelType - annotation URL address data channel typelabelType - label data access type (may be null)valueChannels - value data channel indexescolorChannels - color data channel indexespaintChannels - paint data channel indexesurlChannels - annotation URL address data channel indexesaltChannels - annotation description text data channel indexespositionChannels - category position value data channel indexeslabelOffsets - axis label offsets ([x,y,z])titleSizes - axis title sizes ([x,y][w,h])isometric - isometric mode indicatorindex - context index among other indexesShapeFactory.ShapeContextprotected DataValue[][] resolveLimits(ChartDataSummary summary)
This implementation places data value limit values on the Y -axis, and label limit values on the X -axis. If the given extreme values are incomplete or have errors, then the value axis limits are left unset. This may happen in particular if no label information is available.
resolveLimits in class AxisFactorysummary - data summary
ChartFactory.createSummary(com.davisor.graphics.chart.ChartData, com.davisor.graphics.chart.ChartAttributes, com.davisor.graphics.chart.ChartAxes, com.davisor.graphics.chart.PlotRenderAttributes, com.davisor.data.EnumType, int[], boolean, int[])
protected void drawGroup(java.awt.Graphics2D g,
int p,
boolean side,
java.awt.Paint color,
java.awt.Paint paint,
java.awt.Stroke stroke,
float[][] x,
float[][] y,
float x0,
float y0,
float dx,
float dy)
protected void drawLine(java.awt.Graphics2D g,
boolean side,
boolean skipMissingPoints,
java.awt.Paint pen,
java.awt.Paint[] color,
java.awt.Paint[] paint,
java.awt.Stroke stroke,
float[] x,
float[] y,
float[] prevX,
float[] prevY,
float baseLevel,
float x0,
float y0,
float dx,
float dy)
Any line segment starting from or ending at points with
NaN coordinate values is not drawn.
Areas are defined by continuous sequences of valid coordinate
values in x and y arrays. If an area so
defined is not already closed (it does not end to a point equal
to the point it started from), the area will be closed by first
travelling back along the corresponding points in
prevX and prevY arrays, and then
returning to the point the area oriignally started from. Any
NaN points in prevX and
prevY will be simply skipped.
Paint arrays that are not null are expected to
contain shaded paints, as described by the
ChartFactory.shade(Paint) method. Frontfaces are
filled with NORMAL paint shade, while ascending
sidefaces are filled with DARK and descending sidefaces
with BRIGHT paint shades. Sidefaces facing back are
not drawn.
Finally, the stroked front edge line is drawn only if the given
stroke is not null. The edge line color
is primarily taken from color, secondarily from
paint and tertiary from pen. If they
all are null, the edge line color defaults to black.
g - the graphics' context to draw inside - draw side faces, or the front faceskipMissingPoints - run over missing points or notpen - line front edge colorcolor - line color shades (may be null)paint - line paint shades (may be null)stroke - line stroke (may be null)x - points data on x-axisy - points data on y-axisprevX - previous line points data on x-axisprevY - previous line points data on y-axisbaseLevel - base Y value to use if prevY is nullx0 - X offsety0 - Y offsetdx - X shear offsetdy - Y shear offsetAxisFactory.createChart(com.davisor.graphics.chart.ChartFactory.ChartContext, com.davisor.graphics.chart.ChartFactory.ChartMetrics, com.davisor.graphics.chart.ChartAttributes, com.davisor.graphics.chart.Chart),
drawShapes(java.awt.Graphics2D, java.awt.Paint[], java.awt.Paint[], java.awt.Stroke[], java.awt.Shape[], float[], float[], float, float, float, float, float),
ChartFactory.shade(java.awt.Paint)
protected void drawSegments(java.awt.Graphics2D g,
boolean side,
java.awt.Paint[] color,
java.awt.Paint[] paint,
java.awt.Stroke stroke,
int lineSegments,
java.awt.Paint linePaint,
java.awt.Shape drawPath,
java.awt.Shape fillPath,
float dx,
float dy)
protected java.awt.geom.Rectangle2D[] drawShapes(java.awt.Graphics2D g,
java.awt.Paint[] color,
java.awt.Paint[] paint,
java.awt.Stroke[] stroke,
java.awt.Shape[] shape,
float[] x,
float[] y,
float s,
float x0,
float y0,
float dx,
float dy)
NaN
coordinate values are not drawn.
The rendered shape consists of a stroked edge line on a filled
background. If the shearing offsets dx and
dy are not equal to zero, they will move the shape
so that it will appear at the front edge on the sheared 3D
decorations. Negative dx and dy
shearing offset values move the shapes to the left and down,
while positive values move them to the right and up.
Shapes for each point are taken from the shape
array. Points with null shapes are not drawn at all.
The filled background paint of a shape is taken from the
paint parameter. If the background paint for a shape
is null, the shape is not filled.
The stroked edge line color of a shape is taken from the
color parameter. If the line color is
null, the shape's edge line is not drawn.
The shape's stroke is taken from the stroke
parameter. If it is null, a thin solid line stroke
is used by default.
g - the graphics' context to draw incolor - colors for shapespaint - paints for shapesstroke - shape stroke (may be null)shape - shapes for pointsx - points data on x-axisy - points data on y-axiss - shape size scalar factoryx0 - X offsety0 - Y offsetdx - X shear offsetdy - Y shear offset
ChartFactory.shade(java.awt.Paint)
protected boolean isAbsolute(int channel,
boolean[] cumulative,
ChartData data,
ChartAttributes attr,
PlotRenderAttributes plot,
boolean isometric)
absCumulativeValues(boolean) returns true.
A channel needs to use absolute values if the data it contains can not be rendered reliably with 3D isometric graphics. In particular, absolute values are needed if any of the data points would have a value that would move it "backwards" to the negative direction. To prevent this, only absolute point data values should be used in rendering.
For example, if a cumulative channel had negative values, the corresponding line would have to "dig in" the previous line. Likewise, a closed non-cumulative filled area with positive and negative values would cross the bottom of the same area, standing on a coordinate axis.
channel - the number of the channel to testcumulative - cumulativeness information for each channeldata - chart dataattr - chart attributesplot - local plot area attributesisometric - use isometric 3D rendering or notabsCumulativeValues(boolean),
isCumulative(int, boolean[]),
ChartAttributes.isArea(java.lang.String, com.davisor.graphics.chart.PlotRenderAttributes)
protected boolean isCumulative(int channel,
boolean[] cumulative)
channel - the number of the channel to testcumulative - cumulativeness information for each channel
protected float[] drawSmoothedLine(java.awt.Graphics2D g,
boolean side,
boolean skipMissingPoints,
java.awt.Paint pen,
java.awt.Paint[] color,
java.awt.Paint[] paint,
java.awt.Stroke stroke,
float[] x,
float[] y,
float[] prevX,
float[] prevY,
float baseLevel,
float x0,
float y0,
float dx,
float dy,
int lineSmoothness,
float[] oldControlPoints)
g - the graphics' context to draw inside - draw side faces, or the front faceskipMissingPoints - run over missing points or notpen - line front edge colorcolor - line color shades (may be null)paint - line paint shades (may be null)stroke - line stroke (may be null)x - points data on x-axisy - points data on y-axisprevX - previous line points data on x-axisprevY - previous line points data on y-axisbaseLevel - base Y value to use if prevY is nullx0 - X offsety0 - Y offsetdx - X shear offsetdy - Y shear offsetlineSmoothness - is percentage of smoothness. 0 means no smoothing and
100 means maximal smoothing is to be applied.oldControlPoints - in case of cumulative smoothed lines, the control points
of previous line should be passed. If there are no previous control points, null
should be passed.
drawLine(java.awt.Graphics2D, boolean, boolean, java.awt.Paint, java.awt.Paint[], java.awt.Paint[], java.awt.Stroke, float[], float[], float[], float[], float, float, float, float, float)
protected double getAngle(float x0,
float y0,
float x1,
float y1,
float x2,
float y2)
protected java.awt.Paint getDefaultLineColor(boolean multiSeriesMode)
multiSeriesMode - true if multi series mode is in useprotected java.awt.Paint getDefaultLinePaint(boolean multiSeriesMode)
multiSeriesMode - true if multi series mode is in use
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||