|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.eclipse.swt.widgets.Canvas
org.eclipse.nebula.widgets.oscilloscope.Oscilloscope
public class Oscilloscope
Animated widget that tries to mimic an Oscilloscope. An oscilloscope (also known as a scope, CRO or, an O-scope) is a type of electronic test instrument that allows observation of constantly varying signal voltages, usually as a two-dimensional graph of one or more electrical potential differences using the vertical or 'Y' axis, plotted as a function of time, (horizontal or 'x' axis).
https://en.wikipedia.org/ wiki/Oscilloscope
Nested Class Summary | |
---|---|
class |
Oscilloscope.IntegerFiFoCircularStack
The stack will not overflow if you push too many values into it but it will rotate and overwrite the older values. |
Field Summary | |
---|---|
static int |
BASE_CENTER
The base of the line is positioned at the center of the widget. |
static int |
DEFAULT_HEIGHT
The default comfortable widget height. |
static int |
DEFAULT_TAILFADE
The default amount of tail fading in percentages. |
static int |
DEFAULT_WIDTH
The default comfortable widget width. |
static int[] |
HEARTBEAT
This set of values will draw a figure that is similar to the heart beat that you see on hospital monitors. |
static int |
STEADYPOSITION_75PERCENT
Steady position @ 75% of graph. |
static int |
TAILSIZE_DEFAULT
The default tail size is 75% of the width. |
static int |
TAILSIZE_FILL
Will draw a tail from the left border but is only valid if the boolean in setSteady(boolean, int) was set to true, will default to
TAILSIZE_MAX otherwise. |
static int |
TAILSIZE_MAX
Will draw a maximum tail. |
Fields inherited from class org.eclipse.swt.widgets.Control |
---|
handle |
Constructor Summary | |
---|---|
Oscilloscope(org.eclipse.swt.widgets.Composite parent,
int style)
Creates a new Oscilloscope. |
Method Summary | |
---|---|
void |
addStackListener(OscilloscopeStackAdapter listener)
Adds a new stack listener to the collection of stack listeners. |
org.eclipse.swt.graphics.Point |
computeSize(int wHint,
int hHint,
boolean changed)
|
int |
getBase()
|
int |
getBaseOffset()
Gets the relative location where the line is drawn in the widget. |
int |
getLineWidth()
|
int |
getProgression()
|
int |
getTailFade()
gets the percentage of tail that must be faded out. |
int |
getTailSize()
Returns the size of the tail. |
boolean |
isConnect()
|
boolean |
isFade()
|
boolean |
isPercentage()
|
boolean |
isSteady()
|
boolean |
needsRedraw()
|
void |
removeStackListener(OscilloscopeStackAdapter listener)
Removes a stack listener from the collection of stack listeners. |
void |
setBaseOffset(int baseOffset)
Gets the relative location where the line is drawn in the widget, the default is BASE_CENTER which is in the middle of the scope. |
void |
setConnect(boolean connectHeadAndTail)
Connects head and tail only if tail size is TAILSIZE_MAX and no
fading. |
void |
setFade(boolean fade)
Sets fade mode so that a percentage of the tail will be faded out at the costs of extra CPU utilization (no beauty without pain or as the Dutch say: "Wie mooi wil gaan moet pijn doorstaan"). |
void |
setLineWidth(int lineWidth)
Sets the line width. |
void |
setPercentage(boolean percentage)
If set to true then the values are treated as percentages of the available space rather than absolute values. |
void |
setProgression(int progression)
The number of internal steps that must be made before drawing. |
void |
setSteady(boolean steady,
int steadyPosition)
If steady is true the graph will draw on a steady position instead of advancing. |
void |
setTailFade(int tailFade)
Sets the percentage of tail that must be faded out. |
void |
setTailSize(int size)
The tail size defaults to TAILSIZE_DEFAULT which is 75% of the width. |
void |
setValue(int value)
Sets a value to be drawn relative to the middle of the widget. |
void |
setValues(int[] values)
Set a bunch of values that will be drawn. |
Methods inherited from class org.eclipse.swt.widgets.Canvas |
---|
drawBackground, getCaret, getIME, scroll, setCaret, setFont, setIME |
Methods inherited from class org.eclipse.swt.widgets.Composite |
---|
changed, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList |
Methods inherited from class org.eclipse.swt.widgets.Scrollable |
---|
computeTrim, getClientArea, getHorizontalBar, getVerticalBar |
Methods inherited from class org.eclipse.swt.widgets.Control |
---|
addControlListener, addDragDetectListener, addFocusListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getRegion, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setRegion, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update |
Methods inherited from class org.eclipse.swt.widgets.Widget |
---|
addDisposeListener, addListener, dispose, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, reskin, setData, setData, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_WIDTH
public static final int DEFAULT_HEIGHT
public static final int DEFAULT_TAILFADE
public static final int[] HEARTBEAT
public static final int TAILSIZE_MAX
public static final int TAILSIZE_FILL
setSteady(boolean, int)
was set to true, will default to
TAILSIZE_MAX
otherwise.
public static final int TAILSIZE_DEFAULT
public static final int STEADYPOSITION_75PERCENT
public static final int BASE_CENTER
setBaseOffset(int)
,
Constant Field ValuesConstructor Detail |
---|
public Oscilloscope(org.eclipse.swt.widgets.Composite parent, int style)
parent
- style
- Method Detail |
---|
public int getTailSize()
setTailSize(int)
,
TAILSIZE_DEFAULT
,
TAILSIZE_FILL
,
TAILSIZE_MAX
public int getBaseOffset()
public void setBaseOffset(int baseOffset)
BASE_CENTER
which is in the middle of the scope.
baseOffset
- must be between 0 and 0, exceeding values are rounded to the
closest allowable value.public int getBase()
public int getProgression()
setProgression(int)
public void setProgression(int progression)
progression
- public boolean isConnect()
TAILSIZE_MAX
no fading graph.public void setConnect(boolean connectHeadAndTail)
TAILSIZE_MAX
and no
fading.
connectHeadAndTail
- public boolean isFade()
setFade(boolean)
public void setFade(boolean fade)
GC.drawPolygon(int[])
routine which does not support
alpha blending.
In addition to this, set the percentage of tail that must be faded out
setTailFade(int)
.
fade
- true or falsesetTailFade(int)
public int getTailFade()
setFade(boolean)
public boolean isSteady()
setSteady(boolean, int)
public void setValues(int[] values)
values
- public void setValue(int value)
value
- public void setTailSize(int size)
size
- the size of the tailgetTailSize()
,
TAILSIZE_DEFAULT
,
TAILSIZE_FILL
,
TAILSIZE_MAX
public org.eclipse.swt.graphics.Point computeSize(int wHint, int hHint, boolean changed)
computeSize
in class org.eclipse.swt.widgets.Composite
public boolean needsRedraw()
public void setLineWidth(int lineWidth)
lineWidth
- public int getLineWidth()
setLineWidth(int)
public void setPercentage(boolean percentage)
percentage
- true if percentagespublic boolean isPercentage()
setPercentage(boolean)
public void setSteady(boolean steady, int steadyPosition)
steady
- steadyPosition
- public void setTailFade(int tailFade)
tailFade
- public void addStackListener(OscilloscopeStackAdapter listener)
listener
- public void removeStackListener(OscilloscopeStackAdapter listener)
listener
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |