Beispiel #1
0
 public void doLayout(
     int availWidth,
     int availHeight,
     boolean expandWidth,
     boolean expandHeight,
     FloatingBoundsSource floatBoundsSource,
     int defaultOverflowX,
     int defaultOverflowY,
     boolean sizeOnly) {
   RenderState renderState = this.modelNode.getRenderState();
   int counterStart = 1;
   Object rootNode = this.modelNode;
   if (!(rootNode instanceof HTMLElementImpl)) {
     return;
   }
   HTMLElementImpl rootElement = (HTMLElementImpl) rootNode;
   String startText = rootElement.getAttribute("start");
   if (startText != null) {
     try {
       counterStart = Integer.parseInt(startText);
     } catch (NumberFormatException nfe) {
       // ignore
     }
   }
   renderState.resetCount(DEFAULT_COUNTER_NAME, this.listNesting, counterStart);
   super.doLayout(
       availWidth,
       availHeight,
       expandWidth,
       expandHeight,
       floatBoundsSource,
       defaultOverflowX,
       defaultOverflowY,
       sizeOnly);
 }
Beispiel #2
0
 /*
  * (non-Javadoc)
  *
  * @see
  * net.sourceforge.xamj.domimpl.markup.Renderable#paint(java.awt.Graphics)
  */
 public void paint(final Graphics g) {
   final RenderState rs = this.modelNode.getRenderState();
   g.setColor(rs.getColor());
   g.setFont(rs.getFont());
 }