Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Spinner


        borderEnabled.setEnabled( false );
        borderEnabled.setSelection( true );
       
        lineColourEditor = new StolenColorEditor( border, this);
       
        lineWidth = new Spinner( border, SWT.HORIZONTAL);    
        lineWidth.setMinimum(1);
        lineWidth.setMaximum(30);
        lineWidth.setPageIncrement(5);
        lineWidth.addSelectionListener(this);
        lineWidth.setToolTipText( Messages.SLDLineEditorPart_border_width_tooltip );
       
        lineOpacity = new Spinner( border, SWT.HORIZONTAL);
        lineOpacity.setMinimum(0);
        lineOpacity.setMaximum(opacityMaxValue);
        lineOpacity.setPageIncrement(10);
        lineOpacity.addSelectionListener( this );
        lineOpacity.setToolTipText( Messages.SLDLineEditorPart_border_opacity_tooltip );
View Full Code Here


            container.setLayout(new GridLayout(2, false));

            Label lineWidthLabel = new Label(container, SWT.NONE);
            lineWidthLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
            lineWidthLabel.setText("Line width");
            lineWidthSpinner = new Spinner(container, SWT.BORDER);
            lineWidthSpinner.setMinimum(1);
            lineWidthSpinner.setMaximum(10);
            lineWidthSpinner.setIncrement(1);
            lineWidthSpinner.setSelection((int) lineWidth);
            lineWidthSpinner.addListener(SWT.Modify, this);
            lineWidthSpinner.addListener(SWT.KeyUp, this);

            Label lineAlphaLabel = new Label(container, SWT.NONE);
            lineAlphaLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
            lineAlphaLabel.setText("Line alpha");
            lineAlphaSpinner = new Spinner(container, SWT.BORDER);
            lineAlphaSpinner.setMinimum(0);
            lineAlphaSpinner.setMaximum(255);
            lineAlphaSpinner.setIncrement(5);
            lineAlphaSpinner.setSelection(lineAlpha);
            lineAlphaSpinner.addListener(SWT.Modify, this);
            lineAlphaSpinner.addListener(SWT.KeyUp, this);

            Label lineColorLabel = new Label(container, SWT.NONE);
            lineColorLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
            lineColorLabel.setText("Line color");
            lineColorButton = new Button(container, SWT.PUSH);
            lineColorButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
            lineColorButton.setText("...");
            lineColorButton.addListener(SWT.Selection, this);

            Label fillAlphaLabel = new Label(container, SWT.NONE);
            fillAlphaLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
            fillAlphaLabel.setText("Fill alpha");
            fillAlphaSpinner = new Spinner(container, SWT.BORDER);
            fillAlphaSpinner.setMinimum(0);
            fillAlphaSpinner.setMaximum(255);
            fillAlphaSpinner.setIncrement(5);
            fillAlphaSpinner.setSelection(fillAlpha);
            fillAlphaSpinner.addListener(SWT.Modify, this);
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.BoderParametersComposite_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 = lineSymbolizerWrapper.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.BoderParametersComposite_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);

View Full Code Here

        marginsGroup.setLayoutData(gridData);
        marginsGroup.setLayout(gridLayout);
        marginsGroup.setText(Messages.ImageExportPage_marginsGroup);
        Label topLabel = new Label(marginsGroup, SWT.NONE);
        topLabel.setText(Messages.ImageExportPage_topMargin);
        topMarginSpinner = new Spinner(marginsGroup, SWT.NONE);
        topMarginSpinner.setSelection(10);
        Label lowerLabel = new Label(marginsGroup, SWT.NONE);
        lowerLabel.setText(Messages.ImageExportPage_lowerMargin);
        lowerMarginSpinner = new Spinner(marginsGroup, SWT.NONE);
        lowerMarginSpinner.setSelection(10);
        Label leftLabel = new Label(marginsGroup, SWT.NONE);
        leftLabel.setText(Messages.ImageExportPage_leftMargin);
        leftMarginSpinner = new Spinner(marginsGroup, SWT.NONE);
        leftMarginSpinner.setSelection(10);
        Label rightLabel = new Label(marginsGroup, SWT.NONE);
        rightLabel.setText(Messages.ImageExportPage_rightMargin);
        rightMarginSpinner = new Spinner(marginsGroup, SWT.NONE);
        rightMarginSpinner.setSelection(10);

    }
