public void testSizingWithWidthConstraint(){
  RectangleConstraint constraint=new RectangleConstraint(10.0,new Range(10.0,10.0),LengthConstraintType.FIXED,0.0,new Range(0.0,0.0),LengthConstraintType.NONE);
  BlockContainer container=new BlockContainer(new BorderArrangement());
  BufferedImage image=new BufferedImage(200,100,BufferedImage.TYPE_INT_RGB);
  Graphics2D g2=image.createGraphics();
  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));
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(16.0,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(12.3,45.6),RectangleEdge.RIGHT);
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(45.6,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(7.0,20.0));
  container.add(new EmptyBlock(8.0,45.6),RectangleEdge.RIGHT);
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(45.6,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(12.3,45.6),RectangleEdge.LEFT);
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(45.6,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(10.0,20.0));
  container.add(new EmptyBlock(12.3,45.6),RectangleEdge.LEFT);
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(45.6,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(10.0,20.0),RectangleEdge.RIGHT);
  container.add(new EmptyBlock(12.3,45.6),RectangleEdge.LEFT);
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(45.6,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(10.0,20.0));
  container.add(new EmptyBlock(12.3,45.6),RectangleEdge.LEFT);
  container.add(new EmptyBlock(5.4,3.2),RectangleEdge.RIGHT);
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(45.6,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(12.3,45.6),RectangleEdge.BOTTOM);
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(45.6,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(10.0,20.0));
  container.add(new EmptyBlock(12.3,45.6),RectangleEdge.BOTTOM);
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(65.6,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(10.0,20.0),RectangleEdge.RIGHT);
  container.add(new EmptyBlock(12.3,45.6),RectangleEdge.BOTTOM);
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(65.6,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(21.0,12.3));
  container.add(new EmptyBlock(10.0,20.0),RectangleEdge.RIGHT);
  container.add(new EmptyBlock(12.3,45.6),RectangleEdge.BOTTOM);
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(65.6,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(10.0,20.0),RectangleEdge.LEFT);
  container.add(new EmptyBlock(12.3,45.6),RectangleEdge.BOTTOM);
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(65.6,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(21.0,12.3));
  container.add(new EmptyBlock(10.0,20.0),RectangleEdge.LEFT);
  container.add(new EmptyBlock(12.3,45.6),RectangleEdge.BOTTOM);
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(65.6,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(21.0,12.3),RectangleEdge.RIGHT);
  container.add(new EmptyBlock(10.0,20.0),RectangleEdge.LEFT);
  container.add(new EmptyBlock(12.3,45.6),RectangleEdge.BOTTOM);
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(65.6,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(3.0,4.0),RectangleEdge.BOTTOM);
  container.add(new EmptyBlock(5.0,6.0),RectangleEdge.LEFT);
  container.add(new EmptyBlock(7.0,8.0),RectangleEdge.RIGHT);
  container.add(new EmptyBlock(9.0,10.0));
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(14.0,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(12.3,45.6),RectangleEdge.TOP);
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(45.6,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(10.0,20.0));
  container.add(new EmptyBlock(12.3,45.6),RectangleEdge.TOP);
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(65.6,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(10.0,20.0),RectangleEdge.RIGHT);
  container.add(new EmptyBlock(12.3,45.6),RectangleEdge.TOP);
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(65.6,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(21.0,12.3));
  container.add(new EmptyBlock(10.0,20.0),RectangleEdge.TOP);
  container.add(new EmptyBlock(12.3,45.6),RectangleEdge.RIGHT);
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(65.6,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(10.0,20.0),RectangleEdge.LEFT);
  container.add(new EmptyBlock(12.3,45.6),RectangleEdge.TOP);
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(65.6,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(21.0,12.3));
  container.add(new EmptyBlock(10.0,20.0),RectangleEdge.TOP);
  container.add(new EmptyBlock(12.3,45.6),RectangleEdge.LEFT);
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(65.6,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(21.0,12.3),RectangleEdge.RIGHT);
  container.add(new EmptyBlock(10.0,20.0),RectangleEdge.TOP);
  container.add(new EmptyBlock(12.3,45.6),RectangleEdge.LEFT);
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(65.6,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(1.0,2.0),RectangleEdge.TOP);
  container.add(new EmptyBlock(5.0,6.0),RectangleEdge.LEFT);
  container.add(new EmptyBlock(7.0,8.0),RectangleEdge.RIGHT);
  container.add(new EmptyBlock(9.0,10.0));
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(12.0,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(10.0,20.0),RectangleEdge.TOP);
  container.add(new EmptyBlock(12.3,45.6),RectangleEdge.BOTTOM);
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(65.6,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(21.0,12.3));
  container.add(new EmptyBlock(10.0,20.0),RectangleEdge.TOP);
  container.add(new EmptyBlock(12.3,45.6),RectangleEdge.BOTTOM);
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(77.9,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(21.0,12.3),RectangleEdge.RIGHT);
  container.add(new EmptyBlock(10.0,20.0),RectangleEdge.TOP);
  container.add(new EmptyBlock(12.3,45.6),RectangleEdge.BOTTOM);
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(77.9,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(1.0,2.0),RectangleEdge.TOP);
  container.add(new EmptyBlock(3.0,4.0),RectangleEdge.BOTTOM);
  container.add(new EmptyBlock(7.0,8.0),RectangleEdge.RIGHT);
  container.add(new EmptyBlock(9.0,10.0));
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(16.0,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(21.0,12.3),RectangleEdge.LEFT);
  container.add(new EmptyBlock(10.0,20.0),RectangleEdge.TOP);
  container.add(new EmptyBlock(12.3,45.6),RectangleEdge.BOTTOM);
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(77.9,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(1.0,2.0),RectangleEdge.TOP);
  container.add(new EmptyBlock(3.0,4.0),RectangleEdge.BOTTOM);
  container.add(new EmptyBlock(5.0,6.0),RectangleEdge.LEFT);
  container.add(new EmptyBlock(9.0,10.0));
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(16.0,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(1.0,2.0),RectangleEdge.TOP);
  container.add(new EmptyBlock(3.0,4.0),RectangleEdge.BOTTOM);
  container.add(new EmptyBlock(5.0,6.0),RectangleEdge.LEFT);
  container.add(new EmptyBlock(7.0,8.0),RectangleEdge.RIGHT);
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(14.0,size.height,EPSILON);
  container.clear();
  container.add(new EmptyBlock(1.0,2.0),RectangleEdge.TOP);
  container.add(new EmptyBlock(3.0,4.0),RectangleEdge.BOTTOM);
  container.add(new EmptyBlock(5.0,6.0),RectangleEdge.LEFT);
  container.add(new EmptyBlock(7.0,8.0),RectangleEdge.RIGHT);
  container.add(new EmptyBlock(9.0,10.0));
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(16.0,size.height,EPSILON);
  container.clear();
  size=container.arrange(g2,constraint);
  assertEquals(10.0,size.width,EPSILON);
  assertEquals(0.0,size.height,EPSILON);
}

