lt.monarch.chart.spc
Class ControlChart

java.lang.Object
  extended by lt.monarch.chart.AbstractView<PaintTags>
      extended by lt.monarch.chart.AbstractChart<PaintTags,GeneralProjector>
          extended by lt.monarch.chart.MultiSeriesChartBase<ChartPaintTags,Projector2D>
              extended by lt.monarch.chart.chart2D.Chart2D
                  extended by lt.monarch.chart.spc.SpcChart
                      extended by lt.monarch.chart.spc.ControlChart
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Chart<Projector2D>, ChartEntity, StyleEditorEntity, View

public class ControlChart
extends SpcChart

Control chart. Contains UCL, LCL, center and data lines. Chart values are calculated using formulas: http://www.singleton-labs.com/doc/mcharts/guide/#guide/chart-types/4.3.1.html

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
protected  ControlValuesCalculator calc
           
protected  LineSeries centerLine
           
protected  ChartDataModel centerLineData
           
protected  TextMarker centerTextMarker
           
protected  ControlChartType chartType
           
protected  java.lang.Object[] labels
           
protected  LineSeries lclExceedLine
           
protected  LineSeries lclLine
           
protected  ChartDataModel lclLineData
           
protected  TextMarker lclTextMarker
           
protected  java.lang.Double lsl
           
protected  LineSeries lslLine
           
protected  ChartDataModel lslLineData
           
protected  TextMarker lslTextMarker
           
protected  ChartDataModel measurementsData
           
protected  LineSeries measurementsLine
           
protected  AbstractMarker measurementsLineMarker
           
protected  java.text.NumberFormat nf
           
protected  int npSamplesCount
           
protected  boolean showCLExceedLines
           
protected  boolean showPercentAxis
           
protected  LineSeries uclExceedLine
           
protected  LineSeries uclLine
           
protected  ChartDataModel uclLineData
           
protected  TextMarker uclTextMarker
           
protected  java.lang.Double usl
           
protected  LineSeries uslLine
           
protected  ChartDataModel uslLineData
           
protected  TextMarker uslTextMarker
           
protected  LabelAxisMapper xMapper
           
protected  MathAxisMapper yMapper
           
 
Fields inherited from class lt.monarch.chart.spc.SpcChart
bottomAxis, dataModel, grid, leftAxis, rightAxis
 
Fields inherited from class lt.monarch.chart.chart2D.Chart2D
projector
 
Fields inherited from class lt.monarch.chart.AbstractChart
draftMode, locale, plugins
 
Fields inherited from class lt.monarch.chart.AbstractView
layoutInvalid, paintStyle, style
 
Constructor Summary
Constructor and Description
ControlChart(ChartDataModel dataModel, ControlChartType chartTypec)
          Constructs control chart without LSL and USL lines
ControlChart(ChartDataModel dataModel, ControlChartType chartTypec, java.lang.Double lsl, java.lang.Double usl)
          Constructs control chart with LSL and USL lines
ControlChart(ChartDataModel dataModel, ControlChartType chartTypec, int npSamplesCount)
          Constructs control chart without LSL and USL lines
ControlChart(ChartDataModel dataModel, ControlChartType chartTypec, int npSamplesCount, java.lang.Double lsl, java.lang.Double usl)
          Constructs control chart with LSL and USL lines
 
