Package fr.soleil.comete.swt

Examples of fr.soleil.comete.swt.StringMatrixTable


        // set a background to let user see limits of the component
        componentPanel.setBackground(new Color(Display.getCurrent(), 255, 175, 175));// PINK as in
                                                                                     // awt

        final StringMatrixTable theComponent = new StringMatrixTable(componentPanel, SWT.NONE);
        theComponent.setLayoutData(new RowData(275, 150));

        // change the content
        Group optionGroup = new Group(componentPanel, SWT.NONE);
        optionGroup.setText("SetMatrixData");
        optionGroup.setLayout(new RowLayout(SWT.HORIZONTAL));

        Button setDataButton = new Button(optionGroup, SWT.PUSH);
        setDataButton.setText("SetMatrixData");
        setDataButton.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent arg0) {

                int c = (int) Math.rint(2 + 4 * Math.random());
                int l = (int) Math.rint(3 + 4 * Math.random());

                String[][] matrixTable = new String[l][c];
                for (int i = 0; i < l; i++) {
                    for (int j = 0; j < c; j++) {
                        matrixTable[i][j] = "(" + i + " - " + j + ")";
                    }
                }
                StringMatrix result = new StringMatrix();
                result.setValue(matrixTable);

                theComponent.setData(result);
            }
        });

        // ----------

View Full Code Here


        // set a background to let user see limits of the component
        componentPanel.setBackground(new Color(Display.getCurrent(), 255, 175, 175));// PINK as in
                                                                                     // awt

        // TABLE
        final StringMatrixTable theComponent = new StringMatrixTable(componentPanel, SWT.NONE);
        theComponent.setData(generateData());
        theComponent.setLayoutData(new RowData(400, 200));

        // change the content
        Group optionGroup = new Group(componentPanel, SWT.NONE);
        optionGroup.setText("SetMatrixData");
        optionGroup.setLayout(new RowLayout(SWT.HORIZONTAL));

        Button setDataButton = new Button(optionGroup, SWT.PUSH);
        setDataButton.setText("SetMatrixData");
        setDataButton.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent arg0) {
                theComponent.setData(generateData());
            }
        });

        // ----------
        Group testPanel = getTestPanel(mainComposite, theComponent);
View Full Code Here

TOP

Related Classes of fr.soleil.comete.swt.StringMatrixTable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.