Search in sources :

Example 1 with Size2D

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

the class GridArrangementTest method testNullBlock_FR.

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

Example 2 with Size2D

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

the class GridArrangementTest method testNullBlock_NN.

/**
 * The arrangement should be able to handle null blocks in the layout.
 */
@Test
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);
}
Also used : Size2D(org.jfree.ui.Size2D) Test(org.junit.Test)

Example 3 with Size2D

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

the class GridArrangementTest method testGridNotFull_FF.

/**
 * The arrangement should be able to handle less blocks than grid spaces.
 */
@Test
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);
}
Also used : Size2D(org.jfree.ui.Size2D) Test(org.junit.Test)

Example 4 with Size2D

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

the class GridArrangementTest method testGridNotFull_FN.

/**
 * The arrangement should be able to handle less blocks than grid spaces.
 */
@Test
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);
}
Also used : Size2D(org.jfree.ui.Size2D) Test(org.junit.Test)

Example 5 with Size2D

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

the class GridArrangementTest method testGridNotFull_FR.

/**
 * The arrangement should be able to handle less blocks than grid spaces.
 */
@Test
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);
}
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