Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Spinner


        wkmarkCompositeLayout.marginWidth = 0;
        wkmarkCompositeLayout.marginHeight = 0;
        wkmarkComposite.setLayout(wkmarkCompositeLayout);

        // mark width
        wkmWidthSpinner = new Spinner(wkmarkComposite, SWT.BORDER);
        wkmWidthSpinner.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        wkmWidthSpinner.setMaximum(200);
        wkmWidthSpinner.setMinimum(0);
        wkmWidthSpinner.setIncrement(1);
        wkmWidthSpinner.setToolTipText(Messages.PolygonFillParametersComposite_4);

        String wkMarkWidth = polygonSymbolizerWrapper.getWkMarkWidthFill();
        Double tmpWidth = isDouble(wkMarkWidth);
        int tmpWidthInt = 1;
        if (tmpWidth != null) {
            tmpWidthInt = tmpWidth.intValue();
        }
        wkmWidthSpinner.setSelection(tmpWidthInt * 10);
        wkmWidthSpinner.setDigits(1);
        wkmWidthSpinner.addSelectionListener(this);

        // mark size
        wkmSizeSpinner = new Spinner(wkmarkComposite, SWT.BORDER);
        wkmSizeSpinner.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        wkmSizeSpinner.setMaximum(1000);
        wkmSizeSpinner.setMinimum(0);
        wkmSizeSpinner.setIncrement(1);
        wkmSizeSpinner.setToolTipText(Messages.PolygonFillParametersComposite_5);

        String wkMarkSize = polygonSymbolizerWrapper.getWkMarkSizeFill();
        Double tmpSize = isDouble(wkMarkSize);
        int tmpSizeInt = 5;
        if (tmpSize != null) {
            tmpSizeInt = tmpSize.intValue();
        }
        wkmSizeSpinner.setSelection(tmpSizeInt * 10);
        wkmSizeSpinner.setDigits(1);
        wkmSizeSpinner.addSelectionListener(this);

        // mark color
        String wkMarkColor = polygonSymbolizerWrapper.getWkMarkColorFill();
        Color tmpWkmColor;
        try {
            tmpWkmColor = Color.decode(wkMarkColor);
        } catch (Exception e) {
            tmpWkmColor = Color.gray;
        }
        wkmColorEditor = new StolenColorEditor(wkmarkComposite, this);
        wkmColorEditor.setColor(tmpWkmColor);
        wkmColorButton = wkmColorEditor.getButton();
        GridData wkmColorButtonGD = new GridData(SWT.FILL, SWT.CENTER, true, false);
        wkmColorButton.setLayoutData(wkmColorButtonGD);

        // header
        new Label(mainComposite, SWT.NONE);
        Label valueLabel = new Label(mainComposite, SWT.NONE);
        valueLabel.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false));
        valueLabel.setText(Messages.PolygonFillParametersComposite_6);
        Label fieldsLabel = new Label(mainComposite, SWT.NONE);
        fieldsLabel.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false));
        fieldsLabel.setText(Messages.PolygonFillParametersComposite_7);

        // border alpha
        Label fillOpactityLabel = new Label(mainComposite, SWT.NONE);
        fillOpactityLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        fillOpactityLabel.setText(Messages.PolygonFillParametersComposite_8);
        fillOpacitySpinner = new Spinner(mainComposite, SWT.BORDER);
        fillOpacitySpinner.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        fillOpacitySpinner.setMaximum(100);
        fillOpacitySpinner.setMinimum(0);
        fillOpacitySpinner.setIncrement(10);

View Full Code Here


        // border alpha
        Label fillOpactityLabel = new Label(mainComposite, SWT.NONE);
        fillOpactityLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        fillOpactityLabel.setText(Messages.PointFillParametersComposite_3);
        fillOpacitySpinner = new Spinner(mainComposite, SWT.BORDER);
        fillOpacitySpinner.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        fillOpacitySpinner.setMaximum(100);
        fillOpacitySpinner.setMinimum(0);
        fillOpacitySpinner.setIncrement(10);
        String opacity = pointSymbolizerWrapper.getFillOpacity();
