Class Jitter
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.visualization.sequence.pointpreprocessor.AbstractPointPreprocessor
-
- adams.gui.visualization.sequence.pointpreprocessor.Jitter
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,Randomizable
,SizeOfHandler
,PointPreprocessor
,Serializable
public class Jitter extends AbstractPointPreprocessor implements Randomizable
Adds random jitter to data points, to make it easier to see overlapping ones.- 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
Jitter.Direction
In which direction to apply the jitter.
-
Field Summary
Fields Modifier and Type Field Description protected Jitter.Direction
m_Direction
the direction to apply the jitter to.protected int
m_Max
the maximum jitter in pixels.protected int
m_Min
the minimum jitter in pixels.protected Random
m_Random
the random number generator.protected int
m_Range
the range of the jitter.protected long
m_Seed
the seed.-
Fields inherited from class adams.gui.visualization.sequence.pointpreprocessor.AbstractPointPreprocessor
m_Enabled
-
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 Jitter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.String
directionTipText()
Returns the tip text for this property.protected XYSequencePoint
doPreprocess(XYSequencePoint point, AxisPanel axisX, AxisPanel axisY)
Preprocesses the point.Jitter.Direction
getDirection()
Returns the direction of the jitter.int
getMax()
Returns the maximum jitter to apply.int
getMin()
Returns the minimum jitter to apply.long
getSeed()
Returns the seed value.String
globalInfo()
Returns a string describing the object.String
maxTipText()
Returns the tip text for this property.String
minTipText()
Returns the tip text for this property.protected void
reset()
Resets the scheme.void
resetPreprocessor()
Resets the processor for another sequence.String
seedTipText()
Returns the tip text for this property.void
setDirection(Jitter.Direction value)
Sets the direction of the jitter.void
setMax(int value)
Sets the maximum jitter to apply.void
setMin(int value)
Sets the minimum jitter to apply.void
setSeed(long value)
Sets the seed value.-
Methods inherited from class adams.gui.visualization.sequence.pointpreprocessor.AbstractPointPreprocessor
enabledTipText, isEnabled, preprocess, setEnabled
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, 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
-
-
-
-
Field Detail
-
m_Seed
protected long m_Seed
the seed.
-
m_Min
protected int m_Min
the minimum jitter in pixels.
-
m_Max
protected int m_Max
the maximum jitter in pixels.
-
m_Direction
protected Jitter.Direction m_Direction
the direction to apply the jitter to.
-
m_Random
protected Random m_Random
the random number generator.
-
m_Range
protected int m_Range
the range of the jitter.
-
-
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 classAbstractPointPreprocessor
-
reset
protected void reset()
Resets the scheme.- Overrides:
reset
in classAbstractOptionHandler
-
setSeed
public void setSeed(long value)
Sets the seed value.- Specified by:
setSeed
in interfaceRandomizable
- Parameters:
value
- the seed
-
getSeed
public long getSeed()
Returns the seed value.- Specified by:
getSeed
in interfaceRandomizable
- Returns:
- the seed
-
seedTipText
public String seedTipText()
Returns the tip text for this property.- Specified by:
seedTipText
in interfaceRandomizable
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setMin
public void setMin(int value)
Sets the minimum jitter to apply.- Parameters:
value
- the minimum
-
getMin
public int getMin()
Returns the minimum jitter to apply.- Returns:
- the minimum
-
minTipText
public String minTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setMax
public void setMax(int value)
Sets the maximum jitter to apply.- Parameters:
value
- the maximum
-
getMax
public int getMax()
Returns the maximum jitter to apply.- Returns:
- the maximum
-
maxTipText
public String maxTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setDirection
public void setDirection(Jitter.Direction value)
Sets the direction of the jitter.- Parameters:
value
- the direction
-
getDirection
public Jitter.Direction getDirection()
Returns the direction of the jitter.- Returns:
- the direction
-
directionTipText
public String directionTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
resetPreprocessor
public void resetPreprocessor()
Resets the processor for another sequence.- Specified by:
resetPreprocessor
in interfacePointPreprocessor
- Overrides:
resetPreprocessor
in classAbstractPointPreprocessor
-
doPreprocess
protected XYSequencePoint doPreprocess(XYSequencePoint point, AxisPanel axisX, AxisPanel axisY)
Preprocesses the point.- Specified by:
doPreprocess
in classAbstractPointPreprocessor
- Parameters:
point
- the point to processaxisX
- the X axis to useaxisY
- the Y axis to use- Returns:
- the new point
-
-