1 package org.joshy.html.test; 2 3 import org.joshy.html.box.*; 4 import org.joshy.html.*; 5 import java.awt.Dimension ; 6 import org.w3c.dom.*; 7 import org.joshy.u; 8 public class XLayout extends CustomBlockLayout { 9 10 public Dimension getIntrinsicDimensions(Context c, Element elem) { 11 return new Dimension (50,50); 12 } 13 14 public void paintComponent(Context c, Box box) { 15 Dimension dim = box.getInternalDimension(); 16 u.p("dim = " + dim); 17 c.getGraphics().drawLine( 18 box.x, 19 box.y, 20 box.x+(int)dim.getWidth(), 21 box.y+(int)dim.getHeight()); 22 c.getGraphics().drawLine( 23 box.x, 24 box.y+(int)dim.getHeight(), 25 box.x+(int)dim.getWidth(), 26 box.y); 27 } 28 29 } 30 31 | Popular Tags |