View Full Code Here

        Composite marker = subpart(parent, Messages.SLDMarkerEditorPart_label_marker, 2);

        markerType = new Combo(marker, SWT.READ_ONLY);
        markerType.addSelectionListener(this);

        markerWidth = new Spinner(marker, SWT.NONE);
        markerWidth.setMinimum(1);
        markerWidth.setMaximum(30);
        markerWidth.setPageIncrement(5);
        markerWidth.addSelectionListener(this);
        markerWidth.setToolTipText(Messages.SLDMarkerEditorPart_width_tooltip);
View Full Code Here

        borderEnabled.addSelectionListener(this);
        borderEnabled.setToolTipText(Messages.SLDMarkerEditorPart_border_enabled_tooltip);

        borderColour = new StolenColorEditor(border, this);

        borderWidth = new Spinner(border, SWT.NONE);
        borderWidth.setMinimum(1);
        borderWidth.setMaximum(30);
        borderWidth.setPageIncrement(5);
        borderWidth.addSelectionListener(this);
        borderWidth.setToolTipText(Messages.SLDMarkerEditorPart_border_width_tooltip);

        borderOpacity = new Spinner(border, SWT.NONE);
        borderOpacity.setMinimum(0);
        borderOpacity.setMaximum(opacityMaxValue);
        borderOpacity.setPageIncrement(10);
        borderOpacity.setToolTipText(Messages.SLDMarkerEditorPart_border_opacity_tooltip);
    }
View Full Code Here

        markerEnabled.addSelectionListener(this);
        markerEnabled.setToolTipText(Messages.SLDMarkerEditorPart_marker_enabled_tooltip);

        markerColour = new StolenColorEditor(fill, this);

        markerOpacity = new Spinner(fill, SWT.NONE);
        markerOpacity.setMinimum(0);
        markerOpacity.setMaximum(opacityMaxValue);
        markerOpacity.setPageIncrement(10);
        markerOpacity.setToolTipText(Messages.SLDMarkerEditorPart_fill_opacity_tooltip);
    }
