Examples of LayoutDirection


Examples of nextapp.echo2.app.LayoutDirection

        Integer orientationValue = (Integer) splitPane.getRenderProperty(SplitPane.PROPERTY_ORIENTATION);
        int orientation = orientationValue == null ? SplitPane.ORIENTATION_HORIZONTAL_LEADING_TRAILING
                : orientationValue.intValue();
        if (orientation == SplitPane.ORIENTATION_HORIZONTAL_LEADING_TRAILING
                || orientation == SplitPane.ORIENTATION_HORIZONTAL_TRAILING_LEADING) {
            LayoutDirection layoutDirection = splitPane.getRenderLayoutDirection();
            if (orientation == SplitPane.ORIENTATION_HORIZONTAL_LEADING_TRAILING) {
                orientation = layoutDirection.isLeftToRight() ? SplitPane.ORIENTATION_HORIZONTAL_LEFT_RIGHT
                        : SplitPane.ORIENTATION_HORIZONTAL_RIGHT_LEFT;
            } else {
                orientation = layoutDirection.isLeftToRight() ? SplitPane.ORIENTATION_HORIZONTAL_RIGHT_LEFT
                        : SplitPane.ORIENTATION_HORIZONTAL_LEFT_RIGHT;
            }
        }
        return orientation;
    }
View Full Code Here

Examples of nextapp.echo2.app.LayoutDirection

     * @param alignment the <code>Alignment</code> to analyze
     * @param component the <code>Component</code> to analyze
     * @return the horizontal alignment constant
     */
    public static int getRenderedHorizontal(Alignment alignment, Component component) {
        LayoutDirection layoutDirection;
        if (component == null) {
            layoutDirection = LayoutDirection.LTR;
        } else {
            layoutDirection = component.getRenderLayoutDirection();
        }
        switch (alignment.getHorizontal()) {
        case Alignment.LEADING:
            return layoutDirection.isLeftToRight() ? Alignment.LEFT : Alignment.RIGHT;
        case Alignment.TRAILING:
            return layoutDirection.isLeftToRight() ? Alignment.RIGHT : Alignment.LEFT;
        default:
            return alignment.getHorizontal();
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.