Search in sources :

Example 1 with FormLayout

use of org.eclipse.swt.layout.FormLayout in project cogtool by cogtool.

the class ActionSet method createGraffitiComposite.

protected Composite createGraffitiComposite() {
    Composite graffitiComp = new Composite(actionSettings, SWT.NONE);
    graffitiComp.setLayout(new FormLayout());
    graffitiTextLabel = new DisplayLabel(graffitiComp, SWT.NONE);
    graffitiTextLabel.setText(L10N.get("DE.GraffitiTextCaption", "Graffiti® Gestures") + ":");
    // TODO Why is this here rather than in its natural home in the
    //      overridden method in ActionPropertySet?
    transitionSourceLabelGraffiti = createTransitionSourceLabel(graffitiComp);
    transitionSourceNameGraffiti = createTransitionSourceName(graffitiComp);
    transitionDestinationLabelGraffiti = createTransitionDestinationLabel(graffitiComp);
    transitionDestinationNameGraffiti = createTransitionDestinationName(graffitiComp);
    // TODO: set desired width to something somewhat larger
    graffitiText = createGraffitiText(graffitiComp);
    graffitiIsCmd = new Button(graffitiComp, SWT.CHECK);
    graffitiIsCmd.setText(L10N.get("DE.IsCommand", "Is Command"));
    graffitiIsCmd.addSelectionListener(widgetActionChange);
    return graffitiComp;
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) DisplayLabel(edu.cmu.cs.hcii.cogtool.util.DisplayLabel)

Example 2 with FormLayout

use of org.eclipse.swt.layout.FormLayout in project cogtool by cogtool.

the class ActionSet method layOutPropertiesPane.

public void layOutPropertiesPane() {
    parent.setLayout(new FormLayout());
    layoutHelper();
    createComposites();
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout)

Example 3 with FormLayout

use of org.eclipse.swt.layout.FormLayout in project cogtool by cogtool.

the class ThreadProgressBar method addAboveBar.

@Override
protected void addAboveBar() {
    shell.setLayout(new FormLayout());
    // Add status display area if requested
    if (initialStatus != null) {
        statusLabel = new Label(shell, SWT.NONE);
        statusLabel.setText(initialStatus);
        FormData data = new FormData();
        data.left = new FormAttachment(0, 20);
        data.top = new FormAttachment(0, 10);
        data.right = new FormAttachment(100, -20);
        statusLabel.setLayoutData(data);
    }
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) Label(org.eclipse.swt.widgets.Label) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Example 4 with FormLayout

use of org.eclipse.swt.layout.FormLayout in project cogtool by cogtool.

the class ActionPropertySet method createEmptyComposite.