View Full Code Here

        label.setText(Messages.ImageExportPage_ImageHeight);
        GridData layoutData = new GridData();
        layoutData.horizontalIndent = 5;
        label.setLayoutData(layoutData);

        height = new Spinner(comp, SWT.BORDER);
        initSpinner(height, ExportMapToImageWizard.HEIGHT_KEY);
        height.setEnabled(false);
    }
View Full Code Here

    private void createWidthSpinner( Composite comp ) {
        Label label = new Label(comp, SWT.NONE);
        label.setText(Messages.ImageExportPage_ImageWidth);
        label.setLayoutData(new GridData());

        width = new Spinner(comp, SWT.BORDER);
        initSpinner(width, ExportMapToImageWizard.WIDTH_KEY);
    }
View Full Code Here

        // border width
        Label borderWidthLabel = new Label(mainComposite, SWT.NONE);
        borderWidthLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        borderWidthLabel.setText(Messages.PointBoderParametersComposite_3);
        borderWidthSpinner = new Spinner(mainComposite, SWT.BORDER);
        borderWidthSpinner.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        borderWidthSpinner.setMaximum(500);
        borderWidthSpinner.setMinimum(0);
        borderWidthSpinner.setIncrement(10);

        String width = symbolizersWrapper.getStrokeWidth();
        Double tmpWidth = isDouble(width);
        int tmp = 3;
        if (tmpWidth != null) {
            tmp = tmpWidth.intValue();
        }
        borderWidthSpinner.setSelection(tmp * 10);
        borderWidthSpinner.setDigits(1);
        borderWidthSpinner.addSelectionListener(this);
        borderWidthAttributecombo = new Combo(mainComposite, SWT.DROP_DOWN | SWT.READ_ONLY);
        borderWidthAttributecombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        borderWidthAttributecombo.setItems(numericAttributesArrays);
        borderWidthAttributecombo.addSelectionListener(this);
        borderWidthAttributecombo.select(0);
        if (tmpWidth == null) {
            int index = getAttributeIndex(width, numericAttributesArrays);
            if (index != -1) {
                borderWidthAttributecombo.select(index);
            }
        }

        // border alpha
        Label borderOpactityLabel = new Label(mainComposite, SWT.NONE);
        borderOpactityLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        borderOpactityLabel.setText(Messages.PointBoderParametersComposite_4);
        borderOpacitySpinner = new Spinner(mainComposite, SWT.BORDER);
        borderOpacitySpinner.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        borderOpacitySpinner.setMaximum(100);
        borderOpacitySpinner.setMinimum(0);
        borderOpacitySpinner.setIncrement(10);
        String opacity = symbolizersWrapper.getStrokeOpacity();
