Package edu.cmu.relativelayout

Examples of edu.cmu.relativelayout.RelativePosition


    JButton one = new JButton("One");
    JButton two = new JButton("Two");
    JButton three = new JButton("Three");

    RelativePosition tenToTheRight = new RelativePosition(Edge.LEFT, 10, Direction.RIGHT, Edge.RIGHT);

    Binding wtf = new Binding(Edge.VERTICAL_CENTER, 12, Direction.LEFT, Edge.VERTICAL_CENTER, two);
    Binding moreWtf = new Binding(Edge.VERTICAL_CENTER, 12, Direction.LEFT, Edge.HORIZONTAL_CENTER, three);
    Binding stillMoreWtf = new Binding(Edge.TOP, 12, Direction.ABOVE, Edge.LEFT, one);

    System.out.println("Sane relation valid: " + tenToTheRight.isValid());
    System.out.println("RelativePosition 1 valid: " + wtf.isValid());
    System.out.println("RelativePosition 2 valid: " + moreWtf.isValid());
    System.out.println("RelativePosition 3 valid: " + stillMoreWtf.isValid());

    RelativeConstraints c1 = new RelativeConstraints();
View Full Code Here


    Binding leftEdge = new Binding(Edge.LEFT, 0, Direction.RIGHT, Edge.LEFT, frame);
    Binding rightEdge = new Binding(Edge.RIGHT, 0, Direction.LEFT, Edge.RIGHT, frame);
    Binding topEdge = new Binding(Edge.TOP, 0, Direction.BELOW, Edge.TOP, frame);
    Binding bottomEdge = new Binding(Edge.BOTTOM, 0, Direction.ABOVE, Edge.BOTTOM, frame);

    RelativePosition justBelow = new RelativePosition(Edge.TOP, 0, Direction.BELOW, Edge.BOTTOM);
    RelativePosition justAbove = new RelativePosition(Edge.BOTTOM, 0, Direction.ABOVE, Edge.TOP);
    RelativePosition eightBelow = new RelativePosition(Edge.TOP, 8, Direction.BELOW, Edge.BOTTOM);
    RelativePosition eightRightOf = new RelativePosition(Edge.LEFT, 8, Direction.RIGHT, Edge.RIGHT);

    RelativeConstraints toolbarConstraints = new RelativeConstraints();
    toolbarConstraints
                      .addBindings(
                                   new Binding(Edge.HORIZONTAL_CENTER, 0, Direction.LEFT, Edge.HORIZONTAL_CENTER, frame),
View Full Code Here

TOP

Related Classes of edu.cmu.relativelayout.RelativePosition

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.