Package adams.gui.visualization.spectrum
Class SpectrumPaintletStringField
- 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.container.AbstractDataContainerPaintlet
-
- adams.gui.visualization.spectrum.AbstractSpectrumPaintlet
-
- adams.gui.visualization.spectrum.SpectrumPaintlet
-
- adams.gui.visualization.spectrum.SpectrumPaintletStringField
-
- All Implemented Interfaces:
adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.ShallowCopySupporter<adams.gui.visualization.core.Paintlet>
,adams.core.SizeOfHandler
,adams.gui.core.AntiAliasingSupporter
,adams.gui.visualization.core.ColorProviderHandler
,adams.gui.visualization.core.Paintlet
,adams.gui.visualization.core.PaintletWithMarkers
,Serializable
public class SpectrumPaintletStringField extends SpectrumPaintlet implements adams.gui.visualization.core.ColorProviderHandler
Paintlet for painting the spectral graph. Colors are determined by the value extracted from the specified string field in the report.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class adams.gui.visualization.spectrum.SpectrumPaintlet
SpectrumPaintlet.MarkerShape
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_REGEXP
the default regular expression.protected adams.gui.visualization.core.ColorProvider
m_ColorProvider
the color provider to use.protected Color
m_DefaultColor
the default color if field is missing.protected adams.data.report.Field
m_Field
the report field to get the string value from.protected adams.core.base.BaseRegExp
m_RegExp
the regular expression to apply (extracts first group).-
Fields inherited from class adams.gui.visualization.spectrum.SpectrumPaintlet
m_AlwaysShowMarkers, m_AntiAliasingEnabled, m_MarkerExtent, m_MarkersEnabled, m_PaintAll
-
-
Constructor Summary
Constructors Constructor Description SpectrumPaintletStringField()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
colorProviderTipText()
Returns the tip text for this property.String
defaultColorTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.String
fieldTipText()
Returns the tip text for this property.Color
getColor(int index)
Returns the color for the data with the given index.adams.gui.visualization.core.ColorProvider
getColorProvider()
Returns the color provider in use.Color
getDefaultColor()
Returns the default color to use when then report field is missing or invalid.adams.data.report.Field
getField()
Returns the string field to determine the color with.adams.core.base.BaseRegExp
getRegExp()
Returns regular expression to apply to the string field; the string obtained from the first group is associated with a color.String
globalInfo()
Returns a string describing the object.String
regExpTipText()
Returns the tip text for this property.void
setColorProvider(adams.gui.visualization.core.ColorProvider value)
Sets the color provider to use.void
setDefaultColor(Color value)
Sets the default color to use when then report field is missing or invalid.void
setField(adams.data.report.Field value)
Sets the string field to determine the color with.void
setRegExp(adams.core.base.BaseRegExp value)
Sets regular expression to apply to the string field; the string obtained from the first group is associated with a color.-
Methods inherited from class adams.gui.visualization.spectrum.SpectrumPaintlet
alwaysShowMarkersTipText, antiAliasingEnabledTipText, doPerformPaint, drawData, getAlwaysShowMarkers, getMarkerExtent, getMarkerShape, getPaintAll, getPaintMoment, getSpectrumPanel, isAntiAliasingEnabled, isMarkersDisabled, markerExtentTipText, markersDisabledTipText, paintAllTipText, setAlwaysShowMarkers, setAntiAliasingEnabled, setMarkerExtent, setMarkersDisabled, setPaintAll
-
Methods inherited from class adams.gui.visualization.spectrum.AbstractSpectrumPaintlet
getSequencePanel
-
Methods inherited from class adams.gui.visualization.container.AbstractDataContainerPaintlet
getDataContainerPanel
-
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, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
DEFAULT_REGEXP
public static final String DEFAULT_REGEXP
the default regular expression.- See Also:
- Constant Field Values
-
m_Field
protected adams.data.report.Field m_Field
the report field to get the string value from.
-
m_RegExp
protected adams.core.base.BaseRegExp m_RegExp
the regular expression to apply (extracts first group).
-
m_ColorProvider
protected adams.gui.visualization.core.ColorProvider m_ColorProvider
the color provider to use.
-
m_DefaultColor
protected Color m_DefaultColor
the default color if field is missing.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceadams.core.GlobalInfoSupporter
- Overrides:
globalInfo
in classSpectrumPaintlet
- 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 interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classSpectrumPaintlet
-
setField
public void setField(adams.data.report.Field value)
Sets the string field to determine the color with.- Parameters:
value
- the string field
-
getField
public adams.data.report.Field getField()
Returns the string field to determine the color with.- Returns:
- the string field
-
fieldTipText
public String fieldTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setRegExp
public void setRegExp(adams.core.base.BaseRegExp value)
Sets regular expression to apply to the string field; the string obtained from the first group is associated with a color.- Parameters:
value
- the expression
-
getRegExp
public adams.core.base.BaseRegExp getRegExp()
Returns regular expression to apply to the string field; the string obtained from the first group is associated with a color.- Returns:
- the expression
-
regExpTipText
public String regExpTipText()
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(adams.gui.visualization.core.ColorProvider value)
Sets the color provider to use.- Specified by:
setColorProvider
in interfaceadams.gui.visualization.core.ColorProviderHandler
- Parameters:
value
- the color provider
-
getColorProvider
public adams.gui.visualization.core.ColorProvider getColorProvider()
Returns the color provider in use.- Specified by:
getColorProvider
in interfaceadams.gui.visualization.core.ColorProviderHandler
- Returns:
- the color provider
-
colorProviderTipText
public String colorProviderTipText()
Returns the tip text for this property.- Specified by:
colorProviderTipText
in interfaceadams.gui.visualization.core.ColorProviderHandler
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setDefaultColor
public void setDefaultColor(Color value)
Sets the default color to use when then report field is missing or invalid.- Parameters:
value
- the color
-
getDefaultColor
public Color getDefaultColor()
Returns the default color to use when then report field is missing or invalid.- Returns:
- the color
-
defaultColorTipText
public String defaultColorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getColor
public Color getColor(int index)
Returns the color for the data with the given index.- Overrides:
getColor
in classSpectrumPaintlet
- Parameters:
index
- the index of the spectrum- Returns:
- the color for the spectrum
-
-