View Full Code Here

        // size
        Label sizeLabel = new Label(mainComposite, SWT.NONE);
        sizeLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        sizeLabel.setText(Messages.PointGeneralParametersComposite_3);
        sizeSpinner = new Spinner(mainComposite, SWT.BORDER);
        sizeSpinner.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        sizeSpinner.setMaximum(200);
        sizeSpinner.setMinimum(0);
        sizeSpinner.setIncrement(1);
        String size = pointSymbolizerWrapper.getSize();
        Double tmpSize = isDouble(size);
        int tmp = 3;
        if (tmpSize != null) {
            tmp = tmpSize.intValue();
        }
        sizeSpinner.setSelection(tmp);
        sizeSpinner.addSelectionListener(this);
        sizeAttributecombo = new Combo(mainComposite, SWT.DROP_DOWN | SWT.READ_ONLY);
        sizeAttributecombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        sizeAttributecombo.setItems(numericAttributesArrays);
        sizeAttributecombo.addSelectionListener(this);
        if (tmpSize == null) {
            int index = getAttributeIndex(size, numericAttributesArrays);
            if (index != -1) {
                sizeAttributecombo.select(index);
            }
        }

        Label rotationLabel = new Label(mainComposite, SWT.NONE);
        rotationLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        rotationLabel.setText(Messages.PointGeneralParametersComposite_4);
        rotationSpinner = new Spinner(mainComposite, SWT.BORDER);
        rotationSpinner.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        rotationSpinner.setMaximum(360);
        rotationSpinner.setMinimum(0);
        rotationSpinner.setIncrement(5);
        String rotation = pointSymbolizerWrapper.getRotation();
        Double tmpRotation = isDouble(rotation);
        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);
        if (tmpSize == null) {
            int index = getAttributeIndex(rotation, numericAttributesArrays);
            if (index != -1) {
                rotationAttributecombo.select(index);
            }
        }

        // offset
        Label offsetLabel = new Label(mainComposite, SWT.NONE);
        GridData offsetLabelGD = new GridData(SWT.FILL, SWT.CENTER, true, false);
        offsetLabel.setLayoutData(offsetLabelGD);
        offsetLabel.setText(Messages.PointGeneralParametersComposite_5);

        String xOffset = pointSymbolizerWrapper.getxOffset();
        String yOffset = pointSymbolizerWrapper.getyOffset();
        Double tmpXOffset = Utilities.isNumber(xOffset, Double.class);
        Double tmpYOffset = Utilities.isNumber(yOffset, Double.class);
        if (tmpXOffset == null || tmpYOffset == null) {
            tmpXOffset = 0.0;
            tmpYOffset = 0.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

        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

        // label alpha
        Label labelOpactityLabel = new Label(mainComposite, SWT.NONE);
        labelOpactityLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        labelOpactityLabel.setText(Messages.PointLabelsParametersComposite_5);
        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.PointLabelsParametersComposite_6);
        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.PointLabelsParametersComposite_7);

        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.PointLabelsParametersComposite_8);

        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.PointLabelsParametersComposite_9);

        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();
        Double tmpRadius = isDouble(haloRadius);
        tmp = 0;
        if (tmpRadius != null) {
            tmp = tmpRadius.intValue();
        }
        haloRadiusSpinner.setSelection(tmp);
        haloRadiusSpinner.addSelectionListener(this);

        // anchor
        Label anchorLabel = new Label(mainComposite, SWT.NONE);
        anchorLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        anchorLabel.setText(Messages.PointLabelsParametersComposite_10);

        anchorVerticalCombo = new Combo(mainComposite, SWT.DROP_DOWN | SWT.READ_ONLY);
        anchorVerticalCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        anchorVerticalCombo.setItems(Alignments.toVerticalStrings());
        anchorVerticalCombo.addSelectionListener(this);
        String anchorY = textSymbolizerWrapper.getAnchorY();
        Alignments vertAlign = Alignments.verticalAlignmentfromDouble(anchorY);
        anchorVerticalCombo.select(vertAlign.toIndex());

        anchorHorizontalCombo = new Combo(mainComposite, SWT.DROP_DOWN | SWT.READ_ONLY);
        anchorHorizontalCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        anchorHorizontalCombo.setItems(Alignments.toHorizontalStrings());
        anchorHorizontalCombo.addSelectionListener(this);
        String anchorX = textSymbolizerWrapper.getAnchorX();
        Alignments horAlign = Alignments.horizontalAlignmentfromDouble(anchorX);
        anchorHorizontalCombo.select(horAlign.toIndex());

        // displacement
        Label displacementLabel = new Label(mainComposite, SWT.NONE);
        displacementLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        displacementLabel.setText(Messages.PointLabelsParametersComposite_11);

        String displacementX = textSymbolizerWrapper.getDisplacementX();
        String displacementY = textSymbolizerWrapper.getDisplacementY();
        Double tmpXdisplacement = Utilities.isNumber(displacementX, Double.class);
        Double tmpYdisplacement = Utilities.isNumber(displacementY, Double.class);
        if (tmpXdisplacement == null || tmpYdisplacement == null) {
            tmpXdisplacement = 0.0;
            tmpYdisplacement = 0.0;
        }
        xDisplacementSpinner = new Spinner(mainComposite, SWT.BORDER);
        xDisplacementSpinner.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        xDisplacementSpinner.setMaximum(Utilities.DISPLACEMENT_MAX);
        xDisplacementSpinner.setMinimum(Utilities.DISPLACEMENT_MIN);
        xDisplacementSpinner.setIncrement(Utilities.DISPLACEMENT_STEP);
        xDisplacementSpinner.setSelection((int) (10 * tmpXdisplacement));
        xDisplacementSpinner.setDigits(1);
        xDisplacementSpinner.addSelectionListener(this);

        yDisplacementSpinner = new Spinner(mainComposite, SWT.BORDER);
        yDisplacementSpinner.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        yDisplacementSpinner.setMaximum(Utilities.DISPLACEMENT_MAX);
        yDisplacementSpinner.setMinimum(Utilities.DISPLACEMENT_MIN);
        yDisplacementSpinner.setIncrement(Utilities.DISPLACEMENT_STEP);
        yDisplacementSpinner.setSelection((int) (10 * tmpYdisplacement));
 
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.