Search in sources :

Example 36 with Size2D

use of org.jfree.ui.Size2D in project SIMVA-SoS by SESoS.

the class GridArrangementTest method testNF.

/**
 * Test arrangement with a fixed height and no width constraint.
 */
@Test
public void testNF() {
    BlockContainer c = createTestContainer1();
    RectangleConstraint constraint = RectangleConstraint.NONE.toFixedHeight(100.0);
    Size2D s = c.arrange(null, constraint);
    assertEquals(90.0, s.width, EPSILON);
    assertEquals(100.0, s.height, EPSILON);
}
Also used : Size2D(org.jfree.ui.Size2D) Test(org.junit.Test)

Example 37 with Size2D

use of org.jfree.ui.Size2D in project SIMVA-SoS by SESoS.

the class GridArrangementTest method testNullBlock_FN.

/**
 * The arrangement should be able to handle null blocks in the layout.
 */
@Test
public void testNullBlock_FN() {
    BlockContainer c = new BlockContainer(new GridArrangement(1, 1));
    c.add(null);
    Size2D s = c.arrange(null, RectangleConstraint.NONE.toFixedWidth(10));
    assertEquals(10.0, s.getWidth(), EPSILON);
    assertEquals(0.0, s.getHeight(), EPSILON);
}
Also used : Size2D(org.jfree.ui.Size2D) Test(org.junit.Test)

Example 38 with Size2D

use of org.jfree.ui.Size2D in project SIMVA-SoS by SESoS.

the class GridArrangementTest method testNN.

/**
 * Test arrangement with no constraints.
 */
@Test
public void testNN() {
    BlockContainer c = createTestContainer1();
    Size2D s = c.arrange(null, RectangleConstraint.NONE);
    assertEquals(90.0, s.width, EPSILON);
    assertEquals(33.0, s.height, EPSILON);
}
Also used : Size2D(org.jfree.ui.Size2D) Test(org.junit.Test)

Example 39 with Size2D

use of org.jfree.ui.Size2D in project SIMVA-SoS by SESoS.

the class GridArrangementTest method testRR.

/**
 * Test arrangement with a range for the width and height.
 */
@Test
public void testRR() {
    BlockContainer c = createTestContainer1();
    RectangleConstraint constraint = new RectangleConstraint(new Range(40.0, 60.0), new Range(50.0, 70.0));
    Size2D s = c.arrange(null, constraint);
    assertEquals(60.0, s.width, EPSILON);
    assertEquals(50.0, s.height, EPSILON);
}
Also used : Size2D(org.jfree.ui.Size2D) Range(org.jfree.data.Range) Test(org.junit.Test)

Example 40 with Size2D

use of org.jfree.ui.Size2D in project SIMVA-SoS by SESoS.

the class GridArrangementTest method testNR.

/**
 * Test arrangement with a range for the height and no width constraint.
 */
@Test
public void testNR() {
    BlockContainer c = createTestContainer1();
    RectangleConstraint constraint = RectangleConstraint.NONE.toRangeHeight(new Range(40.0, 60.0));
    Size2D s = c.arrange(null, constraint);
    assertEquals(90.0, s.width, EPSILON);
    assertEquals(40.0, s.height, EPSILON);
}
Also used : Size2D(org.jfree.ui.Size2D) Range(org.jfree.data.Range) Test(org.junit.Test)

Aggregations

Size2D (org.jfree.ui.Size2D)62 Test (org.junit.Test)19 Rectangle2D (java.awt.geom.Rectangle2D)18 Range (org.jfree.data.Range)14 List (java.util.List)10 RectangleConstraint (org.jfree.chart.block.RectangleConstraint)8 RectangleEdge (org.jfree.ui.RectangleEdge)5 Graphics2D (java.awt.Graphics2D)4 BufferedImage (java.awt.image.BufferedImage)4 ArrayList (java.util.ArrayList)4 LengthConstraintType (org.jfree.chart.block.LengthConstraintType)4 RectangleInsets (org.jfree.ui.RectangleInsets)4 FontMetrics (java.awt.FontMetrics)3 Shape (java.awt.Shape)3 Point2D (java.awt.geom.Point2D)2 BlockParams (org.jfree.chart.block.BlockParams)2 EntityBlockResult (org.jfree.chart.block.EntityBlockResult)2 G2TextMeasurer (org.jfree.text.G2TextMeasurer)2 Arc2D (java.awt.geom.Arc2D)1 Iterator (java.util.Iterator)1