Class NudgePositionerComposite
- All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable
- Direct Known Subclasses:
SlimPositionerComposite
It provides the current position which can be edited and moved (unless READ_ONLY is specified) and buttons to allow
incremental moves.
A stop button to abort moves is provided by the base class AbstractPositionerComposite.
Tapping the up and down arrows while in the position box will nudge the position by the increment.
The format of the displayed number will be specified by the scannable output format.
Example of vertical invalid input: '&' horizontal format:

-
Field Summary
Fields inherited from class gda.rcp.views.AbstractPositionerComposite
checkHoldingBaton, displayNameLabel, reasonForDisallowingMove, unitDisplayOutsideTextBoxFields inherited from class org.eclipse.swt.widgets.Composite
embeddedHandleFields inherited from class org.eclipse.swt.widgets.Widget
handle -
Constructor Summary
ConstructorsConstructorDescriptionNudgePositionerComposite(org.eclipse.swt.widgets.Composite parent, int style) Constructor for a NudgePositionerComposite only requires the specification of minimal parameters.NudgePositionerComposite(org.eclipse.swt.widgets.Composite parent, int style, boolean unitDisplayOutsideTextBox) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCreates the control(s) (drawn between the label and the stop button) to display and/or control the scannable's position.protected voidprotected voidprotected org.eclipse.swt.widgets.Buttonprotected org.eclipse.swt.widgets.Buttonprotected org.eclipse.swt.widgets.Textprotected org.eclipse.swt.widgets.Textvoidhides the increment control compositebooleancheck if the Increment Control composite is visibleprotected booleanprotected booleanmoveAllowed(Object newPosition) Subclasses can override to check whether the requested position lies within limits, for instance.protected voidsetDecrementButton(org.eclipse.swt.widgets.Button decrementButton) voidsetDisplayUnit(String userUnits) Sets a different name to be used in the GUI instead of the default which is the scannable namevoidsetEnabled(boolean enabled) voidvoidsetIncrement(double increment) Change the increment programmatically or from Spring bean definitionprotected voidsetIncrement(String incrementText) Change the increment from a view's text boxprotected voidsetIncrementButton(org.eclipse.swt.widgets.Button incrementButton) protected voidsetIncrementText(org.eclipse.swt.widgets.Text incrementText) voidsetIncrementTextWidth(int incrementTextWidth) voidSets the description label for the composite to a bold fontvoidsetLimits(double lowerLimit, double upperLimit) Sets the limits which will be used to check if a new position is valid.protected voidsetPositionText(org.eclipse.swt.widgets.Text positionText) voidsetScannable(Scannable scannable) This sets the scannable which will be controlled and will automatically configure the control.voidsetUserUnits(String userUnits) voidshows the increment control compositeprotected voidupdatePositionerControl(Object currentPosition, boolean moving) This is used to update the GUI.Methods inherited from class gda.rcp.views.AbstractPositionerComposite
checkBatonHeld, dispose, getCurrentPosition, getDisplayName, getScannable, getScannableOutputFormat, hideStopButton, isCheckHoldingBaton, isStopButtonVisible, move, scheduleUpdateReadbackJob, setCheckHoldingBaton, setDisplayName, setDisplayNameWidth, setReasonForDisallowingMove, showStopButtonMethods 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, toStringMethods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBarMethods 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, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, updateMethods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData
-
Constructor Details
-
NudgePositionerComposite
public NudgePositionerComposite(org.eclipse.swt.widgets.Composite parent, int style) Constructor for a NudgePositionerComposite only requires the specification of minimal parameters.- Parameters:
parent- The parent compositestyle- SWT style parameter. This is typically SWT.NONE, but you can specify:- SWT.VERTICAL or SWT.HORIZONTAL to lay the controls out vertically or horizontally respectively (default is vertical)
- SWT.READ_ONLY to make the position text box read-only. Note that the increment/decrement text box will always be writable
-
NudgePositionerComposite
public NudgePositionerComposite(org.eclipse.swt.widgets.Composite parent, int style, boolean unitDisplayOutsideTextBox)
-
-
Method Details
-
createPositionerControl
protected void createPositionerControl()Description copied from class:AbstractPositionerCompositeCreates the control(s) (drawn between the label and the stop button) to display and/or control the scannable's position.For consistent results, implementors are advised to create widgets directly on top of
thisComposite.- Specified by:
createPositionerControlin classAbstractPositionerComposite
-
setDisplayUnit
Sets a different name to be used in the GUI instead of the default which is the scannable nameAfter calling this method the control will be automatically redrawn.
- Parameters:
userUnits- The name to be used in the GUI
-
setScannable
Description copied from class:AbstractPositionerCompositeThis sets the scannable which will be controlled and will automatically configure the control.This can also be called to change the scannable controlled at any time which will reconfigure the control.
- Overrides:
setScannablein classAbstractPositionerComposite- Parameters:
scannable- The scannable to control
-
moveAllowed
Description copied from class:AbstractPositionerCompositeSubclasses can override to check whether the requested position lies within limits, for instance.If a move is disallowed, it is advised that a reason be set via
AbstractPositionerComposite.setReasonForDisallowingMove(String)so that it can be presented to the user.- Overrides:
moveAllowedin classAbstractPositionerComposite
-
updatePositionerControl
This is used to update the GUI. Only this method should be used to update the GUI to ensure display is consistent. The position is updated and the controls enabled/disabled as appropriate.- Specified by:
updatePositionerControlin classAbstractPositionerComposite- Parameters:
currentPosition- The newest position to displaymoving- Flag showing if the scannable is moving
-
setIncrement
public void setIncrement(double increment) Change the increment programmatically or from Spring bean definition- Parameters:
increment- The new increment value
-
setIncrement
Change the increment from a view's text box- Parameters:
incrementText- The new increment value
-
setFixedIncrementInput
public void setFixedIncrementInput() -
setUserUnits
-
setLabelToBold
public void setLabelToBold()Sets the description label for the composite to a bold font -
setLimits
public void setLimits(double lowerLimit, double upperLimit) Sets the limits which will be used to check if a new position is valid.- Parameters:
lowerLimit- the desired lower limitupperLimit- the desired upper limit- Throws:
IllegalArgumentException- if the lowerLimit > upperLimit
-
setEnabled
public void setEnabled(boolean enabled) - Overrides:
setEnabledin classAbstractPositionerComposite
-
setIncrementTextWidth
public void setIncrementTextWidth(int incrementTextWidth) -
hideIncrementControl
public void hideIncrementControl()hides the increment control compositeThis is useful if users don't use increment control and want more screen estate to display other live control elements
- See Also:
-
showIncrementControl
public void showIncrementControl()shows the increment control composite- See Also:
-
isIncrementControlVisible
public boolean isIncrementControlVisible()check if the Increment Control composite is visible- Returns:
- true if the increment control composite is visible
- See Also:
-
getPositionText
protected org.eclipse.swt.widgets.Text getPositionText() -
setPositionText
protected void setPositionText(org.eclipse.swt.widgets.Text positionText) -
getIncrementText
protected org.eclipse.swt.widgets.Text getIncrementText() -
setIncrementText
protected void setIncrementText(org.eclipse.swt.widgets.Text incrementText) -
getDecrementButton
protected org.eclipse.swt.widgets.Button getDecrementButton() -
setDecrementButton
protected void setDecrementButton(org.eclipse.swt.widgets.Button decrementButton) -
getIncrementButton
protected org.eclipse.swt.widgets.Button getIncrementButton() -
setIncrementButton
protected void setIncrementButton(org.eclipse.swt.widgets.Button incrementButton) -
isReadOnlyPosition
protected boolean isReadOnlyPosition() -
doIncrementValue
protected void doIncrementValue() -
doDecrementValue
protected void doDecrementValue()
-