Search in sources :

Example 16 with FormAttachment

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

the class ActionPropertySet method adjustMouseLayout.

@Override
protected void adjustMouseLayout() {
    // Subclasses should override to handle the addition of the
    // modifier key set to the mouse parameters.
    FormData data = (FormData) setAsDefaultMouse.getLayoutData();
    data.top = new FormAttachment(buttonModifierSet.FUNCTION, 5, SWT.BOTTOM);
}
Also used : FormData(org.eclipse.swt.layout.FormData) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Example 17 with FormAttachment

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

the class ActionPropertySet method addDefaultButtons.

protected void addDefaultButtons(Composite parms, Control last, Button setAsDefault, Button restoreDefaults, SelectionListener buttonListener) {
    FormData data = new FormData();
    data.top = new FormAttachment(last, 5, SWT.BOTTOM);
    data.left = leftAttachment;
    data.right = new FormAttachment(restoreDefaults, 0, SWT.RIGHT);
    setAsDefault.setLayoutData(data);
    setAsDefault.setEnabled(false);
    setAsDefault.addSelectionListener(buttonListener);
    data = new FormData();
    data.top = new FormAttachment(setAsDefault, 5, SWT.BOTTOM);
    data.left = leftAttachment;
    restoreDefaults.setLayoutData(data);
    restoreDefaults.setEnabled(false);
    restoreDefaults.addSelectionListener(buttonListener);
}
Also used : FormData(org.eclipse.swt.layout.FormData) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Example 18 with FormAttachment

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

the class ActionPropertySet method layOutEmptyComposite.

protected void layOutEmptyComposite() {
    FormData data = new FormData();
    data.top = new FormAttachment(0, 5);
    data.left = leftAttachment;
    designNameLabel.setLayoutData(data);
    data = new FormData();
    data.top = new FormAttachment(designNameLabel, 5, SWT.BOTTOM);
    data.left = leftAttachment;
    data.right = new FormAttachment(100, -5);
    designName.setLayoutData(data);
    data = new FormData();
    data.top = new FormAttachment(designName.getOuter(), 10, SWT.BOTTOM);
    data.left = leftAttachment;
    inputDevicesLabel.setLayoutData(data);
    FormAttachment indent = new FormAttachment(0, 15);
    data = new FormData();
    data.top = new FormAttachment(inputDevicesLabel, 5, SWT.BOTTOM);
    data.left = indent;
    deviceButtons[0].setLayoutData(data);
    for (int i = 1; i < 4; i++) {
        data = new FormData();
        data.top = new FormAttachment(deviceButtons[i - 1], 5, SWT.BOTTOM);
        data.left = indent;
        deviceButtons[i].setLayoutData(data);
    }
    data = new FormData();
    data.top = new FormAttachment(designName.getOuter(), 10, SWT.BOTTOM);
    data.left = new FormAttachment(inputDevicesLabel, 25, SWT.RIGHT);
    outputDevicesLabel.setLayoutData(data);
    data = new FormData();
    data.top = new FormAttachment(outputDevicesLabel, 5, SWT.BOTTOM);
    data.left = new FormAttachment(outputDevicesLabel, 0, SWT.LEFT);
    deviceButtons[4].setLayoutData(data);
    data = new FormData();
    data.top = new FormAttachment(deviceButtons[4], 5, SWT.BOTTOM);
    data.left = new FormAttachment(outputDevicesLabel, 0, SWT.LEFT);
    deviceButtons[5].setLayoutData(data);
    data = new FormData();
    data.top = new FormAttachment(deviceButtons[5], 5, SWT.BOTTOM);
    data.left = new FormAttachment(outputDevicesLabel, (OSUtils.MACOSX ? -6 : 0), SWT.LEFT);
    addDevices.setLayoutData(data);
    data = new FormData();
    data.top = new FormAttachment(deviceButtons[3], 10, SWT.BOTTOM);
    data.left = leftAttachment;
    frameTreeLabel.setLayoutData(data);
    data = new FormData();
    data.top = new FormAttachment(frameTreeLabel, 5, SWT.BOTTOM);
    data.left = leftAttachment;
    data.right = new FormAttachment(100, -5);
    data.height = 180;
    frameTree.setLayoutData(data);
    data = new FormData();
    data.top = new FormAttachment(frameTree, 5, SWT.BOTTOM);
    data.left = leftAttachment;
    skinLabel.setLayoutData(data);
    data = new FormData();
    data.top = new FormAttachment(frameTree, 5, SWT.BOTTOM);
    data.left = new FormAttachment(skinLabel, 15, SWT.RIGHT);
    data.bottom = new FormAttachment(100, -5);
    skinCombo.setLayoutData(data);
}
Also used : FormData(org.eclipse.swt.layout.FormData) FormAttachment(org.eclipse.swt.layout.FormAttachment) Point(org.eclipse.swt.graphics.Point)

