Package org.csstudio.ui.util.widgets
Class RangeWidget
java.lang.Object
org.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.csstudio.ui.util.widgets.RangeWidget
- All Implemented Interfaces:
Drawable
Widget that display a range (currently only time, and only vertical) which can be modified using a mouse drag.
-
Field Summary
Fields inherited from class org.eclipse.swt.widgets.Composite
embeddedHandle
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addRangeListener
(RangeListener listener) Adds a listener, notified if the range resolution changes.double
Distance represented by each pixel (e.g. 10 ms per pixel).int
Whether the range starts at the top or at the bottom.boolean
Whether the use can use the mouse to change the resolution.void
removeRangeListener
(RangeListener listener) void
setDistancePerPx
(double distancePerPx) Changes how much distance is represented by each pixel.void
setEditable
(boolean editable) Changes whether the use can use the mouse to change the resolution.void
setStartPosition
(int startPosition) Determines whether the range start at the top (and goes down) or at the bottom (and goes up).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, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList, toString
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar, setScrollbarsMode
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isAutoScalable, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, addTypedListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, getTypedListeners, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, removeTypedListener, reskin, setData, setData
-
Constructor Details
-
RangeWidget
A new range widget.- Parameters:
parent
- parent componentstyle
- SWT style
-
-
Method Details
-
addRangeListener
Adds a listener, notified if the range resolution changes. -
removeRangeListener
-
setStartPosition
public void setStartPosition(int startPosition) Determines whether the range start at the top (and goes down) or at the bottom (and goes up).- Parameters:
startPosition
- SWT.TOP or SWT.BOTTOM
-
getStartPosition
public int getStartPosition()Whether the range starts at the top or at the bottom.- Returns:
- SWT.TOP or SWT.BOTTOM
-
isEditable
public boolean isEditable()Whether the use can use the mouse to change the resolution.- Returns:
- true if user changes are allowed
-
setEditable
public void setEditable(boolean editable) Changes whether the use can use the mouse to change the resolution.- Parameters:
editable
- true if user changes are allowed
-
setDistancePerPx
public void setDistancePerPx(double distancePerPx) Changes how much distance is represented by each pixel. For example, 1 ms per pixel or 20 seconds per pixel. The distance is expressed in seconds.- Parameters:
distancePerPx
- seconds (or fraction) represented by each pixel
-
getDistancePerPx
public double getDistancePerPx()Distance represented by each pixel (e.g. 10 ms per pixel).- Returns:
- seconds (or fraction) represented by each pixel
-