public void testSizingWithWidthConstraint ( ) { RectangleConstraint constraint = new RectangleConstraint ( 10.0 , new Range ( 10.0 , 10.0 ) , LengthConstraintType . FIXED , 0.0 , new Range ( 0.0 , 0.0 ) , LengthConstraintType . NONE ) ; BlockContainer container = new BlockContainer ( new BorderArrangement ( ) ) ; BufferedImage image = new BufferedImage ( 200 , 100 , BufferedImage . TYPE_INT_RGB ) ; Graphics2D g2 = image . createGraphics ( ) ; 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 ) ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 16.0 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 12.3 , 45.6 ) , RectangleEdge . RIGHT ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 45.6 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 7.0 , 20.0 ) ) ; container . add ( new EmptyBlock ( 8.0 , 45.6 ) , RectangleEdge . RIGHT ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 45.6 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 12.3 , 45.6 ) , RectangleEdge . LEFT ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 45.6 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 10.0 , 20.0 ) ) ; container . add ( new EmptyBlock ( 12.3 , 45.6 ) , RectangleEdge . LEFT ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 45.6 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 10.0 , 20.0 ) , RectangleEdge . RIGHT ) ; container . add ( new EmptyBlock ( 12.3 , 45.6 ) , RectangleEdge . LEFT ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 45.6 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 10.0 , 20.0 ) ) ; container . add ( new EmptyBlock ( 12.3 , 45.6 ) , RectangleEdge . LEFT ) ; container . add ( new EmptyBlock ( 5.4 , 3.2 ) , RectangleEdge . RIGHT ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 45.6 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 12.3 , 45.6 ) , RectangleEdge . BOTTOM ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 45.6 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 10.0 , 20.0 ) ) ; container . add ( new EmptyBlock ( 12.3 , 45.6 ) , RectangleEdge . BOTTOM ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 65.6 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 10.0 , 20.0 ) , RectangleEdge . RIGHT ) ; container . add ( new EmptyBlock ( 12.3 , 45.6 ) , RectangleEdge . BOTTOM ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 65.6 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 21.0 , 12.3 ) ) ; container . add ( new EmptyBlock ( 10.0 , 20.0 ) , RectangleEdge . RIGHT ) ; container . add ( new EmptyBlock ( 12.3 , 45.6 ) , RectangleEdge . BOTTOM ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 65.6 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 10.0 , 20.0 ) , RectangleEdge . LEFT ) ; container . add ( new EmptyBlock ( 12.3 , 45.6 ) , RectangleEdge . BOTTOM ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 65.6 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 21.0 , 12.3 ) ) ; container . add ( new EmptyBlock ( 10.0 , 20.0 ) , RectangleEdge . LEFT ) ; container . add ( new EmptyBlock ( 12.3 , 45.6 ) , RectangleEdge . BOTTOM ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 65.6 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 21.0 , 12.3 ) , RectangleEdge . RIGHT ) ; container . add ( new EmptyBlock ( 10.0 , 20.0 ) , RectangleEdge . LEFT ) ; container . add ( new EmptyBlock ( 12.3 , 45.6 ) , RectangleEdge . BOTTOM ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 65.6 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 3.0 , 4.0 ) , RectangleEdge . BOTTOM ) ; container . add ( new EmptyBlock ( 5.0 , 6.0 ) , RectangleEdge . LEFT ) ; container . add ( new EmptyBlock ( 7.0 , 8.0 ) , RectangleEdge . RIGHT ) ; container . add ( new EmptyBlock ( 9.0 , 10.0 ) ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 14.0 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 12.3 , 45.6 ) , RectangleEdge . TOP ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 45.6 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 10.0 , 20.0 ) ) ; container . add ( new EmptyBlock ( 12.3 , 45.6 ) , RectangleEdge . TOP ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 65.6 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 10.0 , 20.0 ) , RectangleEdge . RIGHT ) ; container . add ( new EmptyBlock ( 12.3 , 45.6 ) , RectangleEdge . TOP ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 65.6 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 21.0 , 12.3 ) ) ; container . add ( new EmptyBlock ( 10.0 , 20.0 ) , RectangleEdge . TOP ) ; container . add ( new EmptyBlock ( 12.3 , 45.6 ) , RectangleEdge . RIGHT ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 65.6 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 10.0 , 20.0 ) , RectangleEdge . LEFT ) ; container . add ( new EmptyBlock ( 12.3 , 45.6 ) , RectangleEdge . TOP ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 65.6 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 21.0 , 12.3 ) ) ; container . add ( new EmptyBlock ( 10.0 , 20.0 ) , RectangleEdge . TOP ) ; container . add ( new EmptyBlock ( 12.3 , 45.6 ) , RectangleEdge . LEFT ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 65.6 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 21.0 , 12.3 ) , RectangleEdge . RIGHT ) ; container . add ( new EmptyBlock ( 10.0 , 20.0 ) , RectangleEdge . TOP ) ; container . add ( new EmptyBlock ( 12.3 , 45.6 ) , RectangleEdge . LEFT ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 65.6 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 1.0 , 2.0 ) , RectangleEdge . TOP ) ; container . add ( new EmptyBlock ( 5.0 , 6.0 ) , RectangleEdge . LEFT ) ; container . add ( new EmptyBlock ( 7.0 , 8.0 ) , RectangleEdge . RIGHT ) ; container . add ( new EmptyBlock ( 9.0 , 10.0 ) ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 12.0 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 10.0 , 20.0 ) , RectangleEdge . TOP ) ; container . add ( new EmptyBlock ( 12.3 , 45.6 ) , RectangleEdge . BOTTOM ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 65.6 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 21.0 , 12.3 ) ) ; container . add ( new EmptyBlock ( 10.0 , 20.0 ) , RectangleEdge . TOP ) ; container . add ( new EmptyBlock ( 12.3 , 45.6 ) , RectangleEdge . BOTTOM ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 77.9 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 21.0 , 12.3 ) , RectangleEdge . RIGHT ) ; container . add ( new EmptyBlock ( 10.0 , 20.0 ) , RectangleEdge . TOP ) ; container . add ( new EmptyBlock ( 12.3 , 45.6 ) , RectangleEdge . BOTTOM ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 77.9 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 1.0 , 2.0 ) , RectangleEdge . TOP ) ; container . add ( new EmptyBlock ( 3.0 , 4.0 ) , RectangleEdge . BOTTOM ) ; container . add ( new EmptyBlock ( 7.0 , 8.0 ) , RectangleEdge . RIGHT ) ; container . add ( new EmptyBlock ( 9.0 , 10.0 ) ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 16.0 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 21.0 , 12.3 ) , RectangleEdge . LEFT ) ; container . add ( new EmptyBlock ( 10.0 , 20.0 ) , RectangleEdge . TOP ) ; container . add ( new EmptyBlock ( 12.3 , 45.6 ) , RectangleEdge . BOTTOM ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 77.9 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 1.0 , 2.0 ) , RectangleEdge . TOP ) ; container . add ( new EmptyBlock ( 3.0 , 4.0 ) , RectangleEdge . BOTTOM ) ; container . add ( new EmptyBlock ( 5.0 , 6.0 ) , RectangleEdge . LEFT ) ; container . add ( new EmptyBlock ( 9.0 , 10.0 ) ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 16.0 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 1.0 , 2.0 ) , RectangleEdge . TOP ) ; container . add ( new EmptyBlock ( 3.0 , 4.0 ) , RectangleEdge . BOTTOM ) ; container . add ( new EmptyBlock ( 5.0 , 6.0 ) , RectangleEdge . LEFT ) ; container . add ( new EmptyBlock ( 7.0 , 8.0 ) , RectangleEdge . RIGHT ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 14.0 , size . height , EPSILON ) ; container . clear ( ) ; container . add ( new EmptyBlock ( 1.0 , 2.0 ) , RectangleEdge . TOP ) ; container . add ( new EmptyBlock ( 3.0 , 4.0 ) , RectangleEdge . BOTTOM ) ; container . add ( new EmptyBlock ( 5.0 , 6.0 ) , RectangleEdge . LEFT ) ; container . add ( new EmptyBlock ( 7.0 , 8.0 ) , RectangleEdge . RIGHT ) ; container . add ( new EmptyBlock ( 9.0 , 10.0 ) ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 16.0 , size . height , EPSILON ) ; container . clear ( ) ; size = container . arrange ( g2 , constraint ) ; assertEquals ( 10.0 , size . width , EPSILON ) ; assertEquals ( 0.0 , size . height , EPSILON ) ; }
run some checks on sizing when there is a fixed width constraint .
