    All Packages    This Package    Previous    Next

# Class browser.WRFormatter

    java.lang.Object
       |
       +----awt.Formatter
               |
               +----browser.WRFormatter

public class WRFormatter
extends Formatter

Class WRFormatter adds the functionality above and beyond that of a basic formatter to layout html documents. This includes handling of html anchors, html list contexts, html forms, html image alignment

Version:
  1.35, 20 Mar 1995
Author:
  Jonathan Payne, James Gosling

##

tagIndex
tagList

##

WRFormatter(WRWindow, Document)

##

addDisplayItem(DisplayItem, boolean)
  Adds a display item to the window.
adjustItem(DisplayItem, int)
  This adjusts a DisplayItem on the current line.
charAt(int)
finishCurrentLine()
getLength()
layout()
makeTextItem(int, int)
  Makes a hotjava text item.
processStyleRefs(int)
reset()

##

tagList

      protected Vector tagList

tagIndex

      protected int tagIndex

##

WRFormatter

      public WRFormatter(WRWindow m,
                         Document d)

##

getLength

      protected int getLength()

charAt

      protected int charAt(int i)

makeTextItem

      protected TextDisplayItem makeTextItem(int pos0,
                                             int pos1)

  Makes a hotjava text item.
  Overrides:
    makeTextItem in class Formatter

adjustItem

      protected void adjustItem(DisplayItem di,
                                int x)

  This adjusts a DisplayItem on the current line. It's called for each display item on a line, when the formatter finishes the line, to go back and adjust items. E.g., this handles lining up baselines for all text that appeared on the line, or, image alignment ala html and mosaic.
  Overrides:
    adjustItem in class Formatter

finishCurrentLine

      protected void finishCurrentLine()

addDisplayItem

      public boolean addDisplayItem(DisplayItem di,
                                    boolean checkForWrap)

  Adds a display item to the window. This takes into consideration image alignment when adjusting the lineAscent and lineDescent instance variables. This doesn't worry about positioning everything correctly at this point - that is handled by adjustItem, which is called when the entire line is layed out.
  Overrides:
    addDisplayItem in class Formatter

processStyleRefs

      protected int processStyleRefs(int pos)

reset

      protected void reset()

layout

      public void layout()

    All Packages    This Package    Previous    Next