View Full Code Here

        // label alpha
        Label labelOpactityLabel = new Label(mainComposite, SWT.NONE);
        labelOpactityLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        labelOpactityLabel.setText(Messages.PolygonLabelsParametersComposite_3);
        labelOpacitySpinner = new Spinner(mainComposite, SWT.BORDER);
        labelOpacitySpinner.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        labelOpacitySpinner.setMaximum(100);
        labelOpacitySpinner.setMinimum(0);
        labelOpacitySpinner.setIncrement(10);
        String opacity = textSymbolizerWrapper.getOpacity();
        Double tmpOpacity = isDouble(opacity);
        int tmp = 100;
        if (tmpOpacity != null) {
            tmp = (int) (tmpOpacity.doubleValue() * 100);
        }
        labelOpacitySpinner.setSelection(tmp);
        labelOpacitySpinner.addSelectionListener(this);
        labelOpacityAttributecombo = new Combo(mainComposite, SWT.DROP_DOWN | SWT.READ_ONLY);
        labelOpacityAttributecombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        labelOpacityAttributecombo.setItems(numericAttributesArrays);
        labelOpacityAttributecombo.addSelectionListener(this);
        labelOpacityAttributecombo.select(0);
        if (tmpOpacity == null) {
            int index = getAttributeIndex(opacity, numericAttributesArrays);
            if (index != -1) {
                labelOpacityAttributecombo.select(index);
            }
        }

        // rotation
        Label rotationLabel = new Label(mainComposite, SWT.NONE);
        rotationLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        rotationLabel.setText(Messages.PolygonLabelsParametersComposite_4);
        rotationSpinner = new Spinner(mainComposite, SWT.BORDER);
        rotationSpinner.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        rotationSpinner.setMaximum(360);
        rotationSpinner.setMinimum(-360);
        rotationSpinner.setIncrement(45);
        String rotationStr = textSymbolizerWrapper.getRotation();
        Double tmpRotation = isDouble(rotationStr);
        tmp = 0;
        if (tmpRotation != null) {
            tmp = tmpRotation.intValue();
        }
        rotationSpinner.setSelection(tmp);
        rotationSpinner.addSelectionListener(this);
        rotationAttributecombo = new Combo(mainComposite, SWT.DROP_DOWN | SWT.READ_ONLY);
        rotationAttributecombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        rotationAttributecombo.setItems(numericAttributesArrays);
        rotationAttributecombo.addSelectionListener(this);
        rotationAttributecombo.select(0);
        if (tmpRotation == null) {
            int index = getAttributeIndex(rotationStr, numericAttributesArrays);
            if (index != -1) {
                rotationAttributecombo.select(index);
            }
        }

        // font
        Label fontLabel = new Label(mainComposite, SWT.NONE);
        fontLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        fontLabel.setText(Messages.PolygonLabelsParametersComposite_5);

        fontEditor = new FontEditor(mainComposite);
        GridData fontButtonGD = new GridData(SWT.FILL, SWT.FILL, true, false);
        fontButtonGD.horizontalSpan = 2;
        fontButton = fontEditor.getButton();
        fontButton.setLayoutData(fontButtonGD);
        fontEditor.setListener(this);

        FontData[] fontData = textSymbolizerWrapper.getFontData();
        if (fontData != null) {
            fontEditor.setFontList(fontData);
        }

        // font color
        Label fontColorLabel = new Label(mainComposite, SWT.NONE);
        fontColorLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        fontColorLabel.setText(Messages.PolygonLabelsParametersComposite_6);

        fontColorEditor = new StolenColorEditor(mainComposite, this);
        fontColorButton = fontColorEditor.getButton();
        GridData fontColorButtonGD = new GridData(SWT.FILL, SWT.CENTER, true, false);
        fontColorButtonGD.horizontalSpan = 2;
        fontColorButton.setLayoutData(fontColorButtonGD);
        Color tmpColor = null;;
        try {
            tmpColor = Color.decode(textSymbolizerWrapper.getColor());
        } catch (Exception e) {
            tmpColor = Color.black;
        }
        fontColorEditor.setColor(tmpColor);

        // label halo
        Label haloLabel = new Label(mainComposite, SWT.NONE);
        haloLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        haloLabel.setText(Messages.PolygonLabelsParametersComposite_7);

        haloColorEditor = new StolenColorEditor(mainComposite, this);
        haloColorButton = haloColorEditor.getButton();
        GridData haloColorButtonGD = new GridData(SWT.FILL, SWT.CENTER, true, false);
        haloColorButton.setLayoutData(haloColorButtonGD);
        tmpColor = null;;
        try {
            tmpColor = Color.decode(textSymbolizerWrapper.getHaloColor());
        } catch (Exception e) {
            tmpColor = Color.black;
        }
        haloColorEditor.setColor(tmpColor);

        haloRadiusSpinner = new Spinner(mainComposite, SWT.BORDER);
        haloRadiusSpinner.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        haloRadiusSpinner.setMaximum(20);
        haloRadiusSpinner.setMinimum(0);
        haloRadiusSpinner.setIncrement(1);
        String haloRadius = textSymbolizerWrapper.getHaloRadius();
