jfig.utils
Class LP2.Box
java.lang.Object
jfig.utils.LP2.Box
- Direct Known Subclasses:
- LP2.CharBox, LP2.GroupBox, LP2.SqrtBox, LP2.StackBox
- Enclosing class:
- LP2
- public class LP2.Box
- extends java.lang.Object
like TeX, we try to abut aligned Box'es, each of which consists
of other Boxes in turn, with single character CharBoxes as the
basic building blocks.
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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
x
protected int x
y
protected int y
w
protected int w
a
protected int a
d
protected int d
next
protected LP2.Box next
prev
protected LP2.Box prev
parent
protected LP2.Box parent
comment
protected java.lang.String comment
LP2.Box
public LP2.Box()
setComment
public void setComment(java.lang.String s)
getComment
public java.lang.String getComment()
move
public void move(int dx,
int dy)
moveTo
public void moveTo(int newX,
int newY)
getX
public int getX()
getY
public int getY()
getW
public int getW()
getA
public int getA()
getD
public int getD()
getOrigin
public java.awt.Point getOrigin()
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 LP2.Box getNextBox()
getPrevBox
public LP2.Box getPrevBox()
setNextBox
public void setNextBox(LP2.Box box)
setPrevBox
public void setPrevBox(LP2.Box box)
append
public void append(LP2.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)
getParent
public LP2.Box getParent()
setParent
public void setParent(LP2.Box _parent)
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.