Package org.hxzon.swing.layout.simple

Examples of org.hxzon.swing.layout.simple.SimpleLayoutData


                logger.debug(e.getKey() + " pref height:" + e.getKey().prefHeight(width));
                resultHeight = Math.max(resultHeight, e.getKey().prefHeight(width));
            }
        } else {//v
            for (Entry<Node, SimpleLayoutData> e : componentMap.entrySet()) {
                SimpleLayoutData layoutData = e.getValue();
                double compPreferredSize = e.getKey().prefHeight(width);
                logger.debug(e.getKey() + " pref height:" + compPreferredSize);
                if (layoutData == null) {
                    resultHeight += compPreferredSize;
                } else if (layoutData.isFixedSize()) {
                    resultHeight += layoutData.fixedSize;
                } else {
                    resultHeight += compPreferredSize;
                }
            }
View Full Code Here


    public double computePrefWidth(double height) {
        double resultWidth = 0;
        Insets insets = new Insets(0, 0, 0, 0);
        if (horizontal) {//h
            for (Entry<Node, SimpleLayoutData> e : componentMap.entrySet()) {
                SimpleLayoutData layoutData = e.getValue();
                double compPreferredSize = e.getKey().prefWidth(height);
//                logger.debug(e.getKey()+" pref width:"+compPreferredSize);
                if (layoutData == null) {
                    resultWidth += compPreferredSize;
                } else if (layoutData.isFixedSize()) {
                    resultWidth += layoutData.fixedSize;
                } else {
                    resultWidth += compPreferredSize;
                }
            }
View Full Code Here

        logger.debug("total fill size:" + fillSize);
        logger.debug("parent height:" + parentHeight);
        logger.debug("parent width:" + parentWidth);
        if (horizontal) {//h
            for (Node comp : components) {
                SimpleLayoutData layoutData = componentMap.get(comp);
                if (layoutData == null) {
                    curSize = comp.prefWidth(USE_PREF_SIZE);
                    logger.debug("preferred size:" + curSize);
                } else if (layoutData.isFixedSize()) {
                    curSize = layoutData.fixedSize;
                    logger.debug("fixed size:" + curSize);
                } else {
                    curSize = fillSize * layoutData.fixedPercent / 100;
                    logger.debug("fill size:" + curSize + ", percent:" + layoutData.fixedPercent);
                }
                comp.relocate(x, y);
                comp.resize(curSize, parentHeight);
                x += curSize;
            }
        } else {//v
            for (Node comp : components) {
                SimpleLayoutData layoutData = componentMap.get(comp);
                if (layoutData == null) {
                    curSize = comp.prefHeight(USE_PREF_SIZE);
                    logger.debug("preferred size:" + curSize);
                } else if (layoutData.isFixedSize()) {
                    curSize = layoutData.fixedSize;
                    logger.debug("fixed size:" + curSize);
                } else {
                    curSize = fillSize * layoutData.fixedPercent / 100;
                    logger.debug("fill size:" + curSize + ", percent:" + layoutData.fixedPercent);
View Full Code Here

TOP

Related Classes of org.hxzon.swing.layout.simple.SimpleLayoutData

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.