Package org.jfree.ui

Examples of org.jfree.ui.Size2D


     * The arrangement should be able to handle null blocks in the layout.
     */
    public void testNullBlock_NN() {
        BlockContainer c = new BlockContainer(new GridArrangement(1, 1));
        c.add(null);
        Size2D s = c.arrange(null, RectangleConstraint.NONE);
        assertEquals(0.0, s.getWidth(), EPSILON);
        assertEquals(0.0, s.getHeight(), EPSILON);
    }
View Full Code Here


     */
    public void testGridNotFull_FF() {
        Block b1 = new EmptyBlock(5, 5);
        BlockContainer c = new BlockContainer(new GridArrangement(2, 3));
        c.add(b1);
        Size2D s = c.arrange(null, new RectangleConstraint(200, 100));
        assertEquals(200.0, s.getWidth(), EPSILON);
        assertEquals(100.0, s.getHeight(), EPSILON);
    }
View Full Code Here

     */
    public void testGridNotFull_FN() {
        Block b1 = new EmptyBlock(5, 5);
        BlockContainer c = new BlockContainer(new GridArrangement(2, 3));
        c.add(b1);
        Size2D s = c.arrange(null, RectangleConstraint.NONE.toFixedWidth(30.0));
        assertEquals(30.0, s.getWidth(), EPSILON);
        assertEquals(10.0, s.getHeight(), EPSILON);
    }
View Full Code Here

     */
    public void testGridNotFull_FR() {
        Block b1 = new EmptyBlock(5, 5);
        BlockContainer c = new BlockContainer(new GridArrangement(2, 3));
        c.add(b1);
        Size2D s = c.arrange(null, new RectangleConstraint(30.0, new Range(5.0,
                10.0)));
        assertEquals(30.0, s.getWidth(), EPSILON);
        assertEquals(10.0, s.getHeight(), EPSILON);
    }
View Full Code Here

     */
    public void testGridNotFull_NN() {
        Block b1 = new EmptyBlock(5, 5);
        BlockContainer c = new BlockContainer(new GridArrangement(2, 3));
        c.add(b1);
        Size2D s = c.arrange(null, RectangleConstraint.NONE);
        assertEquals(15.0, s.getWidth(), EPSILON);
        assertEquals(10.0, s.getHeight(), EPSILON);
    }
View Full Code Here

                BufferedImage.TYPE_INT_RGB);
        Graphics2D g2 = image.createGraphics();

        // TBLRC
        // 00000 - no items
        Size2D size = container.arrange(g2);
        assertEquals(0.0, size.width, EPSILON);
        assertEquals(0.0, size.height, EPSILON);

        // TBLRC
        // 00001 - center item only
View Full Code Here

        Graphics2D g2 = image.createGraphics();

        // TBLRC
        // 00001 - center item only
        container.add(new EmptyBlock(5.0, 6.0));
        Size2D size = container.arrange(g2, constraint);
        assertEquals(10.0, size.width, EPSILON);
        assertEquals(6.0, size.height, EPSILON);

        container.clear();
        container.add(new EmptyBlock(15.0, 16.0));
View Full Code Here

        Graphics2D g2 = image.createGraphics();

        container.add(new EmptyBlock(10.0, 6.0), RectangleEdge.LEFT);
        container.add(new EmptyBlock(20.0, 6.0), RectangleEdge.RIGHT);
        container.add(new EmptyBlock(30.0, 6.0));
        Size2D size = container.arrange(g2, constraint);
        assertEquals(60.0, size.width, EPSILON);
        assertEquals(6.0, size.height, EPSILON);

        container.clear();
        container.add(new EmptyBlock(10.0, 6.0), RectangleEdge.LEFT);
View Full Code Here

     * @param constraint  the constraint (<code>null</code> not permitted).
     *
     * @return The block size (in Java2D units, never <code>null</code>).
     */
    public Size2D arrange(Graphics2D g2, RectangleConstraint constraint) {
        Size2D base = new Size2D(calculateTotalWidth(getWidth()),
                calculateTotalHeight(getHeight()));
        return constraint.calculateConstrainedSize(base);
    }
View Full Code Here

            }
            else if (h == LengthConstraintType.RANGE) {
                return arrangeRR(container, g2, constraint);
            }
        }
        return new Size2D()// TODO: complete this

    }
View Full Code Here

TOP

Related Classes of org.jfree.ui.Size2D

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.