Method Summary
Modifier and Type Method and Description
 LineSeries getCenterLine()
          Returns center line series.
 TextMarker getCenterTextMarker()
          Returns center line text marker.
 LineSeries getLclExceedLine()
          Returns line showing when measurement line data is lower than lower control limit line.
 LineSeries getLclLine()
          Returns lower control limit line series.
 TextMarker getLclTextMarker()
          Returns lower control limit text marker.
 java.lang.Double getLsl()
          Returns lower specification limit
 LineSeries getMeasurementsLine()
          Returns data line series.
 AbstractMarker getMeasurementsLineMarker()
          Returns data line marker.
 int getNpSamplesCount()
          Returns samples count for np-chart
 LineSeries getUclExceedLine()
          Returns line showing when measurement line exceeds upper control limit line.
 LineSeries getUclLine()
          Returns upper control limit line series.
 TextMarker getUclTextMarker()
          Returns upper control limit text marker.
 java.lang.Double getUsl()
          Returns upper specification limit
 boolean isShowCLExceedLines()
          Return value showing if uclExceedLine and lclExceedLine are visible (true) or hidden(true)
 boolean isShowPercentAxis()
          When true, the y axis shows percents instead of proportion values.
 void setChartData(ChartDataModel dataModel, int npSamplesCount, java.lang.Double lsl, java.lang.Double usl)
          Sets chart data.
 void setLsl(java.lang.Double lsl)
          Sets lower specification limit
 void setMeasurementsLineMarker(AbstractMarker marker)
          Sets new marker for measurement line series.
 void setNpSamplesCount(int npSamplesCount)
          Sets samples count for np-chart.
 void setShowCLExceedLines(boolean showExceedLines)
          Sets uclExceedLine and lclExceedLine visible or hidden
 void setShowPercentAxis(boolean showPercentAxis)
          When true, the y axis shows percents instead of proportion values.
 void setUsl(java.lang.Double usl)
          Sets upper specification limit
protected  void updateAxes()
          Creates chart axes on chart creation.
protected  void updateCenterLine()
          Creates center line on chart creation.
protected  void updateChart()
          Redraws chart
protected  void updateGrid()
          Creates chart grid on chart creation.
protected  void updateLclExceedLine()
          Creates lower control exceed line-marker on chart creation.
protected  void updateLclLine()
          Creates lower control line on chart creation.
protected  void updateLslMarkerLine()
          Creates lower specification level marker line on chart creation or updates it on chart data model change.
protected  void updateMappers()
          Creates chart axes mappers on chart creation or updates them on chart data model change.
protected  void updateMeasurementsLine()
          Creates measurements line on chart creation.
protected  void updateUclExceedLine()
          Creates upper control exceed line-marker on chart creation.
protected  void updateUclLine()
          Creates upper control line on chart creation.
protected  void updateUslMarkerLine()
          Creates upper specification level marker line on chart creation or updates it on chart data model change.
 
Methods inherited from class lt.monarch.chart.spc.SpcChart
getBottomAxis, getDataModel, getGrid, getLeftAxis, getMax, getMax, getMin, getMin, getRightAxis, resetDataModel, setDataModel, setNoData, setNoData, trim
 
Methods inherited from class lt.monarch.chart.chart2D.Chart2D
addBottomXAxis, addLeftYAxis, addRightYAxis, addTopXAxis, addXAxis, addYAxis, dispose, finalize, getBreakLine, getChartAreaMargin, getMinAxisWidth, getProjector, getStackedXAxisMargin, getStackedYAxisMargin, getXAxes, getYAxes, layout, paintChart, projector, removeBottomXAxis, removeLeftYAxis, removeRightYAxis, removeTopXAxis, removeXAxis, removeYAxis, setBottomXAxis, setBreakLine, setChartAreaMargin, setLeftYAxis, setMinAxisWidth, setRightYAxis, setStackedBottomXAxisProportion, setStackedLeftYAxisProportion, setStackedRightYAxisProportion, setStackedTopXAxisProportion, setStackedXAxisMargin, setStackedXAxisProportion, setStackedYAxisMargin, setStackedYAxisProportion, setTopXAxis, setXAxis, setXAxis, setYAxis, setYAxis
 
Methods inherited from class lt.monarch.chart.MultiSeriesChartBase
activate, addObject, createLegendEntries, deactivate, findObject, getContainingObjects, getObjects, layoutObjects, removeObject, replaceObject, reset, setObjects, shiftObjects
 
Methods inherited from class lt.monarch.chart.AbstractChart
addPlugin, disableDrafMode, enableDraftMode, fillEntitySheet, getDescription, getLocale, getParentEntity, getPlugins, getShortDescription, invalidate, isDraftMode, paint, removePlugin, removePlugins, setDraftMode, setLocale
 
