Class AbstractScatterPlotPaintlet
- 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.AbstractScatterPlotPaintlet
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,ShallowCopySupporter<Paintlet>,SizeOfHandler,AntiAliasingSupporter,ColorProviderHandler,Paintlet,HitDetectorSupporter<AbstractScatterPlotHitDetector>,Serializable
- Direct Known Subclasses:
ScatterPaintletCircle,ScatterPaintletCross,ScatterPaintletErrors,ScatterPaintletMetaDataValue
public abstract class AbstractScatterPlotPaintlet extends AbstractColorPaintlet implements AntiAliasingSupporter, HitDetectorSupporter<AbstractScatterPlotHitDetector>, ColorProviderHandler
Abstract class for creating scatterplot paintlets.- Author:
- msf8
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanm_AntiAliasingEnabledwhether anti-aliasing is enabled.protected AxisPanelm_AxisBottomx axis of plotprotected AxisPanelm_AxisLefty axis of plotprotected String[]m_ColorDatathe values of the coloring axis.protected intm_ColorIndexthe index of the categorical attriute for the coloring.protected Map<String,Color>m_ColorMappingthe value - color association.protected ColorProviderm_ColorProviderthe color provider for the coloring.protected AbstractScatterPlotHitDetectorm_HitDetectorthe hit detector to use.protected intm_Sizesize of the plot pointsprotected double[]m_XDataData to display on the x axisprotected intm_XIndexindex of attribute for x axisprotected double[]m_YDataData to display on the y axisprotected intm_YIndexIndex of attribute for y axis-
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 AbstractScatterPlotPaintlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringantiAliasingEnabledTipText()Returns the tip text for this property.StringcolorProviderTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.protected voiddoPerformPaint(Graphics g, PaintEvent.PaintMoment moment)The paint routine of the paintlet.protected voiddrawData(Graphics g)draws the data on the graphics objectprotected ColorgetActualColor(int index, Color defColor)Returns the actual color to use.intgetColorIndex()Get index of chosen attribute for color.ColorProvidergetColorProvider()Returns the color provider to use when using a column for the plot colors.AbstractScatterPlotHitDetectorgetHitDetector()Returns the hit detector to use for this paintlet.PaintEvent.PaintMomentgetPaintMoment()Returns when this paintlet is to be executed.intgetXIndex()get index of chosen attribute for x axisintgetYIndex()Get index of chosen attribute for y axisprotected voidinitialize()Initializes the members.booleanisAntiAliasingEnabled()Returns whether anti-aliasing is used.AbstractScatterPlotHitDetectornewHitDetector()Returns a new instance of the hit detector to use.protected voidreset()Resets the scheme.voidsetAntiAliasingEnabled(boolean value)Sets whether to use anti-aliasing.voidsetColorIndex(int val)Set the index of attribute for color.voidsetColorProvider(ColorProvider value)Sets the color provider to use when using a column for the plot colors.voidsetXIndex(int val)Set the index of attribute for x axisvoidsetYIndex(int val)Set the index of attribute for y axisStringtoString()Returns info on scatterpaintlet object-
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, 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, globalInfo, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine
-
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
-
-
-
-
Field Detail
-
m_XIndex
protected int m_XIndex
index of attribute for x axis
-
m_YIndex
protected int m_YIndex
Index of attribute for y axis
-
m_ColorIndex
protected int m_ColorIndex
the index of the categorical attriute for the coloring.
-
m_Size
protected int m_Size
size of the plot points
-
m_XData
protected double[] m_XData
Data to display on the x axis
-
m_YData
protected double[] m_YData
Data to display on the y axis
-
m_ColorData
protected String[] m_ColorData
the values of the coloring axis.
-
m_ColorProvider
protected ColorProvider m_ColorProvider
the color provider for the coloring.
-
m_AxisLeft
protected AxisPanel m_AxisLeft
y axis of plot
-
m_AxisBottom
protected AxisPanel m_AxisBottom
x axis of plot
-
m_AntiAliasingEnabled
protected boolean m_AntiAliasingEnabled
whether anti-aliasing is enabled.
-
m_HitDetector
protected AbstractScatterPlotHitDetector m_HitDetector
the hit detector to use.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractColorPaintlet
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein classAbstractPaintlet
-
reset
protected void reset()
Resets the scheme.- Overrides:
resetin classAbstractOptionHandler
-
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.
-
setColorProvider
public void setColorProvider(ColorProvider value)
Sets the color provider to use when using a column for the plot colors.- Specified by:
setColorProviderin interfaceColorProviderHandler- Parameters:
value- the provider
-
getColorProvider
public ColorProvider getColorProvider()
Returns the color provider to use when using a column for the plot colors.- Specified by:
getColorProviderin interfaceColorProviderHandler- Returns:
- the provider
-
colorProviderTipText
public String colorProviderTipText()
Returns the tip text for this property.- Specified by:
colorProviderTipTextin interfaceColorProviderHandler- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getPaintMoment
public PaintEvent.PaintMoment getPaintMoment()
Description copied from class:AbstractPaintletReturns when this paintlet is to be executed.- Specified by:
getPaintMomentin interfacePaintlet- Specified by:
getPaintMomentin classAbstractPaintlet- Returns:
- when this paintlet is to be executed
-
doPerformPaint
protected void doPerformPaint(Graphics g, PaintEvent.PaintMoment moment)
The paint routine of the paintlet.- Specified by:
doPerformPaintin classAbstractStrokePaintlet- Parameters:
g- the graphics context to use for paintingmoment- whatPaintEvent.PaintMomentis currently being painted
-
toString
public String toString()
Returns info on scatterpaintlet object- Overrides:
toStringin classAbstractOptionHandler- Returns:
- a string representation
-
getActualColor
protected Color getActualColor(int index, Color defColor)
Returns the actual color to use. Uses the provided default color if no color mapping active.- Parameters:
index- the row indexdefColor- the default color- Returns:
-
drawData
protected void drawData(Graphics g)
draws the data on the graphics object- Parameters:
g- Graphics object to draw on
-
getXIndex
public int getXIndex()
get index of chosen attribute for x axis- Returns:
- chosen index
-
setXIndex
public void setXIndex(int val)
Set the index of attribute for x axis- Parameters:
val- Index to set
-
getYIndex
public int getYIndex()
Get index of chosen attribute for y axis- Returns:
- chosen index
-
setYIndex
public void setYIndex(int val)
Set the index of attribute for y axis- Parameters:
val- Index to set
-
getColorIndex
public int getColorIndex()
Get index of chosen attribute for color.- Returns:
- chosen index
-
setColorIndex
public void setColorIndex(int val)
Set the index of attribute for color.- Parameters:
val- Index to set
-
newHitDetector
public AbstractScatterPlotHitDetector newHitDetector()
Returns a new instance of the hit detector to use.- Returns:
- the hit detector
-
getHitDetector
public AbstractScatterPlotHitDetector getHitDetector()
Returns the hit detector to use for this paintlet.- Specified by:
getHitDetectorin interfaceHitDetectorSupporter<AbstractScatterPlotHitDetector>- Returns:
- the detector
-
-