View Full Code Here

        Integer tmpYOffset = Utilities.isNumber(yOffset, Integer.class);
        if (tmpXOffset == null || tmpYOffset == null) {
            tmpXOffset = 0;
            tmpYOffset = 0;
        }
        xOffsetSpinner = new Spinner(mainComposite, SWT.BORDER);
        xOffsetSpinner.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        xOffsetSpinner.setMaximum(Utilities.OFFSET_MAX);
        xOffsetSpinner.setMinimum(Utilities.OFFSET_MIN);
        xOffsetSpinner.setIncrement(Utilities.OFFSET_STEP);
        xOffsetSpinner.setSelection((int) (10 * tmpXOffset));
        xOffsetSpinner.setDigits(1);
        xOffsetSpinner.addSelectionListener(this);

        yOffsetSpinner = new Spinner(mainComposite, SWT.BORDER);
        yOffsetSpinner.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        yOffsetSpinner.setMaximum(Utilities.OFFSET_MAX);
        yOffsetSpinner.setMinimum(Utilities.OFFSET_MIN);
        yOffsetSpinner.setIncrement(Utilities.OFFSET_STEP);
        yOffsetSpinner.setSelection((int) (10 * tmpYOffset));
 
View Full Code Here

            redScale.setEnabled(true);
        }
        Label redLabel = new Label(control, SWT.SINGLE);
        redLabel.setText(multiLine ? "Red" : "R");

        redSpinner = new Spinner(control, SWT.BORDER);
        redSpinner.setMinimum(MIN);
        redSpinner.setMaximum(MAX);
        redSpinner.setEnabled(true);

        // GREEN
        if( multiLine ){
            greenScale = new Scale(control, SWT.HORIZONTAL);
            greenScale.setMaximum(MAX);
            greenScale.setMinimum(MIN);
        }
        Label greenLabel = new Label(control, SWT.SINGLE);
        greenLabel.setText(multiLine ? "Green" : "G");
       
        greenSpinner = new Spinner(control, SWT.BORDER);
        greenSpinner.setDigits(0);
        greenSpinner.setMinimum(MIN);
        greenSpinner.setMaximum(MAX);
       
        // BLUE
        if( multiLine ){
            blueScale = new Scale(control, SWT.HORIZONTAL);
            blueScale.setMaximum(MAX);
            blueScale.setMinimum(MIN);
        }
        Label blueLabel = new Label(control, SWT.SINGLE);
        blueLabel.setText(multiLine ? "Blue" : "B");
       
        blueSpinner = new Spinner(control, SWT.BORDER);
        blueSpinner.setDigits(0);
        blueSpinner.setMinimum(MIN);
        blueSpinner.setMaximum(MAX);
       
        // HEX
View Full Code Here

        Label spinnerLabel=null;
        if( multiLine){
            spinnerLabel = new Label(control, SWT.NONE);
            spinnerLabel.setText("Value:");
        }
        spinner = new Spinner(control, SWT.DEFAULT);
        spinner.setMinimum(0);
        spinner.setMaximum(100);
        spinner.setIncrement(10);
        spinner.setEnabled(false);
       
View Full Code Here

        lineStyle.setItems(LINE_STYLES);
        lineStyle.select(0);

        lineWidthLabel = new Label(container, SWT.NONE);
        lineWidthLabel.setText(Messages.GridStyleConfigurator_LineWidth);
        lineWidth = new Spinner(container, SWT.BORDER);
        lineWidth.setIncrement(1);
        lineWidth.setDigits(0);
        lineWidth.setMinimum(1);

        showLabelsLabel = new Label(container, SWT.NONE);
View Full Code Here

TOP

Related Classes of org.eclipse.swt.widgets.Spinner

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.