Methods inherited from class lt.monarch.chart.AbstractView
addViewListener, clone, container, getAlignmentX, getAlignmentY, getBounds, getChartObjectBounds, getContainer, getGraphicsType, getHeight, getMaximumSize, getMinimumSize, getPaintMode, getPaintStyle, getParent, getPreferredSize, getSize, getSize, getStyle, getStyle, getWidth, getX, getY, isLayoutValid, removeViewListener, render, repaint, repaint, setAlignmentX, setAlignmentY, setBounds, setBounds, setContainer, setLocation, setMaximumSize, setMinimumSize, setPaintMode, setPreferredSize, setSize, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface lt.monarch.chart.engine.View
addViewListener, clone, container, getAlignmentX, getAlignmentY, getBounds, getGraphicsType, getHeight, getMaximumSize, getMinimumSize, getPreferredSize, getSize, getSize, getStyle, getWidth, getX, getY, removeViewListener, render, repaint, repaint, setAlignmentX, setAlignmentY, setBounds, setBounds, setContainer, setLocation, setMaximumSize, setMinimumSize, setPreferredSize, setSize, validate
 

Field Detail

uslLineData

protected ChartDataModel uslLineData

lslLineData

protected ChartDataModel lslLineData

uslLine

protected LineSeries uslLine

lslLine

protected LineSeries lslLine

nf

protected java.text.NumberFormat nf

centerLineData

protected ChartDataModel centerLineData

lclLineData

protected ChartDataModel lclLineData

uclLineData

protected ChartDataModel uclLineData

labels

protected java.lang.Object[] labels

centerLine

protected LineSeries centerLine

showPercentAxis

protected boolean showPercentAxis

showCLExceedLines

protected boolean showCLExceedLines

lclTextMarker

protected TextMarker lclTextMarker

uclTextMarker

protected TextMarker uclTextMarker

lslTextMarker

protected TextMarker lslTextMarker

uslTextMarker

protected TextMarker uslTextMarker

centerTextMarker

protected TextMarker centerTextMarker

measurementsLineMarker

protected AbstractMarker measurementsLineMarker

measurementsLine

protected LineSeries measurementsLine

lclLine

protected LineSeries lclLine

uclLine

protected LineSeries uclLine

lclExceedLine

protected LineSeries lclExceedLine

uclExceedLine

protected LineSeries uclExceedLine

chartType

protected ControlChartType chartType

calc

protected ControlValuesCalculator calc

npSamplesCount

protected int npSamplesCount

lsl

protected java.lang.Double lsl

usl

protected java.lang.Double usl

xMapper

protected LabelAxisMapper xMapper

yMapper

protected MathAxisMapper yMapper

measurementsData

protected ChartDataModel measurementsData
Constructor Detail

ControlChart

public ControlChart(ChartDataModel dataModel,
                    ControlChartType chartTypec)
             throws DataFormatException
Constructs control chart without LSL and USL lines

Parameters:
dataModel - input data model.
chartTypec - control chart type.
Throws:
DataFormatException

ControlChart

public ControlChart(ChartDataModel dataModel,
                    ControlChartType chartTypec,
                    int npSamplesCount)
             throws DataFormatException
Constructs control chart without LSL and USL lines

Parameters:
dataModel - input data model.
chartTypec - control chart type.
npSamplesCount - samples count for np-chart.
Throws:
DataFormatException

ControlChart

public ControlChart(ChartDataModel dataModel,
                    ControlChartType chartTypec,
                    java.lang.Double lsl,
                    java.lang.Double usl)
             throws DataFormatException
Constructs control chart with LSL and USL lines

Parameters:
dataModel - input data model.
chartTypec - control chart type.
lsl - LSL value
usl - USL value
Throws:
DataFormatException

ControlChart

public ControlChart(ChartDataModel dataModel,
                    ControlChartType chartTypec,
                    int npSamplesCount,
                    java.lang.Double lsl,
                    java.lang.Double usl)
             throws DataFormatException
Constructs control chart with LSL and USL lines

Parameters:
dataModel - input data model.
chartTypec - control chart type.
npSamplesCount - samples count for np-chart.
lsl - LSL value
usl - USL value
Throws:
DataFormatException
Method Detail

setChartData

public void setChartData(ChartDataModel dataModel,
                         int npSamplesCount,
                         java.lang.Double lsl,
                         java.lang.Double usl)
                  throws DataFormatException
Sets chart data.

Parameters:
dataModel - input data model.
npSamplesCount - samples count for np-chart.
lsl - LSL value
usl - USL value
Throws:
DataFormatException

