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 boolean
m_AntiAliasingEnabled
whether anti-aliasing is enabled.protected AxisPanel
m_AxisBottom
x axis of plotprotected AxisPanel
m_AxisLeft
y axis of plotprotected String[]
m_ColorData
the values of the coloring axis.protected int
m_ColorIndex
the index of the categorical attriute for the coloring.protected Map<String,Color>
m_ColorMapping
the value - color association.protected ColorProvider
m_ColorProvider
the color provider for the coloring.protected AbstractScatterPlotHitDetector
m_HitDetector
the hit detector to use.protected int
m_Size
size of the plot pointsprotected double[]
m_XData
Data to display on the x axisprotected int
m_XIndex
index of attribute for x axisprotected double[]
m_YData
Data to display on the y axisprotected int
m_YIndex
Index 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 String
antiAliasingEnabledTipText()
Returns the tip text for this property.String
colorProviderTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.protected void
doPerformPaint(Graphics g, PaintEvent.PaintMoment moment)
The paint routine of the paintlet.protected void
drawData(Graphics g)
draws the data on the graphics objectprotected Color
getActualColor(int index, Color defColor)
Returns the actual color to use.int
getColorIndex()
Get index of chosen attribute for color.ColorProvider
getColorProvider()
Returns the color provider to use when using a column for the plot colors.AbstractScatterPlotHitDetector
getHitDetector()
Returns the hit detector to use for this paintlet.PaintEvent.PaintMoment
getPaintMoment()
Returns when this paintlet is to be executed.int
getXIndex()
get index of chosen attribute for x axisint
getYIndex()
Get index of chosen attribute for y axisprotected void
initialize()
Initializes the members.boolean
isAntiAliasingEnabled()
Returns whether anti-aliasing is used.AbstractScatterPlotHitDetector
newHitDetector()
Returns a new instance of the hit detector to use.protected void
reset()
Resets the scheme.void
setAntiAliasingEnabled(boolean value)
Sets whether to use anti-aliasing.void
setColorIndex(int val)
Set the index of attribute for color.void
setColorProvider(ColorProvider value)
Sets the color provider to use when using a column for the plot colors.void
setXIndex(int val)
Set the index of attribute for x axisvoid
setYIndex(int val)
Set the index of attribute for y axisString
toString()
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:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractColorPaintlet
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classAbstractPaintlet
-
reset
protected void reset()
Resets the scheme.- Overrides:
reset
in classAbstractOptionHandler
-
setAntiAliasingEnabled
public void setAntiAliasingEnabled(boolean value)
Sets whether to use anti-aliasing.- Specified by:
setAntiAliasingEnabled
in interfaceAntiAliasingSupporter
- Parameters:
value
- if true then anti-aliasing is used
-
isAntiAliasingEnabled
public boolean isAntiAliasingEnabled()
Returns whether anti-aliasing is used.- Specified by:
isAntiAliasingEnabled
in 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:
setColorProvider
in 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:
getColorProvider
in interfaceColorProviderHandler
- Returns:
- the provider
-
colorProviderTipText
public String colorProviderTipText()
Returns the tip text for this property.- Specified by:
colorProviderTipText
in 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:AbstractPaintlet
Returns when this paintlet is to be executed.- Specified by:
getPaintMoment
in interfacePaintlet
- Specified by:
getPaintMoment
in 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:
doPerformPaint
in classAbstractStrokePaintlet
- Parameters:
g
- the graphics context to use for paintingmoment
- whatPaintEvent.PaintMoment
is currently being painted
-
toString
public String toString()
Returns info on scatterpaintlet object- Overrides:
toString
in 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:
getHitDetector
in interfaceHitDetectorSupporter<AbstractScatterPlotHitDetector>
- Returns:
- the detector
-
-