protected Composite createEmptyComposite() {
    Composite c = new Composite(actionSettings, SWT.NONE);
    c.setLayout(new FormLayout());
    ListenerIdentifierMap lidMap = view.getLIDMap();
    designNameLabel = new DisplayLabel(c, SWT.NONE);
    designNameLabel.setText(nameLabel);
    designName = new View.PerformActionText(c, SWT.SINGLE | SWT.BORDER) {

        @Override
        protected void onFocus() {
            super.onFocus();
            view.getTransmuter().setLIDEnabledState();
        }

        @Override
        protected boolean doChangeAction() {
            Design design = (Design) designName.getData();
            DesignEditorUI.DesignRenameParameters parms = new DesignEditorUI.DesignRenameParameters(design, designName.getText());
            boolean changed = view.performAction(ProjectLID.RenameDesign, parms, true);
            if (!changed) {
                designName.setText(design.getName());
            }
            return changed;
        }
    };
    inputDevicesLabel = new DisplayLabel(c, SWT.NONE);
    inputDevicesLabel.setText(L10N.get("APS.InputDevices", "Input Devices") + ":");
    outputDevicesLabel = new DisplayLabel(c, SWT.NONE);
    outputDevicesLabel.setText(L10N.get("APS.OutputDevices", "Output Devices") + ":");
    for (int i = 0; i < DeviceType.DISPLAY_ORDER.length; i++) {
        deviceButtons[i] = new Button(c, SWT.CHECK);
        deviceButtons[i].setText(DeviceType.DISPLAY_ORDER[i].getName());
        deviceButtons[i].setEnabled(false);
        deviceButtons[i].setSelection(false);
    }
    addDevices = new Button(c, SWT.PUSH);
    addDevices.setText(addDevicesLabel);
    addDevices.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent evt) {
            view.performAction(DesignEditorLID.AddDesignDevices);
        }
    });
    lidMap.addWidget(DesignEditorLID.AddDesignDevices, addDevices, ListenerIdentifierMap.NORMAL);
    skinLabel = new DisplayLabel(c, SWT.NONE);
    skinLabel.setText(DESIGN_SKIN);
    skinCombo = new ComboWithEnableFix(c, SWT.DROP_DOWN | SWT.READ_ONLY);
    for (int i = 1; i < SkinType.DISPLAY.length - 1; i++) {
        // Don't allow None or Palm
        skinCombo.add(SkinType.DISPLAY[i].getName());
    }
    skinCombo.select(0);
    skinCombo.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent evt) {
            switch(skinCombo.getSelectionIndex()) {
                case 0:
                default:
                    {
                        view.performAction(DesignEditorLID.SkinWireFrame);
                        break;
                    }
                case 1:
                    {
                        view.performAction(DesignEditorLID.SkinMacOSX);
                        break;
                    }
                case 2:
                    {
                        view.performAction(DesignEditorLID.SkinWinXP);
                        break;
                    }
            }
        }
    });
    frameTreeLabel = new DisplayLabel(c, SWT.NONE);
    frameTreeLabel.setText(FRAMES);
    frameTree = new Tree(c, SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER);
    frameTree.setLinesVisible(true);
    updater = new TreeItemUpdater.FrameItemUpdater(frameTree);
    return c;
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) Composite(org.eclipse.swt.widgets.Composite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Point(org.eclipse.swt.graphics.Point) DisplayLabel(edu.cmu.cs.hcii.cogtool.util.DisplayLabel) Design(edu.cmu.cs.hcii.cogtool.model.Design) DesignEditorUI(edu.cmu.cs.hcii.cogtool.ui.DesignEditorUI) Button(org.eclipse.swt.widgets.Button) ListenerIdentifierMap(edu.cmu.cs.hcii.cogtool.util.ListenerIdentifierMap) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Tree(org.eclipse.swt.widgets.Tree) ComboWithEnableFix(edu.cmu.cs.hcii.cogtool.util.ComboWithEnableFix)

Example 5 with FormLayout

use of org.eclipse.swt.layout.FormLayout in project cogtool by cogtool.

the class ActionPropertySet method layoutHelper.

@Override
public void layoutHelper() {
    actionSettings = new Composite(parent, SWT.BORDER);
    actionSettings.setLayout(actionSettingsLayout);
    propLabel = new Label(parent, SWT.CENTER);
    propLabel.setText(designPropertiesLabel);
    Font labelFont = FontUtils.getAdjustedFont(propLabel.getFont(), SWT.BOLD);
    propLabel.setFont(labelFont);
    actionType = new DisplayLabel(parent, SWT.NONE);
    actionType.setText(actionTypeLabel);
    actionChoices = new ComboWithEnableFix(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
    actionChoices.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent evt) {
            int currentSelection = actionChoices.getSelectionIndex();
            if (currentSelection != chosenActionType) {
                editTransitionParms.useWhichParts = choiceUseIndexes[currentSelection];
                chosenActionType = currentSelection;
                view.performAction(DesignEditorLID.EditTransition, editTransitionParms, true);
            }
        }
    });
    delayLabelLabel = new DisplayLabel(parent, SWT.NONE);
    delayLabelLabel.setText(DELAY_LABEL_LABEL);
    delayLabel = new View.PerformActionText(parent, SWT.SINGLE | SWT.BORDER) {

        @Override
        protected void onFocus() {
            super.onFocus();
            view.getTransmuter().setLIDEnabledState();
        }

        @Override
        protected boolean doChangeAction() {
            Point labelSelection = getSelection();
            if ("".equals(getText())) {
                setText(TransitionDelay.DEFAULT_DELAY_LABEL);
                labelSelection = null;
            }
            if (view.performAction(DesignEditorLID.ChangeDelay)) {
                if (labelSelection != null) {
                    setSelection(labelSelection);
                }
                return true;
            }
            return false;
        }
    };
    delayInSecsLabel = new DisplayLabel(parent, SWT.NONE);
    delayInSecsLabel.setText(DELAY_DURATION_LABEL + ":");
    secondsUnit = new Label(parent, SWT.NONE);
    secondsUnit.setText(SECONDS);
    delayInSecs = new View.PerformActionDouble(parent, SWT.SINGLE | SWT.BORDER) {

        @Override
        protected void onFocus() {
            super.onFocus();
            view.getTransmuter().setLIDEnabledState();
        }

        @Override
        protected void onModify() {
            super.onModify();
            delayLabel.setEnabled(getDoubleValue() > 0.0);
        }

        @Override
        protected boolean doChangeAction() {
            Point delaySelection = getSelection();
            if (getDoubleValue() == 0.0) {
                setText("");
                delaySelection = null;
            }
            if (view.performAction(DesignEditorLID.ChangeDelay)) {
                if (delaySelection != null) {
                    setSelection(delaySelection);
                }
                return true;
            }
            return false;
        }
    };
    delayInSecs.setAllowNegative(false);
    delayInSecs.setDecimalPlaces(3);
    delayInSecs.moveAbove(delayLabel.getOuter());
    FormData data = new FormData();
    data.left = leftAttachment;
    data.right = new FormAttachment(100, -5);
    propLabel.setLayoutData(data);
    data = new FormData();
    data.left = leftAttachment;
    data.top = new FormAttachment(actionChoices, 0, SWT.CENTER);
    actionType.setLayoutData(data);
    data = new FormData();
    data.left = new FormAttachment(actionType, 5, SWT.RIGHT);
    data.right = new FormAttachment(100, -5);
    data.top = new FormAttachment(propLabel, 5, SWT.BOTTOM);
    actionChoices.setLayoutData(data);
    data = new FormData();
    data.left = leftAttachment;
    data.top = new FormAttachment(actionChoices, 5, SWT.BOTTOM);
    data.right = new FormAttachment(100, -5);
    actionSettings.setLayoutData(data);
    data = new FormData();
    data.left = leftAttachment;
    data.top = new FormAttachment(actionSettings, 5, SWT.BOTTOM);
    delayInSecsLabel.setLayoutData(data);
    data = new FormData();
    data.left = leftAttachment;
    data.top = new FormAttachment(delayInSecsLabel, 5, SWT.BOTTOM);
    data.width = 100;
    delayInSecs.setLayoutData(data);
    data = new FormData();
    data.left = new FormAttachment(delayInSecs.getOuter(), 5, SWT.RIGHT);
    data.top = new FormAttachment(delayInSecs.getOuter(), 0, SWT.CENTER);
    secondsUnit.setLayoutData(data);
    data = new FormData();
    data.left = leftAttachment;
    data.top = new FormAttachment(delayInSecs.getOuter(), 5, SWT.BOTTOM);
    delayLabelLabel.setLayoutData(data);
    data = new FormData();
    data.left = leftAttachment;
    data.top = new FormAttachment(delayLabelLabel, 5, SWT.BOTTOM);
    data.right = new FormAttachment(100, -5);
    delayLabel.setLayoutData(data);
    emptyParms = createEmptyComposite();
    layOutEmptyComposite();
    multTransParms = new Composite(actionSettings, SWT.NONE);
    multTransParms.setLayout(new FormLayout());
    Label multTransLabel = new Label(multTransParms, SWT.WRAP);
    multTransLabel.setText(noActionAvailableText);
    data = new FormData();
    data.left = leftAttachment;
    data.top = new FormAttachment(0, 5);
    data.right = new FormAttachment(100, -5);
    multTransLabel.setLayoutData(data);
    frameParms = createFrameComposite();
}
Also used : FormData(org.eclipse.swt.layout.FormData) FormLayout(org.eclipse.swt.layout.FormLayout) Composite(org.eclipse.swt.widgets.Composite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) DisplayLabel(edu.cmu.cs.hcii.cogtool.util.DisplayLabel) Label(org.eclipse.swt.widgets.Label) Point(org.eclipse.swt.graphics.Point) Font(org.eclipse.swt.graphics.Font) DisplayLabel(edu.cmu.cs.hcii.cogtool.util.DisplayLabel) SelectionEvent(org.eclipse.swt.events.SelectionEvent) ComboWithEnableFix(edu.cmu.cs.hcii.cogtool.util.ComboWithEnableFix) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Aggregations

FormLayout (org.eclipse.swt.layout.FormLayout)726 FormData (org.eclipse.swt.layout.FormData)651 FormAttachment (org.eclipse.swt.layout.FormAttachment)649 Label (org.eclipse.swt.widgets.Label)503 Button (org.eclipse.swt.widgets.Button)484 SelectionEvent (org.eclipse.swt.events.SelectionEvent)444 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)407 Text (org.eclipse.swt.widgets.Text)390 Composite (org.eclipse.swt.widgets.Composite)384 Shell (org.eclipse.swt.widgets.Shell)365 ModifyListener (org.eclipse.swt.events.ModifyListener)355 Listener (org.eclipse.swt.widgets.Listener)354 Event (org.eclipse.swt.widgets.Event)352 ModifyEvent (org.eclipse.swt.events.ModifyEvent)350 Display (org.eclipse.swt.widgets.Display)343 ShellEvent (org.eclipse.swt.events.ShellEvent)335 ShellAdapter (org.eclipse.swt.events.ShellAdapter)330 TextVar (org.pentaho.di.ui.core.widget.TextVar)220 ColumnInfo (org.pentaho.di.ui.core.widget.ColumnInfo)200 TableView (org.pentaho.di.ui.core.widget.TableView)198