Package booton.css.value

Examples of booton.css.value.Numeric


     * @param unitBlur
     * @return
     */
    public Box shadow(double offsetX, Unit unitX, double offsetY, Unit unitY, double blur, Unit unitBlur, Color color) {
        ShadowValue shadow = new ShadowValue();
        shadow.offsetX = new Numeric(offsetX, unitX);
        shadow.offsetY = new Numeric(offsetY, unitY);
        shadow.blur = new Numeric(blur, unitBlur);
        shadow.color = color;
        shadows.add(shadow);

        return chain();
    }
View Full Code Here


     * @param unitBlur
     * @return
     */
    public Box shadowInset(double offsetX, Unit unitX, double offsetY, Unit unitY, double blur, Unit unitBlur, Color color) {
        ShadowValue shadow = new ShadowValue();
        shadow.offsetX = new Numeric(offsetX, unitX);
        shadow.offsetY = new Numeric(offsetY, unitY);
        shadow.blur = new Numeric(blur, unitBlur);
        shadow.inset = true;
        shadow.color = color;
        shadows.add(shadow);

        return chain();
View Full Code Here

     * @param unitSpread
     * @return
     */
    public Box shadow(double offsetX, Unit unitX, double offsetY, Unit unitY, double blur, Unit unitBlur, double spread, Unit unitSpread, Color color) {
        ShadowValue shadow = new ShadowValue();
        shadow.offsetX = new Numeric(offsetX, unitX);
        shadow.offsetY = new Numeric(offsetY, unitY);
        shadow.blur = new Numeric(blur, unitBlur);
        shadow.spread = new Numeric(spread, unitSpread);
        shadow.color = color;
        shadows.add(shadow);

        return chain();
    }
View Full Code Here

     * @param unitSpread
     * @return
     */
    public Box shadowInset(double offsetX, Unit unitX, double offsetY, Unit unitY, double blur, Unit unitBlur, double spread, Unit unitSpread, Color color) {
        ShadowValue shadow = new ShadowValue();
        shadow.offsetX = new Numeric(offsetX, unitX);
        shadow.offsetY = new Numeric(offsetY, unitY);
        shadow.blur = new Numeric(blur, unitBlur);
        shadow.spread = new Numeric(spread, unitSpread);
        shadow.inset = true;
        shadow.color = color;
        shadows.add(shadow);

        return chain();
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    protected void write(StyleDeclarable writer) {
        if (match(widths) && match(styles) && match(colors)) {
            Numeric width = widths.get(Side.Top);
            BorderStyle style = styles.get(Side.Top);
            Color color = colors.get(Side.Top);

            if (width != null && style != null && color != null) {
                writer.property(name, width, style, color);
View Full Code Here

     *
     * @param map
     * @return A result.
     */
    private boolean match(Side side) {
        Numeric width = widths.get(side);
        BorderStyle style = styles.get(side);
        Color color = colors.get(side);

        return (width == null && style == null && color == null) || (width != null && style != null && color != null);
    }
View Full Code Here

        /**
         * {@inheritDoc}
         */
        @Override
        public Numeric width() {
            Numeric value = widths.get(side);

            return value == null ? Numeric.Zero : value;
        }
View Full Code Here

     *
     * @param bubbleHeight
     */
    public final void createBottomBubble(int bubbleHeight) {

        Numeric borderWidth = border.width();
        Color borderColor = border.color();
        Color boxBackColor = background.color();

        if (!position.isAbsolute() && !position.isRelative()) {
            position.relative();
        }

        Numeric width = borderWidth.add(bubbleHeight);

        // write bubble border color
        before(() -> {
            display.block();
            box.size(0, px);
            content.text("");
            position.absolute().left(50, percent).top(100, percent);
            margin.left(width.opposite());
            border.solid().color(Transparent).width(width);
            border.top.color(borderColor);
        });

        // write bubble background color
        if (borderWidth.size != 0) {
            Numeric width2 = width.subtract(borderWidth.multiply(1.5));

            after(() -> {
                display.block();
                box.size(0, px);
                content.text("");
                position.absolute().left(50, percent).top(100, percent);
                margin.left(width2.opposite());
                border.solid().color(Transparent).width(width2);
                border.top.color(boxBackColor.opacify(1));
            });
        }
    }
View Full Code Here

     * </p>
     *
     * @param bubbleHeight
     */
    public final void createTopBubble(int bubbleHeight) {
        Numeric borderWidth = border.width();
        Color borderColor = border.color();
        Color boxBackColor = background.color();

        if (!position.isAbsolute() && !position.isRelative()) {
            position.relative();
        }

        Numeric width = borderWidth.add(bubbleHeight);

        // write bubble border color
        before(() -> {
            display.block();
            box.size(0, px);
            content.text("");
            position.absolute().left(50, percent).bottom(100, percent);
            margin.left(width.opposite());
            border.solid().color(Transparent).width(width);
            border.bottom.color(borderColor);
        });

        // write bubble background color
        if (borderWidth.size != 0) {
            Numeric borderWitdh = width.subtract(borderWidth.multiply(1.5));

            after(() -> {
                display.block();
                box.size(0, px);
                content.text("");
                position.absolute().left(50, percent).bottom(100, percent);
                margin.left(borderWitdh.opposite());
                border.solid().color(Transparent).width(borderWitdh);
                border.bottom.color(boxBackColor.opacify(1));
            });
        }
    }
View Full Code Here

     *
     * @param size
     * @return
     */
    public Line height(double size, Unit unit) {
        height = new Numeric(size, unit).toString();

        return chain();
    }
View Full Code Here

TOP

Related Classes of booton.css.value.Numeric

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.