Class CenteredMovingAveragePaintlet
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.visualization.core.AbstractPaintlet
-
- adams.gui.visualization.core.AbstractStrokePaintlet
-
- adams.gui.visualization.stats.paintlet.AbstractColorPaintlet
-
- adams.gui.visualization.stats.paintlet.AbstractOverlayPaintlet
-
- adams.gui.visualization.stats.paintlet.CenteredMovingAveragePaintlet
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,ShallowCopySupporter<Paintlet>,SizeOfHandler,TechnicalInformationHandler,AntiAliasingSupporter,Paintlet,Serializable
public class CenteredMovingAveragePaintlet extends AbstractOverlayPaintlet implements AntiAliasingSupporter, TechnicalInformationHandler
Paintlet for drawing the CenteredMovingAverage overlay.
For more information see:
WikiPedia. Moving average. URL https://en.wikipedia.org/wiki/Moving_average
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING min-user-mode: Expert
-stroke-thickness <float> (property: strokeThickness) The thickness of the stroke. default: 1.0 minimum: 0.01
-color <java.awt.Color> (property: color) Stroke color for the paintlet default: #000000
-window-size <int> (property: windowSize) The window size for smoothing. default: 15 minimum: 1
-anti-aliasing-enabled <boolean> (property: antiAliasingEnabled) If enabled, uses anti-aliasing for drawing lines. default: true
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanm_AntiAliasingEnabledwhether anti-aliasing is enabled.protected List<Point2D>m_ToPlotPoints to plot for the CenteredMovingAverage curveprotected intm_WindowSizeSize of window size for calculating CenteredMovingAverage-
Fields inherited from class adams.gui.visualization.stats.paintlet.AbstractOverlayPaintlet
m_AxisBottom, m_AxisLeft, m_Calculated, m_XInd, m_YInd
-
Fields inherited from class adams.gui.visualization.stats.paintlet.AbstractColorPaintlet
m_Color, m_Data
-
Fields inherited from class adams.gui.visualization.core.AbstractStrokePaintlet
m_StrokeThickness
-
Fields inherited from class adams.gui.visualization.core.AbstractPaintlet
m_Enabled, m_Initializing, m_Panel, m_RepaintOnChange
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description CenteredMovingAveragePaintlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringantiAliasingEnabledTipText()Returns the tip text for this property.voidcalculate()Calculates the data for the paintlet, doesn't handle the drawing of the overlay.voiddefineOptions()Adds options to the internal list of options.protected voiddrawData(Graphics g)Draw the overlay onto the scatter plot, only calculates the value to position in this method.TechnicalInformationgetTechnicalInformation()Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.intgetWindowSize()Get the Window size for calculating the CenteredMovingAverage overlayStringglobalInfo()Returns a string describing the object.booleanisAntiAliasingEnabled()Returns whether anti-aliasing is used.voidsetAntiAliasingEnabled(boolean value)Sets whether to use anti-aliasing.voidsetWindowSize(int value)Sets the window sizeStringwindowSizeTipText()Returns the tip text for this property.-
Methods inherited from class adams.gui.visualization.stats.paintlet.AbstractOverlayPaintlet
doPerformPaint, getCalculated, getPaintMoment, parameters, setCalculated, setIndicator
-
Methods inherited from class adams.gui.visualization.stats.paintlet.AbstractColorPaintlet
colorTipText, getColor, getData, setColor, setData
-
Methods inherited from class adams.gui.visualization.core.AbstractStrokePaintlet
applyStroke, getStrokeThickness, getStrokeWidth, performPaint, setStrokeThickness, strokeThicknessTipText
-
Methods inherited from class adams.gui.visualization.core.AbstractPaintlet
canPaint, finishInit, forCommandLine, forName, getPaintlets, getPanel, getPlot, getRepaintOnChange, hasPanel, initialize, isEnabled, isInitializing, memberChanged, memberChanged, paint, repaint, setEnabled, setPanel, setPanel, setRepaintOnChange, shallowCopy, shallowCopy, updatePanel
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, reset, toCommandLine, toString
-
Methods inherited from class adams.core.logging.CustomLoggingLevelObject
setLoggingLevel
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractColorPaintlet
-
getTechnicalInformation
public TechnicalInformation getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.- Specified by:
getTechnicalInformationin interfaceTechnicalInformationHandler- Returns:
- the technical information about this class
-
setWindowSize
public void setWindowSize(int value)
Sets the window size- Overrides:
setWindowSizein classAbstractOverlayPaintlet- Parameters:
value- int size of window
-
getWindowSize
public int getWindowSize()
Get the Window size for calculating the CenteredMovingAverage overlay- Returns:
- Number of data points in window
-
windowSizeTipText
public String windowSizeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setAntiAliasingEnabled
public void setAntiAliasingEnabled(boolean value)
Sets whether to use anti-aliasing.- Specified by:
setAntiAliasingEnabledin interfaceAntiAliasingSupporter- Parameters:
value- if true then anti-aliasing is used
-
isAntiAliasingEnabled
public boolean isAntiAliasingEnabled()
Returns whether anti-aliasing is used.- Specified by:
isAntiAliasingEnabledin interfaceAntiAliasingSupporter- Returns:
- true if anti-aliasing is used
-
antiAliasingEnabledTipText
public String antiAliasingEnabledTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
calculate
public void calculate()
Calculates the data for the paintlet, doesn't handle the drawing of the overlay. Sometimes just initializes the axispanels- Overrides:
calculatein classAbstractOverlayPaintlet
-
drawData
protected void drawData(Graphics g)
Draw the overlay onto the scatter plot, only calculates the value to position in this method.- Specified by:
drawDatain classAbstractOverlayPaintlet- Parameters:
g- Graphics drawn on
-
-