Package tripleplay.ui.util

Examples of tripleplay.ui.util.Insets


            });
        }
    }

    protected Rectangle getNativeFieldBounds () {
        Insets insets = resolveStyle(Style.BACKGROUND).insets;
        Point screenCoords = Layer.Util.layerToScreen(layer, insets.left(), insets.top());
        return new Rectangle(screenCoords.x, screenCoords.y,
                             _size.width - insets.width(), _size.height - insets.height());
    }
View Full Code Here


     * @param hintY if non-zero, an indication that the element will be constrained in the y
     * direction to the specified height.
     */
    protected Dimension computeSize (float hintX, float hintY) {
        LayoutData ldata = _ldata = createLayoutData(hintX, hintY);
        Insets insets = ldata.bg.insets;
        Dimension size = ldata.computeSize(hintX - insets.width(), hintY - insets.height());
        return insets.addTo(size);
    }
View Full Code Here

            bginst = _bginst.set(ldata.bg.instantiate(_size));
            bginst.addTo(layer, 0, 0, 0);
        }

        // do our actual layout
        Insets insets = ldata.bg.insets;
        ldata.layout(insets.left(), insets.top(),
                     width - insets.width(), height - insets.height());

        // finally clear our cached layout data
        clearLayoutData();
    }
View Full Code Here

    @Override protected Instance instantiate (final IDimension size) {
        // we use one layer, and add the constituents to that
        GroupLayer layer = PlayN.graphics().createGroupLayer();
        final Instance[] instances = new Instance[_constituents.length];

        Insets current = Insets.ZERO;
        for (int ii = 0, ll = _constituents.length; ii < ll; ii++) {
            Background bg = _constituents[ii];

            // create and save off the instance so we can destroy it later
            instances[ii] = instantiate(bg, current.subtractFrom(new Dimension(size)));

            // add to our composite layer and translate the layers added
            instances[ii].addTo(layer, current.left(), current.top(), 0);

            // adjust the bounds
            current = current.mutable().add(bg.insets);
        }

        if (_reverseDepth) {
            // simple reversal, if optimization is needed it would be better to simply
            // instantiate the backgrounds in reverse order above
View Full Code Here

    /**
     * Configures non-uniform insets on this background.
     */
    public Background inset (float top, float right, float bottom, float left) {
        insets = new Insets(top, right, bottom, left);
        return this;
    }
View Full Code Here

TOP

Related Classes of tripleplay.ui.util.Insets

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.