Package kg.apc.charting
Class AbstractGraphRow
- java.lang.Object
-
- kg.apc.charting.AbstractGraphRow
-
- Direct Known Subclasses:
GraphRowAverages,GraphRowExactValues,GraphRowOverallAverages,GraphRowSimple,GraphRowSumValues
public abstract class AbstractGraphRow extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.Colorcolorprotected booleandrawLineprotected java.lang.Stringlabelprotected java.awt.RectanglelegendColorBoxWhen user clicks on this, color of the box and metric line will change.static floatLINE_THICKNESS_BIGstatic intMARKER_SIZE_BIGstatic intMARKER_SIZE_NONEstatic intMARKER_SIZE_SMALLprotected intmarkerSizeprotected longmaxXprotected longminXstatic intROW_AVERAGESstatic intROW_EXACT_VALUESstatic intROW_OVERALL_AVERAGESstatic intROW_PERCENTILESstatic intROW_ROLLING_SUM_VALUESstatic intROW_SIMPLEstatic intROW_SUM_VALUES
-
Constructor Summary
Constructors Constructor Description AbstractGraphRow()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidadd(long xVal, double yVal)java.awt.ColorgetColor()abstract AbstractGraphPanelChartElementgetElement(long value)Needed for csv export.longgetFirstTime()intgetGranulationValue()java.lang.LonggetHigherKey(long value)java.lang.StringgetLabel()java.awt.RectanglegetLegendColorBox()AbstractGraphPanelChartElementgetLowerElement(long value)Needed for aggregate average rows witch need to be summed.intgetMarkerSize()longgetMaxX()double[]getMinMaxY(int maxPoints)longgetMinX()static AbstractGraphRowinstantiateNewRow(int rowType)booleanisDrawBar()booleanisDrawLine()booleanisDrawOnChart()booleanisDrawSpline()booleanisDrawThickLines()booleanisDrawValueLabel()booleanisShowInLegend()abstract java.util.Iterator<java.util.Map.Entry<java.lang.Long,AbstractGraphPanelChartElement>>iterator()voidsetColor(java.awt.Color nextColor)voidsetDrawBar(boolean b)voidsetDrawLine(boolean b)voidsetDrawOnChart(boolean drawOnChart)voidsetDrawSpline(boolean drawSpline)voidsetDrawThickLines(boolean isThickLine)voidsetDrawValueLabel(boolean drawValueLabel)voidsetExcludeOutOfRangeValues(boolean excludeOutOfRangeValues)For bar chart x axis too big prevention.voidsetGranulationValue(int value)set the granulation value for drawbar widthvoidsetLabel(java.lang.String label)voidsetLegendColorBox(java.awt.Rectangle val)voidsetMarkerSize(int aMarkerSize)voidsetShowInLegend(boolean showInLegend)abstract intsize()
-
-
-
Field Detail
-
MARKER_SIZE_NONE
public static final int MARKER_SIZE_NONE
- See Also:
- Constant Field Values
-
MARKER_SIZE_SMALL
public static final int MARKER_SIZE_SMALL
- See Also:
- Constant Field Values
-
MARKER_SIZE_BIG
public static final int MARKER_SIZE_BIG
- See Also:
- Constant Field Values
-
LINE_THICKNESS_BIG
public static final float LINE_THICKNESS_BIG
- See Also:
- Constant Field Values
-
ROW_AVERAGES
public static final int ROW_AVERAGES
- See Also:
- Constant Field Values
-
ROW_EXACT_VALUES
public static final int ROW_EXACT_VALUES
- See Also:
- Constant Field Values
-
ROW_OVERALL_AVERAGES
public static final int ROW_OVERALL_AVERAGES
- See Also:
- Constant Field Values
-
ROW_PERCENTILES
public static final int ROW_PERCENTILES
- See Also:
- Constant Field Values
-
ROW_SUM_VALUES
public static final int ROW_SUM_VALUES
- See Also:
- Constant Field Values
-
ROW_ROLLING_SUM_VALUES
public static final int ROW_ROLLING_SUM_VALUES
- See Also:
- Constant Field Values
-
ROW_SIMPLE
public static final int ROW_SIMPLE
- See Also:
- Constant Field Values
-
drawLine
protected boolean drawLine
-
markerSize
protected int markerSize
-
color
protected java.awt.Color color
-
legendColorBox
protected java.awt.Rectangle legendColorBox
When user clicks on this, color of the box and metric line will change.
-
label
protected java.lang.String label
-
maxX
protected long maxX
-
minX
protected long minX
-
-
Method Detail
-
setDrawThickLines
public void setDrawThickLines(boolean isThickLine)
-
isDrawThickLines
public boolean isDrawThickLines()
-
setDrawLine
public void setDrawLine(boolean b)
-
setMarkerSize
public void setMarkerSize(int aMarkerSize)
-
isDrawLine
public boolean isDrawLine()
- Returns:
- the drawLine
-
getMarkerSize
public int getMarkerSize()
- Returns:
- the markerSize
-
getColor
public java.awt.Color getColor()
-
setColor
public void setColor(java.awt.Color nextColor)
-
getLabel
public java.lang.String getLabel()
- Returns:
- the label
-
setLabel
public void setLabel(java.lang.String label)
- Parameters:
label- the label to set
-
getMaxX
public long getMaxX()
- Returns:
- the maxX
-
getMinMaxY
public double[] getMinMaxY(int maxPoints)
- Parameters:
maxPoints- ditto- Returns:
- the exact maxY, taking in account maxPoint limit
-
getMinX
public long getMinX()
- Returns:
- the minX
-
add
public void add(long xVal, double yVal)
-
iterator
public abstract java.util.Iterator<java.util.Map.Entry<java.lang.Long,AbstractGraphPanelChartElement>> iterator()
-
isDrawValueLabel
public boolean isDrawValueLabel()
- Returns:
- the drawValueLabel
-
setDrawValueLabel
public void setDrawValueLabel(boolean drawValueLabel)
- Parameters:
drawValueLabel- the drawValueLabel to set
-
isShowInLegend
public boolean isShowInLegend()
- Returns:
- the showInLegend
-
setShowInLegend
public void setShowInLegend(boolean showInLegend)
- Parameters:
showInLegend- the showInLegend to set
-
isDrawOnChart
public boolean isDrawOnChart()
- Returns:
- the drawOnChart
-
setDrawOnChart
public void setDrawOnChart(boolean drawOnChart)
- Parameters:
drawOnChart- the drawOnChart to set
-
setDrawBar
public void setDrawBar(boolean b)
-
isDrawBar
public boolean isDrawBar()
- Returns:
- the drawBar
-
isDrawSpline
public boolean isDrawSpline()
-
setDrawSpline
public void setDrawSpline(boolean drawSpline)
-
getGranulationValue
public int getGranulationValue()
- Returns:
- the granulation value for drawbar width
-
setGranulationValue
public void setGranulationValue(int value)
set the granulation value for drawbar width- Parameters:
value- to set
-
setExcludeOutOfRangeValues
public void setExcludeOutOfRangeValues(boolean excludeOutOfRangeValues)
For bar chart x axis too big prevention. Must be overridden if necessary.- Parameters:
excludeOutOfRangeValues- ditto
-
getElement
public abstract AbstractGraphPanelChartElement getElement(long value)
Needed for csv export.- Parameters:
value- the key to get the element- Returns:
- the corresponding element
-
getLowerElement
public AbstractGraphPanelChartElement getLowerElement(long value)
Needed for aggregate average rows witch need to be summed. Must be overridden in child class if needed- Parameters:
value- the upper key to get the floor element- Returns:
- the floor element, null if not exist
-
getHigherKey
public java.lang.Long getHigherKey(long value)
-
size
public abstract int size()
-
instantiateNewRow
public static AbstractGraphRow instantiateNewRow(int rowType)
-
getFirstTime
public long getFirstTime()
- Returns:
- the firstTime
-
setLegendColorBox
public void setLegendColorBox(java.awt.Rectangle val)
-
getLegendColorBox
public java.awt.Rectangle getLegendColorBox()
-
-