public abstract class SnippetDispatcher extends OscilloscopeDispatcher
OscilloscopeDispatcher.SoundClip
BACKGROUND_MONITOR, BACKGROUND_MONITOR_SMALL, NO_PULSE
Constructor | Description |
---|---|
SnippetDispatcher() |
Modifier and Type | Method | Description |
---|---|---|
void |
dispatch(org.eclipse.swt.widgets.Shell shell) |
|
java.io.File |
getActiveSoundfile() |
Override this to return a soundfile that will be played by the dispatcher
in the
OscilloscopeDispatcher.hookPulse(Oscilloscope, int) method if the
OscilloscopeDispatcher.isSoundRequired() method returns true. |
int |
getDelayLoop() |
Override this to return a draw delay in milliseconds.
|
boolean |
getFade() |
Tests if the tail must fade.
|
java.io.File |
getInactiveSoundfile() |
|
int |
getLineWidth() |
|
Oscilloscope |
getOscilloscope() |
This method returns the
Oscilloscope . |
int |
getPulse() |
Returns the heart beat of the scope.
|
int |
getSteadyPosition() |
If the scope value must be drawn on a steady position then this method
can supply a value.
|
int |
getTailFade() |
|
int |
getTailSize() |
|
abstract void |
hookSetValues(int value) |
This method will be called every
OscilloscopeDispatcher.getPulse() times the scope is
redrawn which will occur every OscilloscopeDispatcher.getDelayLoop() milliseconds (if
your hardware is capable of doing so). |
void |
init() |
Will be called only once.
|
boolean |
isPercentage() |
Indicates if the value that comes in from the scope is a percentage
rather than an absolute value.
|
boolean |
isServiceActive() |
A helper method to indicate if something that you are measuring is
active.
|
boolean |
isSoundRequired() |
The dispatcher is able to beep and pling and this method helps in
indicating if this is required.
|
boolean |
isSteady() |
|
boolean |
isTailSizeMax() |
|
boolean |
mustConnect() |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
dispatch, getActiveForegoundColor, getBackgroundImage, getBaseOffset, getChannel, getInactiveForegoundColor, getProgression, getSoundClip, hookAfterDraw, hookBeforeDraw, hookChangeAttributes, hookPulse, isRunning, setOscilloscope, stop
public abstract void hookSetValues(int value)
OscilloscopeDispatcher
OscilloscopeDispatcher.getPulse()
times the scope is
redrawn which will occur every OscilloscopeDispatcher.getDelayLoop()
milliseconds (if
your hardware is capable of doing so). The scope will progress one pixel
every OscilloscopeDispatcher.getDelayLoop()
milliseconds and will draw the next value
from the queue of the scope. If the scope is out of values it will
progress one pixel without a value (draw a pixel at his center).
If the delay loop is 10 and the pulse is 20, you have an opportunity to
set a value in the scope every 200 milliseconds. In this time the scope
will have progressed 20 pixels. If you supply 10 values by calling the
setValue(int) 10 times or if you call the setValues(int[]) with 10 ints
then you will see 10 pixels of movement and a straight line of 10 pixels.
If the setPulse method is not overridden or if you supply
OscilloscopeDispatcher.NO_PULSE
then this method will not be called unless you override
the dispatch method (not recommended). To still set values in the scope
you can set a stack listener in the widget that will be called when there
are no more values in the stack. Alternatively you can set the return
value of OscilloscopeDispatcher.getPulse()
to 1 so you have the opportunity to provide
a value every cycle.hookSetValues
in class OscilloscopeDispatcher
Oscilloscope#setValue(int)
,
Oscilloscope#setValues(int[])
,
Oscilloscope#addStackListener(OscilloscopeStackAdapter)
public void dispatch(org.eclipse.swt.widgets.Shell shell)
public int getLineWidth()
getLineWidth
in class OscilloscopeDispatcher
public void init()
OscilloscopeDispatcher
init
in class OscilloscopeDispatcher
public int getPulse()
OscilloscopeDispatcher
getPulse
in class OscilloscopeDispatcher
OscilloscopeDispatcher.dispatch()
,
OscilloscopeDispatcher.getDelayLoop()
,
OscilloscopeDispatcher.getProgression()
public java.io.File getActiveSoundfile()
OscilloscopeDispatcher
OscilloscopeDispatcher.hookPulse(Oscilloscope, int)
method if the
OscilloscopeDispatcher.isSoundRequired()
method returns true.getActiveSoundfile
in class OscilloscopeDispatcher
null
. Override to return a file that can be played
by your sound hardware.public int getDelayLoop()
OscilloscopeDispatcher
OscilloscopeDispatcher.getProgression()
steps.getDelayLoop
in class OscilloscopeDispatcher
public Oscilloscope getOscilloscope()
OscilloscopeDispatcher
Oscilloscope
.getOscilloscope
in class OscilloscopeDispatcher
public java.io.File getInactiveSoundfile()
getInactiveSoundfile
in class OscilloscopeDispatcher
public boolean isTailSizeMax()
isTailSizeMax
in class OscilloscopeDispatcher
Oscilloscope.setTailSize(int, int)
public boolean isPercentage()
OscilloscopeDispatcher
isPercentage
in class OscilloscopeDispatcher
Oscilloscope.setPercentage(int, boolean)
public boolean isServiceActive()
OscilloscopeDispatcher
isServiceActive
in class OscilloscopeDispatcher
public boolean isSoundRequired()
OscilloscopeDispatcher
isSoundRequired
in class OscilloscopeDispatcher
Oscilloscope.setSteady(int, boolean, int)
public int getTailSize()
getTailSize
in class OscilloscopeDispatcher
Oscilloscope.setTailSize(int, int)
public boolean isSteady()
isSteady
in class OscilloscopeDispatcher
Oscilloscope.setSteady(int, boolean, int)
public int getSteadyPosition()
OscilloscopeDispatcher
getSteadyPosition
in class OscilloscopeDispatcher
Oscilloscope.setSteady(int, boolean, int)
public boolean getFade()
OscilloscopeDispatcher
getFade
in class OscilloscopeDispatcher
Oscilloscope.setTailFade(int, int)
,
OscilloscopeDispatcher.getTailSize()
public int getTailFade()
getTailFade
in class OscilloscopeDispatcher
Oscilloscope.setTailFade(int, int)
public boolean mustConnect()
mustConnect
in class OscilloscopeDispatcher
Oscilloscope.setConnect(int, boolean)