Example 19 with FormAttachment

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

the class SEDemoView method layOutWindow.

/**
     * Lay out the window including the interactionDrawing editor
     * @param edit
     *
     * @param tableCallback
     */
public void layOutWindow(int deviceTypes, SWTListMultiColumn rowRenderer) {
    Shell shell = getShell();
    // Set up the layouts
    shell.setLayout(new FormLayout());
    // Create a group for the properties on the history
    historyProperties = new Group(shell, SWT.NONE);
    historyProperties.setLayout(new FormLayout());
    if (editable) {
        // Create the delete Item button
        deleteItem = new Button(historyProperties, SWT.PUSH);
        deleteItem.setText(L10N.get("SE.DeleteStep", "Delete Step"));
        deleteItem.addSelectionListener(new SWTWidgetChangeHandler(SEDemoLID.Delete));
        lIDMap.addWidget(SEDemoLID.Delete, deleteItem, ListenerIdentifierMap.NORMAL);
        //            this.regenerateItem = new Button(this.historyProperties, SWT.PUSH);
        //            this.regenerateItem.setText(L10N.get("SE.RegenerateScript",
        //                                                 "Regenerate Script"));
        //            this.regenerateItem.addSelectionListener(
        //                           new SWTWidgetChangeHandler(SEDemoLID.RegenerateScript));
        //
        //            this.lIDMap.addWidget(SEDemoLID.RegenerateScript,
        //                                  this.regenerateItem,
        //                                  ListenerIdentifierMap.NORMAL);
        // Create the compute button
        computeItem = new Button(historyProperties, SWT.PUSH);
        computeItem.setText(COMPUTE);
        computeItem.addSelectionListener(new SWTWidgetChangeHandler(SEDemoLID.RecomputeScript));
        lIDMap.addWidget(SEDemoLID.RecomputeScript, computeItem, ListenerIdentifierMap.NORMAL);
    }
    // Script
    scriptStepListLabel = new Label(historyProperties, SWT.CENTER);
    String scriptStepLabel = scriptStepListTitle;
    if (!editable) {
        scriptStepLabel += " (" + VIEW_ONLY + ")";
        scriptStepListLabel.setBackground(NONEDITABLE_COLOR);
    }
    scriptStepListLabel.setText(scriptStepLabel);
    Table scriptStepTable = new Table(historyProperties, SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION);
    scriptStepTable.setFont(FontUtils.SYMBOL_FONT);
    scriptSteps = rowRenderer;
    scriptSteps.setTable(scriptStepTable);
    scriptSteps.setColumnTitles(columnTitles);
    if (editable) {
        addHandOnKeyboardToStart(deviceTypes, historyProperties);
    }
    predictionResult = new Label(shell, SWT.LEFT);
    FormData editorData = new FormData();
    editorData.top = new FormAttachment(0, 5);
    editorData.left = new FormAttachment(0, 5);
    editorData.bottom = new FormAttachment(100, -5);
    Label predictionLabel = new Label(shell, SWT.LEFT);
    predictionLabel.setText(predictionTitle);
    predictionLabel.setFont(PREDICTION_LABEL_FONT);
    Button showVisButton = new Button(shell, SWT.PUSH);
    FormData data = new FormData();
    data.top = new FormAttachment(showVisButton, 0, SWT.CENTER);
    data.left = new FormAttachment(historyProperties, 5, SWT.LEFT);
    predictionLabel.setLayoutData(data);
    data = new FormData();
    data.top = new FormAttachment(showVisButton, 0, SWT.CENTER);
    data.left = new FormAttachment(predictionLabel, 5, SWT.RIGHT);
    data.right = new FormAttachment(showVisButton, 0, SWT.LEFT);
    predictionResult.setLayoutData(data);
    showVisButton.setText(SHOW_VISUALIZATION);
    data = new FormData();
    data.top = new FormAttachment(0, 10);
    data.right = new FormAttachment(historyProperties, 0, SWT.RIGHT);
    showVisButton.setLayoutData(data);
    showVisButton.addSelectionListener(new SWTWidgetChangeHandler(SEDemoLID.ShowModelVisualization));
    lIDMap.addWidget(SEDemoLID.ShowModelVisualization, showVisButton, ListenerIdentifierMap.NORMAL);
    data = new FormData();
    data.top = new FormAttachment(showVisButton, 2, SWT.BOTTOM);
    data.right = new FormAttachment(100, -5);
    data.bottom = new FormAttachment(100, -5);
    SashUtility.createVerticalSash(getShell(), MIN_DRAWING_AREA_WIDTH, HISTORY_LIST_WIDTH, SWT.RIGHT, editor.bodyComposite, editorData, historyProperties, data);
    // Layout contents of widgetGroup
    data = new FormData();
    data.top = new FormAttachment(predictionLabel, 0, SWT.BOTTOM);
    data.left = new FormAttachment(scriptStepTable, 0, SWT.LEFT);
    data.right = new FormAttachment(scriptStepTable, 0, SWT.RIGHT);
    scriptStepListLabel.setLayoutData(data);
    data = new FormData();
    data.top = new FormAttachment(scriptStepListLabel, 5, SWT.BOTTOM);
    data.left = new FormAttachment(0, 0);
    data.right = new FormAttachment(100, 0);
    positionStartLocParms(data);
    scriptStepTable.setLayoutData(data);
    if (editable) {
        data = new FormData();
        data.left = new FormAttachment(scriptStepTable, 0, SWT.LEFT);
        data.right = new FormAttachment(scriptStepTable, 0, SWT.RIGHT);
        data.bottom = new FormAttachment(computeItem, 0, SWT.TOP);
        deleteItem.setLayoutData(data);
        //            data = new FormData();
        //            data.left = new FormAttachment(scriptStepTable, 0, SWT.LEFT);
        //            data.right = new FormAttachment(scriptStepTable, 0, SWT.RIGHT);
        //            data.bottom = new FormAttachment(this.computeItem, 0 , SWT.TOP);
        //            this.regenerateItem.setLayoutData(data);
        data = new FormData();
        // use 0 here, since internal frame is set to -05, fix internal frame
        data.bottom = new FormAttachment(100, 0);
        data.left = new FormAttachment(scriptStepTable, 0, SWT.LEFT);
        data.right = new FormAttachment(scriptStepTable, 0, SWT.RIGHT);
        computeItem.setLayoutData(data);
        layOutPropertiesPane(editor.propertiesComposite);
    }
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) Group(org.eclipse.swt.widgets.Group) Shell(org.eclipse.swt.widgets.Shell) Table(org.eclipse.swt.widgets.Table) Button(org.eclipse.swt.widgets.Button) Label(org.eclipse.swt.widgets.Label) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Example 20 with FormAttachment

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

