Search in sources :

Example 6 with MousePressType

use of edu.cmu.cs.hcii.cogtool.model.MousePressType in project cogtool by cogtool.

the class ActionSet method createMouseComposite.

protected Composite createMouseComposite() {
    Composite mouseComp = new Composite(actionSettings, SWT.NONE);
    mouseComp.setLayout(new FormLayout());
    mouseButtonLabel = new DisplayLabel(mouseComp, SWT.NONE);
    mouseButtonLabel.setText(L10N.get("DE.MouseButtonCaption", "Mouse Button") + ":");
    // TODO Why is this here rather than in its natural home in the
    //      overridden method in ActionPropertySet?
    transitionSourceLabelMouse = createTransitionSourceLabel(mouseComp);
    transitionSourceNameMouse = createTransitionSourceName(mouseComp);
    transitionDestinationLabelMouse = createTransitionDestinationLabel(mouseComp);
    transitionDestinationNameMouse = createTransitionDestinationName(mouseComp);
    mouseButtonCombo = new ComboWithEnableFix(mouseComp, SWT.DROP_DOWN | SWT.READ_ONLY);
    for (MouseButtonState element : MouseButtonState.DISPLAY) {
        mouseButtonCombo.add(element.toString());
    }
    mouseButtonCombo.select(0);
    mouseButtonCombo.addSelectionListener(widgetActionChange);
    mouseActionLabel = new DisplayLabel(mouseComp, SWT.NONE);
    mouseActionLabel.setText(L10N.get("DE.ButtonActionCaption", "Action") + ":");
    mouseActionCombo = new ComboWithEnableFix(mouseComp, SWT.DROP_DOWN | SWT.READ_ONLY);
    for (MousePressType element : MousePressType.DISPLAY) {
        mouseActionCombo.add(element.toString());
    }
    mouseActionCombo.select(0);
    mouseActionCombo.addSelectionListener(widgetActionChange);
    // then add modifier set for the mouse clicks.
    if (DeviceType.Keyboard.isMember(deviceTypes)) {
        buttonModifierSet = new ActionModifierSet(mouseActionCombo, widgetActionChange, vertical);
    }
    return mouseComp;
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) Composite(org.eclipse.swt.widgets.Composite) MousePressType(edu.cmu.cs.hcii.cogtool.model.MousePressType) ComboWithEnableFix(edu.cmu.cs.hcii.cogtool.util.ComboWithEnableFix) MouseButtonState(edu.cmu.cs.hcii.cogtool.model.MouseButtonState) DisplayLabel(edu.cmu.cs.hcii.cogtool.util.DisplayLabel)

Aggregations

MousePressType (edu.cmu.cs.hcii.cogtool.model.MousePressType)6 MouseButtonState (edu.cmu.cs.hcii.cogtool.model.MouseButtonState)5 AAction (edu.cmu.cs.hcii.cogtool.model.AAction)4 ButtonAction (edu.cmu.cs.hcii.cogtool.model.ButtonAction)4 Transition (edu.cmu.cs.hcii.cogtool.model.Transition)4 TapAction (edu.cmu.cs.hcii.cogtool.model.TapAction)3 TapPressType (edu.cmu.cs.hcii.cogtool.model.TapPressType)3 DoublePoint (edu.cmu.cs.hcii.cogtool.model.DoublePoint)2 DeviceType (edu.cmu.cs.hcii.cogtool.model.DeviceType)1 IWidget (edu.cmu.cs.hcii.cogtool.model.IWidget)1 WidgetType (edu.cmu.cs.hcii.cogtool.model.WidgetType)1 ComboWithEnableFix (edu.cmu.cs.hcii.cogtool.util.ComboWithEnableFix)1 DisplayLabel (edu.cmu.cs.hcii.cogtool.util.DisplayLabel)1 SelectionListener (org.eclipse.swt.events.SelectionListener)1 Point (org.eclipse.swt.graphics.Point)1 FormAttachment (org.eclipse.swt.layout.FormAttachment)1 FormData (org.eclipse.swt.layout.FormData)1 FormLayout (org.eclipse.swt.layout.FormLayout)1 Composite (org.eclipse.swt.widgets.Composite)1