Package com.eagerlogic.cubee.client.style.styles

Examples of com.eagerlogic.cubee.client.style.styles.Padding


                }

                @Override
                public Integer calculate() {
                    int res = clientWidthProperty().get();
                    Padding padding = textBox.paddingProperty().get();
                    Border border = textBox.borderProperty().get();
                    if (padding != null) {
                        res = res - padding.getLeftPadding() - padding.getRightPadding();
                    }
                    if (border != null) {
                        res = res - border.getLeftBorderSize() - border.getRightBorderSize();
                    }
                    return res;
                }
            });
            textBox.heightProperty().bind(new AExpression<Integer>() {
               
                {
                    bind(clientHeightProperty(), textBox.paddingProperty(), textBox.borderProperty());
                }

                @Override
                public Integer calculate() {
                    int res = clientHeightProperty().get();
                    Padding padding = textBox.paddingProperty().get();
                    Border border = textBox.borderProperty().get();
                    if (padding != null) {
                        res = (res - padding.getTopPadding()) - padding.getBottomPadding();
                    }
                    if (border != null) {
                        res = (res - border.getTopBorderSize()) - border.getBottomBorderSize();
                    }
                    return res;
View Full Code Here


            for (int i = getChildren().size() - 1; i >= 0; i--) {
                AComponent child = getChildren().get(i);
                if (child != null) {
                    int parentX = x;
                    int parentY = y;
                    Padding p = this.paddingProperty().get();
                    if (p != null) {
                        parentX -= p.getLeftPadding();
                        parentY -= p.getTopPadding();
                    }
                    if (child.isIntersectsPoint(parentX, parentY)) {
                        int childX = parentX - child.getLeft() - child.translateXProperty().get();
                        int childY = parentY - child.getTop() - child.translateYProperty().get();
                        // TODO rotate and scale child point
View Full Code Here

        transformCenterY.addChangeListener(transformChangedListener);
        hovered.initReadonlyBind(hoveredSetter);
        padding.addChangeListener(new IChangeListener() {
            @Override
            public void onChanged(Object sender) {
                Padding p = padding.get();
                if (p == null) {
                    getElement().getStyle().setPadding(0.0, com.google.gwt.dom.client.Style.Unit.PX);
                } else {
                    p.apply(getElement());
                }
                requestLayout();
            }
        });
        padding.invalidate();
View Full Code Here

    private void onMeasure() {
        // calculating client bounds
        int cw = element.getClientWidth();
        int ch = element.getClientHeight();
        Padding p = padding.get();
        if (p != null) {
            cw = cw - p.getLeftPadding() - p.getRightPadding();
            ch = ch - p.getTopPadding() - p.getBottomPadding();
        }
        clientWidthSetter.set(cw);
        clientHeightSetter.set(ch);

        // calculating measured bounds
View Full Code Here

    private Button.StyleClass<Button> ButtonStyle() {
        Button.StyleClass<Button> res = new Button.StyleClass<Button>();
        LinearGradient bg = new LinearGradient(0.0, new ColorStop(0.0, Color.FUNKY_BLUE), new ColorStop(1.0, Color.fadeColors(Color.BLACK, Color.FUNKY_BLUE, 0.9)));
        res.getBackground().setValue(new StyleValue<ABackground>(bg));
        res.getPadding().setValue(new StyleValue<Padding>(new Padding(10, 5, 10, 5)));
        res.getBorder().setValue(new StyleValue<Border>(new Border(1, Color.fadeColors(Color.BLACK, Color.FUNKY_BLUE, 0.85), 0)));
        res.getForeColor().setValue(new StyleValue<Color>(Color.WHITE));
        res.getFontSize().setValue(new StyleValue<Integer>(14));
        res.getBold().setValue(new StyleValue<Boolean>(Boolean.TRUE));
        return res;
View Full Code Here

    private ComboBox.StyleClass<ComboBox> ComboBoxStyle() {
        ComboBox.StyleClass<ComboBox> res = new ComboBox.StyleClass<ComboBox>();
        LinearGradient bg = new LinearGradient(0.0, new ColorStop(0.0, Color.WHITE), new ColorStop(1.0, Color.getRgbColor(0xf0f0f0)));
        res.getBackground().setValue(new StyleValue<ABackground>(bg));
        res.getPadding().setValue(new StyleValue<Padding>(new Padding(10, 5, 10, 5)));
        res.getBorder().setValue(new StyleValue<Border>(new Border(1, Color.LIGHT_GRAY, 0)));
        return res;
    }
View Full Code Here

        return res;
    }

    private TextBox.StyleClass<TextBox> TextBoxStyle() {
        TextBox.StyleClass<TextBox> res = new TextBox.StyleClass<TextBox>();
        res.getPadding().setValue(new StyleValue<Padding>(new Padding(5)));
        res.getBorder().setValue(new StyleValue<Border>(new Border(1, Color.LIGHT_GRAY, 0)));
        return res;
    }
View Full Code Here

    }

    private AComponent createItem(String title, final int result, final VBox root) {
        Label label = new Label();
        label.paddingProperty().set(new Padding(5));
        label.textProperty().set(title.toString());
        label.minWidthProperty().bind(new AExpression<Integer>() {

            {
                this.bind(root.clientWidthProperty());
View Full Code Here

        vbMain.getChildren().add(null);
        vbMain.setCellHeight(vbMain.getChildren().size() - 1, 10);

        Panel btnPanel = new Panel();
        btnPanel.paddingProperty().set(new Padding(5));

        Button btnCancel = new Button();
        btnCancel.textProperty().set("Cancel");
        btnCancel.onClickEvent().addListener(new IEventListener<ClickEventArgs>() {
View Full Code Here

    private Button.StyleClass<Button> ButtonStyle() {
        Button.StyleClass<Button> res = new Button.StyleClass<Button>();
        LinearGradient bg = new LinearGradient(0.0, new ColorStop(0.0, Color.FUNKY_BLUE), new ColorStop(1.0, Color.fadeColors(Color.BLACK, Color.FUNKY_BLUE, 0.9)));
        res.getBackground().setValue(new StyleValue<ABackground>(bg));
        res.getPadding().setValue(new StyleValue<Padding>(new Padding(10, 5, 10, 5)));
        res.getBorder().setValue(new StyleValue<Border>(new Border(1, Color.fadeColors(Color.BLACK, Color.FUNKY_BLUE, 0.85), 0)));
        res.getForeColor().setValue(new StyleValue<Color>(Color.WHITE));
        res.getFontSize().setValue(new StyleValue<Integer>(14));
        res.getBold().setValue(new StyleValue<Boolean>(Boolean.TRUE));
        return res;
View Full Code Here

TOP

Related Classes of com.eagerlogic.cubee.client.style.styles.Padding

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.