|
|||||||||||
| 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
com.davisor.graphics.chart.LineFactory
LineFactory implements a line chart producer that can make polyline charts from one-dimensional multichannel data.
This factory inherits all of it's attribute and data operation
logic from AxisFactory superclass, and most of it's
rendering logic from ShapeFactory superclass. In fact, this
class implements itself only some low-level rendering methods that
lay out shape chart visual elements in a way suitable for line
charts. Please see AxisFactory documentation for more
information about what kind of data and attributes this factory
accepts.
Line factory 3D lines are rendered using painter's algorithm and simple isometric projection. This imposes certain limitations of what kind of lines can be rendered in 3D:
absCumulativeValues(boolean))
null values in cumulative 3D lines are treated as having
a zero value (see zeroCumulativeValues()), while in all other
cases they break the line in two or more disconnected parts
sumCumulativeValues() ShapeFactory.isCumulative(int, boolean[]))
absCumulativeValues(boolean) and ShapeFactory.isAbsolute(int, boolean[], com.davisor.graphics.chart.ChartData, com.davisor.graphics.chart.ChartAttributes, com.davisor.graphics.chart.PlotRenderAttributes, boolean))
zeroCumulativeValues() and ShapeFactory.isCumulative(int, boolean[]))
ShapeFactory.isCumulative(int, boolean[]))
ChartAttributes,
ChartData,
ColumnBarFactory,
PieFactory,
RowBarFactory,
ScatterFactory| Nested Class Summary |
| Nested classes inherited from class com.davisor.graphics.chart.ShapeFactory |
ShapeFactory.ShapeContext |
| 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 |
| Fields inherited from class com.davisor.graphics.chart.ShapeFactory |
BELOW, CENTER, LEFT, OVER, 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 | |
LineFactory()
Default constructor. |
|
LineFactory(LineFactory factory)
Copy constructor. |
|
| Method Summary | |
protected 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 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 at the top the data points. |
com.davisor.core.Dupable |
dup()
Duplicates this factory. |
protected float[] |
getIdealSize(ChartAxes axes,
int elements,
int channels,
float[] labelOffsets,
float[][] titleSizes,
float[][] labelSizes,
float[][] markerSizes,
float[] markerOffsets)
Gets the ideal suggested size for this chart. |
protected DataValue |
getSubChannel(DataValue channelValue,
int subChannel)
Gets a sub-channel value. |
protected int |
getSubChannels(Type valueType)
Gets the number of sub-channels. |
protected boolean |
isSilent(ChartAxis axis)
Tests axis silency in chart factory spesific way. |
protected DataValue[] |
resolveDataLimits(ChartData data,
ChartAttributes attr,
PlotRenderAttributes plot,
int[] channels,
boolean isometric,
boolean[] cumulative)
Determines global minimum and maximum data values. |
protected 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 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.ShapeFactory |
createContext, createContext, createContext, createMetrics, drawChart, drawGroup, drawLine, drawSegments, drawShapes, drawSmoothedLine, getAngle, getDefaultLineColor, getDefaultLinePaint, getLegendShape, isAbsolute, isCumulative, resolveLimits |
| 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, hasGridLines, 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, rotateSize, shade, unregisterFactory |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public LineFactory()
public LineFactory(LineFactory factory)
| Method Detail |
protected DataValue[] resolveDataLimits(ChartData data,
ChartAttributes attr,
PlotRenderAttributes plot,
int[] channels,
boolean isometric,
boolean[] cumulative)
throws InvalidDataException
Due isometric rendering constrains, LineFactory must render isometric cumulative and area charts with absolute data values only. This method takes these restrictinos into account when data limits are resolved.
Warning! Do not modify the returned values since they may be references to the original data points.
resolveDataLimits in class ChartFactorydata - chart data to be inspectedattr - chart rendering attributesplot - local plot area attributeschannels - indexes of the channels to be inspectedisometric - isometric rendering may affect how doata is understoodcumulative - precomputed channel cumulativenes values
InvalidDataException - if data limit resolvation failsChartFactory.resolveDataLimits(DataValue[][],boolean[]),
ChartData.getLimits(int[],Type,boolean[],boolean[])
protected float[] getIdealSize(ChartAxes axes,
int elements,
int channels,
float[] labelOffsets,
float[][] titleSizes,
float[][] labelSizes,
float[][] markerSizes,
float[] markerOffsets)
getIdealSize in class AxisFactoryaxes - axis attributeselements - the expected number of data element groupschannels - the expected number of data channelslabelOffsets - axis label offsets ([x,y,z])titleSizes - axis title sizes ([x,y][w,h])labelSizes - axis label sizes ([x,y][w,h])
AxisFactory.getIdealSize(ChartAxes,float[],float[],
float[][],float[][],float[][],float[])protected boolean isSilent(ChartAxis axis)
Line factories make category axes that have no
labels silent by default. Label precense is detected by checking
if axis step data type has an instance of EnumType. If it
is, the axis is assumed to have labels.
isSilent in class AxisFactoryaxis - axis to check
true if given axis is silent in this contextChartAxis.isSilent()public com.davisor.core.Dupable dup()
protected boolean absCumulativeValues(boolean isometric)
absCumulativeValues in class ShapeFactoryisometric - tells if visualization will be isometric 3D or not
true for isometric rendering, false
otherwiseDataValue.abs(),
sumCumulativeValues(),
zeroCumulativeValues()
protected DataValue getSubChannel(DataValue channelValue,
int subChannel)
getSubChannel in class ShapeFactorychannelValue - channel valuesubChannel - sub-channel index
protected int getSubChannels(Type valueType)
getSubChannels in class ShapeFactoryvalueType - channel type
protected boolean sumCumulativeValues()
sumCumulativeValues in class ShapeFactorytrueDataValue.add(DataValue),
absCumulativeValues(boolean),
zeroCumulativeValues()protected boolean zeroCumulativeValues()
zeroCumulativeValues in class ShapeFactorytrueType.zero(),
absCumulativeValues(boolean),
sumCumulativeValues()
protected 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)
drawValues in class ShapeFactoryg - 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 rotated
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||