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 classJitter.DirectionIn which direction to apply the jitter.
-
Field Summary
Fields Modifier and Type Field Description protected Jitter.Directionm_Directionthe direction to apply the jitter to.protected intm_Maxthe maximum jitter in pixels.protected intm_Minthe minimum jitter in pixels.protected Randomm_Randomthe random number generator.protected intm_Rangethe range of the jitter.protected longm_Seedthe 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 voiddefineOptions()Adds options to the internal list of options.StringdirectionTipText()Returns the tip text for this property.protected XYSequencePointdoPreprocess(XYSequencePoint point, AxisPanel axisX, AxisPanel axisY)Preprocesses the point.Jitter.DirectiongetDirection()Returns the direction of the jitter.intgetMax()Returns the maximum jitter to apply.intgetMin()Returns the minimum jitter to apply.longgetSeed()Returns the seed value.StringglobalInfo()Returns a string describing the object.StringmaxTipText()Returns the tip text for this property.StringminTipText()Returns the tip text for this property.protected voidreset()Resets the scheme.voidresetPreprocessor()Resets the processor for another sequence.StringseedTipText()Returns the tip text for this property.voidsetDirection(Jitter.Direction value)Sets the direction of the jitter.voidsetMax(int value)Sets the maximum jitter to apply.voidsetMin(int value)Sets the minimum jitter to apply.voidsetSeed(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:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractPointPreprocessor
-
reset
protected void reset()
Resets the scheme.- Overrides:
resetin classAbstractOptionHandler
-
setSeed
public void setSeed(long value)
Sets the seed value.- Specified by:
setSeedin interfaceRandomizable- Parameters:
value- the seed
-
getSeed
public long getSeed()
Returns the seed value.- Specified by:
getSeedin interfaceRandomizable- Returns:
- the seed
-
seedTipText
public String seedTipText()
Returns the tip text for this property.- Specified by:
seedTipTextin 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:
resetPreprocessorin interfacePointPreprocessor- Overrides:
resetPreprocessorin classAbstractPointPreprocessor
-
doPreprocess
protected XYSequencePoint doPreprocess(XYSequencePoint point, AxisPanel axisX, AxisPanel axisY)
Preprocesses the point.- Specified by:
doPreprocessin classAbstractPointPreprocessor- Parameters:
point- the point to processaxisX- the X axis to useaxisY- the Y axis to use- Returns:
- the new point
-
-