the class SEFrameChooserView method positionStartLocParms.

protected void positionStartLocParms(FormData data) {
    if (mouseHandStartLoc != null) {
        FormData handLayoutData = new FormData();
        handLayoutData.bottom = new FormAttachment(demonstrateScriptButton, -5, SWT.TOP);
        handLayoutData.left = new FormAttachment(userMouseHand, 0, SWT.LEFT);
        handLayoutData.right = new FormAttachment(100, 0);
        mouseHandStartLoc.setLayoutData(handLayoutData);
        data.bottom = new FormAttachment(userMouseHand, -5, SWT.TOP);
    } else {
        data.bottom = new FormAttachment(demonstrateScriptButton, -5, SWT.TOP);
    }
}
Also used : FormData(org.eclipse.swt.layout.FormData) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Aggregations

FormAttachment (org.eclipse.swt.layout.FormAttachment)228 FormData (org.eclipse.swt.layout.FormData)228 Point (org.eclipse.swt.graphics.Point)87 Button (org.eclipse.swt.widgets.Button)85 Composite (org.eclipse.swt.widgets.Composite)83 FormLayout (org.eclipse.swt.layout.FormLayout)78 Control (org.eclipse.swt.widgets.Control)57 CLabel (org.eclipse.swt.custom.CLabel)56 SelectionEvent (org.eclipse.swt.events.SelectionEvent)55 Node (org.talend.designer.core.ui.editor.nodes.Node)49 Label (org.eclipse.swt.widgets.Label)47 GC (org.eclipse.swt.graphics.GC)46 Text (org.eclipse.swt.widgets.Text)39 DecoratedField (org.eclipse.jface.fieldassist.DecoratedField)36 SelectionListener (org.eclipse.swt.events.SelectionListener)36 FieldDecoration (org.eclipse.jface.fieldassist.FieldDecoration)34 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)32 GridData (org.eclipse.swt.layout.GridData)32 GridLayout (org.eclipse.swt.layout.GridLayout)28 Group (org.eclipse.swt.widgets.Group)26