Package adams.gui.visualization.sequence
Class LinePaintlet
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,ShallowCopySupporter<Paintlet>
,SizeOfHandler
,AntiAliasingSupporter
,Paintlet
,PaintletWithMarkers
,HitDetectorSupporter<AbstractXYSequencePointHitDetector>
,PaintletWithCustomDataSupport
,PaintletWithOptionalPointPreprocessor
,XYSequencePaintlet
,XYSequencePaintletWithCustomerContainerManager
,Serializable
- Direct Known Subclasses:
IncrementalSumPaintlet
public class LinePaintlet extends AbstractXYSequencePaintlet implements AntiAliasingSupporter, PaintletWithCustomDataSupport, PaintletWithMarkers
A paintlet for painting a line plot of a sequence.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LinePaintlet.MarkerShape
Enum for the marker shape to plot around the data points.
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_AlwaysShowMarkers
whether to show markers all the time.protected boolean
m_AntiAliasingEnabled
whether anti-aliasing is enabled.protected int
m_MarkerExtent
the maximum width/height of the shape to plot around the points (= data point marker), if there's enough space.protected boolean
m_MarkersEnabled
indicates whether marker shapes are painted or not.protected boolean
m_PaintAll
whether to paint all the data points (no optimization).-
Fields inherited from class adams.gui.visualization.sequence.AbstractXYSequencePaintlet
m_CustomerContainerManager, m_HitDetector, m_PointPreprocessor
-
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 LinePaintlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
alwaysShowMarkersTipText()
Returns the tip text for this property.String
antiAliasingEnabledTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.void
doDrawCustomData(Graphics g, PaintEvent.PaintMoment moment, XYSequence data, Color color)
Draws the custom data with the given color.protected void
doPerformPaint(Graphics g, PaintEvent.PaintMoment moment)
The paint routine of the paintlet.void
drawCustomData(Graphics g, PaintEvent.PaintMoment moment, XYSequence data, Color color)
Draws the data with the given color.protected void
drawData(Graphics g, PaintEvent.PaintMoment moment, XYSequence data, Color color, LinePaintlet.MarkerShape marker)
Draws the data with the given color.boolean
getAlwaysShowMarkers()
Returns whether marker shapes are always drawn.int
getMarkerExtent()
Returns the current marker extent (which is the width and height of the shape).protected LinePaintlet.MarkerShape
getMarkerShape(int index)
Determines the shape to paint around the data points, based on the index of the data.boolean
getPaintAll()
Returns whether marker shapes are disabled.String
globalInfo()
Returns a string describing the object.boolean
isAntiAliasingEnabled()
Returns whether anti-aliasing is used.boolean
isMarkersDisabled()
Returns whether marker shapes are disabled.String
markerExtentTipText()
Returns the tip text for this property.String
markersDisabledTipText()
Returns the tip text for this property.AbstractXYSequencePointHitDetector
newHitDetector()
Returns a new instance of the hit detector to use.String
paintAllTipText()
Returns the tip text for this property.void
setAlwaysShowMarkers(boolean value)
Sets whether to always draw markers.void
setAntiAliasingEnabled(boolean value)
Sets whether to use anti-aliasing.void
setMarkerExtent(int value)
Sets the extent (width and height of the shape around the plotted point).void
setMarkersDisabled(boolean value)
Sets whether to draw markers or not.void
setPaintAll(boolean value)
Sets whether to draw markers or not.-
Methods inherited from class adams.gui.visualization.sequence.AbstractXYSequencePaintlet
getActualContainerManager, getColor, getCustomerContainerManager, getHitDetector, getPaintMoment, getPointPreprocessor, getSequencePanel, initialize, memberChanged, newPointPreprocessor, pointPreprocessorTipText, setCustomContainerManager, setLoggingLevel, setPanel, setPointPreprocessor, supportsPointPreprocessor, updateHitDetector
-
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, paint, repaint, setEnabled, 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.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
-
Methods inherited from interface adams.gui.visualization.core.Paintlet
canPaint, getPaintMoment, getPanel, getPlot, getRepaintOnChange, hasPanel, isEnabled, paint, performPaint, setEnabled, setPanel, setPanel, setRepaintOnChange
-
Methods inherited from interface adams.core.ShallowCopySupporter
shallowCopy, shallowCopy
-
Methods inherited from interface adams.gui.visualization.sequence.XYSequencePaintlet
getSequencePanel
-
-
-
-
Field Detail
-
m_MarkerExtent
protected int m_MarkerExtent
the maximum width/height of the shape to plot around the points (= data point marker), if there's enough space.
-
m_MarkersEnabled
protected boolean m_MarkersEnabled
indicates whether marker shapes are painted or not.
-
m_AlwaysShowMarkers
protected boolean m_AlwaysShowMarkers
whether to show markers all the time.
-
m_PaintAll
protected boolean m_PaintAll
whether to paint all the data points (no optimization).
-
m_AntiAliasingEnabled
protected boolean m_AntiAliasingEnabled
whether anti-aliasing is enabled.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractXYSequencePaintlet
-
newHitDetector
public AbstractXYSequencePointHitDetector newHitDetector()
Returns a new instance of the hit detector to use.- Specified by:
newHitDetector
in interfaceXYSequencePaintlet
- Specified by:
newHitDetector
in classAbstractXYSequencePaintlet
- Returns:
- the hit detector
-
isMarkersDisabled
public boolean isMarkersDisabled()
Returns whether marker shapes are disabled.- Specified by:
isMarkersDisabled
in interfacePaintletWithMarkers
- Returns:
- true if marker shapes are disabled
-
setMarkersDisabled
public void setMarkersDisabled(boolean value)
Sets whether to draw markers or not.- Specified by:
setMarkersDisabled
in interfacePaintletWithMarkers
- Parameters:
value
- if true then marker shapes won't be drawn
-
markersDisabledTipText
public String markersDisabledTipText()
Returns the tip text for this property.- Specified by:
markersDisabledTipText
in interfacePaintletWithMarkers
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getAlwaysShowMarkers
public boolean getAlwaysShowMarkers()
Returns whether marker shapes are always drawn.- Specified by:
getAlwaysShowMarkers
in interfacePaintletWithMarkers
- Returns:
- true if marker shapes are always drawn, not just when zoomed in
-
setAlwaysShowMarkers
public void setAlwaysShowMarkers(boolean value)
Sets whether to always draw markers.- Specified by:
setAlwaysShowMarkers
in interfacePaintletWithMarkers
- Parameters:
value
- if true then marker are always drawn, not just when zoomed in
-
alwaysShowMarkersTipText
public String alwaysShowMarkersTipText()
Returns the tip text for this property.- Specified by:
alwaysShowMarkersTipText
in interfacePaintletWithMarkers
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setMarkerExtent
public void setMarkerExtent(int value)
Sets the extent (width and height of the shape around the plotted point). 0 turns the plotting off. Should be an odd number for centering the shape.- Specified by:
setMarkerExtent
in interfacePaintletWithMarkers
- Parameters:
value
- the new extent
-
getMarkerExtent
public int getMarkerExtent()
Returns the current marker extent (which is the width and height of the shape).- Specified by:
getMarkerExtent
in interfacePaintletWithMarkers
- Returns:
- the current extent
-
markerExtentTipText
public String markerExtentTipText()
Returns the tip text for this property.- Specified by:
markerExtentTipText
in interfacePaintletWithMarkers
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getPaintAll
public boolean getPaintAll()
Returns whether marker shapes are disabled.- Returns:
- true if marker shapes are disabled
-
setPaintAll
public void setPaintAll(boolean value)
Sets whether to draw markers or not.- Parameters:
value
- if true then marker shapes won't be drawn
-
paintAllTipText
public String paintAllTipText()
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:
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.
-
doDrawCustomData
public void doDrawCustomData(Graphics g, PaintEvent.PaintMoment moment, XYSequence data, Color color)
Draws the custom data with the given color.- Parameters:
g
- the graphics contextmoment
- the paint momentdata
- the data to drawcolor
- the color to draw in
-
drawCustomData
public void drawCustomData(Graphics g, PaintEvent.PaintMoment moment, XYSequence data, Color color)
Draws the data with the given color.- Specified by:
drawCustomData
in interfacePaintletWithCustomDataSupport
- Parameters:
g
- the graphics contextmoment
- the paint momentdata
- the data to drawcolor
- the color to draw in
-
drawData
protected void drawData(Graphics g, PaintEvent.PaintMoment moment, XYSequence data, Color color, LinePaintlet.MarkerShape marker)
Draws the data with the given color.- Parameters:
g
- the graphics contextmoment
- the paint momentdata
- the data to drawcolor
- the color to draw inmarker
- the type of marker to draw
-
getMarkerShape
protected LinePaintlet.MarkerShape getMarkerShape(int index)
Determines the shape to paint around the data points, based on the index of the data.- Parameters:
index
- the index of the spectrum- Returns:
- the marker shape
-
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
-
-