Package uk.ac.gda.client.livecontrol
Class JythonMonitorScannableDynamicCommandControl
java.lang.Object
gda.factory.FindableBase
uk.ac.gda.client.livecontrol.LiveControlBase
uk.ac.gda.client.livecontrol.JythonMonitorScannableDynamicCommandControl
- All Implemented Interfaces:
Findable,LiveControl
Subclass of
Example bean definition:
CommandControl to create a button and run commands on the command server.
It monitors a scannable and button text and command to run changes based on scannable position.
Example use case is to move a shutter in and out as a single button.
Example bean definition:
<bean id="hard_shutter_toggle_button" class="uk.ac.gda.client.livecontrol.JythonMonitorScannableDynamicCommandControl">
<property name="scannableName" value="fsi1"/>
<property name="buttonTooltip" value="Move the hard x-ray shutter"/>
<property name="group" value="Hard X-Ray" />
<property name="buttonTextMap">
<util:map map-class="java.util.HashMap">
<entry key="In" value="Open" />
<entry key="Out" value="Close" />
</util:map>
</property>
<property name="commandMap">
<util:map map-class="java.util.HashMap">
<entry key="In" value="pos fsi1 'Out'" />
<entry key="Out" value="pos fsi1 'In'" />
</util:map>
</property>
</bean>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.eclipse.swt.widgets.Button -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateControl(org.eclipse.swt.widgets.Composite composite) This method will create the GUI for this control.booleanprotected StringgetButtonTextMapKey(Object position) protected StringgetButtonTextMapValue(Object position) protected StringgetCommandMapKey(Object position) protected StringgetCommandMapValue(Object position) inthashCode()protected voidrunCommand(String command) voidsetButtonText(String buttonText) voidsetButtonTextMap(Map<String, String> stateMap) voidsetButtonTooltip(String buttonTooltip) voidsetCommand(String command) voidsetCommandMap(Map<String, String> commandMap) voidsetScannableName(String scannableName) toString()voidupdateScannable(Object theObserved, Object arg) Methods inherited from class uk.ac.gda.client.livecontrol.LiveControlBase
dispose, getGroup, setGroupMethods inherited from class gda.factory.FindableBase
getName, setName
-
Field Details
-
commandMap
-
buttonTextMap
-
button
protected org.eclipse.swt.widgets.Button button
-
-
Constructor Details
-
JythonMonitorScannableDynamicCommandControl
public JythonMonitorScannableDynamicCommandControl()
-
-
Method Details
-
createControl
public void createControl(org.eclipse.swt.widgets.Composite composite) Description copied from interface:LiveControlThis method will create the GUI for this control.- Specified by:
createControlin interfaceLiveControl- Parameters:
composite- The composite onto which the control should draw
-
runCommand
-
updateScannable
-
getButtonTextMap
-
setButtonTextMap
-
getButtonTextMapValue
-
getButtonTextMapKey
-
getCommandMap
-
setCommandMap
-
getCommandMapValue
-
getCommandMapKey
-
getScannableName
-
setScannableName
-
setButtonText
-
setButtonTooltip
-
getCommand
-
setCommand
-
hashCode
public int hashCode()- Overrides:
hashCodein classLiveControlBase
-
equals
- Overrides:
equalsin classLiveControlBase
-
toString
- Overrides:
toStringin classLiveControlBase
-