jfig.utils
Class SimpleLatexParser.Box

java.lang.Object
  extended byjfig.utils.SimpleLatexParser.Box
Direct Known Subclasses:
SimpleLatexParser.CharBox, SimpleLatexParser.SubSuperScriptBox
Enclosing class:
SimpleLatexParser

class SimpleLatexParser.Box
extends java.lang.Object

like TeX, we try to abut aligned Box'es, each of which consists of other Boxes in turn, with a single character as the basic building block. Boxes are aligned along their baselines, where the integer values (x,y) specify the 75 dpi screen-coordinates of the origin for a box, while the values of w, a, d specify the width, ascent, and descent of the box. The formatting should probably changed to use FIG 2400 dpi world- coordinates instead of screen-coordinates, but the JDK 1.3+ font rendering does not really improve with higher resolution :-(

Unlike TeX, we use the predefined (Postscript) FIG fonts and assume the Unicode encoding. For jfig, a Box may be mapped to a FigCompound that holds FigText objects.


Field Summary
protected  int a
           
protected  int d
           
protected  SimpleLatexParser.Box next
           
protected  int w
           
protected  int x
           
protected  int y
           
 
Constructor Summary
(package private) SimpleLatexParser.Box()
           
 
Method Summary
 void append(SimpleLatexParser.Box child)
           
 void convertToFig(FigCompound parent)
          construct a FIG object from this Box and all its child boxes and put those as members into the specified FigCompound group object.
 void dump(java.io.PrintStream PS)
           
 int getA()
           
 java.awt.Point getAbutmentPoint()
           
 java.awt.Rectangle getBounds()
           
 int getD()
           
 FigRectangle getFigRectangle(FigCompound parent, int colorIndex, int layer)
          construct a FigRectangle at 2400dpi world-coordinates from our Box coordinates, and put it as a member into the specified FigCompound group object.
 SimpleLatexParser.Box getNextBox()
           
 int getW()
           
 int getX()
           
 int getY()
           
 void measure()
           
 void move(int dx, int dy)
           
 void setA(int a)
           
 void setD(int d)
           
 void setNextBox(SimpleLatexParser.Box box)
           
 void setOrigin(java.awt.Point p)
           
 void setW(int w)
           
 void setX(int x)
           
 void setY(int y)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

protected int x

y

protected int y

w

protected int w

a

protected int a

d

protected int d

next

protected SimpleLatexParser.Box next
Constructor Detail

SimpleLatexParser.Box

SimpleLatexParser.Box()
Method Detail

move

public void move(int dx,
                 int dy)

getX

public int getX()

getY

public int getY()

getW

public int getW()

getA

public int getA()

getD

public int getD()

setX

public void setX(int x)

setY

public void setY(int y)

setW

public void setW(int w)

setA

public void setA(int a)

setD

public void setD(int d)

getNextBox

public SimpleLatexParser.Box getNextBox()

setNextBox

public void setNextBox(SimpleLatexParser.Box box)

append

public void append(SimpleLatexParser.Box child)

measure

public void measure()

getBounds

public java.awt.Rectangle getBounds()

getAbutmentPoint

public java.awt.Point getAbutmentPoint()

setOrigin

public void setOrigin(java.awt.Point p)

toString

public java.lang.String toString()

dump

public void dump(java.io.PrintStream PS)

convertToFig

public void convertToFig(FigCompound parent)
construct a FIG object from this Box and all its child boxes and put those as members into the specified FigCompound group object. Check the display_boxes flag to decide whether to generate bounding boxes, too.


getFigRectangle

public FigRectangle getFigRectangle(FigCompound parent,
                                    int colorIndex,
                                    int layer)
construct a FigRectangle at 2400dpi world-coordinates from our Box coordinates, and put it as a member into the specified FigCompound group object.