getCenterLine

public LineSeries getCenterLine()
Returns center line series. Use setVisible(false) to hide it.


getMeasurementsLine

public LineSeries getMeasurementsLine()
Returns data line series. Use setVisible(false) to hide it.


getLclLine

public LineSeries getLclLine()
Returns lower control limit line series. Use setVisible(false) to hide it.


getUclLine

public LineSeries getUclLine()
Returns upper control limit line series. Use setVisible(false) to hide it.


getUclExceedLine

public LineSeries getUclExceedLine()
Returns line showing when measurement line exceeds upper control limit line. Use setVisible(false) to hide it.


getLclExceedLine

public LineSeries getLclExceedLine()
Returns line showing when measurement line data is lower than lower control limit line. Use setVisible(false) to hide it.


getMeasurementsLineMarker

public AbstractMarker getMeasurementsLineMarker()
Returns data line marker. Default marker is SquareMarker. Use setVisible(false) to hide it.


setMeasurementsLineMarker

public void setMeasurementsLineMarker(AbstractMarker marker)
Sets new marker for measurement line series. The old one is removed and a new one is assigned to the scatter series.

Parameters:
marker - new marker

updateChart

protected void updateChart()
                    throws DataFormatException
Description copied from class: SpcChart
Redraws chart

Overrides:
updateChart in class SpcChart
Throws:
DataFormatException

updateMappers

protected void updateMappers()
Creates chart axes mappers on chart creation or updates them on chart data model change.


updateAxes

protected void updateAxes()
Creates chart axes on chart creation.


updateGrid

protected void updateGrid()
Creates chart grid on chart creation.


updateMeasurementsLine

protected void updateMeasurementsLine()
Creates measurements line on chart creation.


updateCenterLine

protected void updateCenterLine()
Creates center line on chart creation.


updateLclLine

protected void updateLclLine()
Creates lower control line on chart creation.


updateUclLine

protected void updateUclLine()
Creates upper control line on chart creation.


updateUclExceedLine

protected void updateUclExceedLine()
Creates upper control exceed line-marker on chart creation.


updateLclExceedLine

protected void updateLclExceedLine()
Creates lower control exceed line-marker on chart creation.


updateLslMarkerLine

protected void updateLslMarkerLine()
Creates lower specification level marker line on chart creation or updates it on chart data model change.


updateUslMarkerLine

protected void updateUslMarkerLine()
Creates upper specification level marker line on chart creation or updates it on chart data model change.


getLsl

public java.lang.Double getLsl()
Returns lower specification limit


setLsl

public void setLsl(java.lang.Double lsl)
            throws DataFormatException
Sets lower specification limit

Throws:
DataFormatException

getUsl

public java.lang.Double getUsl()
Returns upper specification limit


setUsl

public void setUsl(java.lang.Double usl)
            throws DataFormatException
Sets upper specification limit

Throws:
DataFormatException

getNpSamplesCount

public int getNpSamplesCount()
Returns samples count for np-chart


setNpSamplesCount

public void setNpSamplesCount(int npSamplesCount)
                       throws DataFormatException
Sets samples count for np-chart. After changing the value, the chart is updated.

Throws:
DataFormatException

getLclTextMarker

public TextMarker getLclTextMarker()
Returns lower control limit text marker. Use setVisible(false) to hide it.


getUclTextMarker

public TextMarker getUclTextMarker()
Returns upper control limit text marker. Use setVisible(false) to hide it.


getCenterTextMarker

public TextMarker getCenterTextMarker()
Returns center line text marker. Use setVisible(false) to hide it.


isShowPercentAxis

public boolean isShowPercentAxis()
When true, the y axis shows percents instead of proportion values. (for p-chart only)


setShowPercentAxis

public void setShowPercentAxis(boolean showPercentAxis)
When true, the y axis shows percents instead of proportion values. (for p-chart only)


isShowCLExceedLines

public boolean isShowCLExceedLines()
Return value showing if uclExceedLine and lclExceedLine are visible (true) or hidden(true)


setShowCLExceedLines

public void setShowCLExceedLines(boolean showExceedLines)
Sets uclExceedLine and lclExceedLine visible or hidden

Parameters:
showExceedLines - true if lines should be visible.