All Packages Class Hierarchy This Package Previous Next Index
Class mathbus.draw.Noad
java.lang.Object
|
+----mathbus.Node
|
+----mathbus.draw.Noad
- public abstract class Noad
- extends Node
Base class for the box and glue classes that are used to construct
two dimensional displays of mathematical objects. Throughout, the
basic unit used for linear dimensions is the SMU, which is about
1/15 of the width of a period.
Noads are MathBus Node's, but they contain additional slots
to cache formatting information and have a number of member
functions that implement the functionality of page setting. The
most important of these cached values are the height, width and
depth of the box. These values are cached, since they depend upon
the scale and fonts used to display the expressions. The
parameters can be accessed through the member functions Height(),
Width() and Depth().
One other parameter are also present in Noads. The Align parameter
indicates how boxes are to be aligned in vertical lists. Boxes in
horizonal lists are always aligned at their baselines, but this may
change in the future.
Sixteeen extra bits are also available for use by sub-classes. They can
be accessed using the Extra() and setExtra() methods.
-
AlignCenter
-
-
AlignDefault
-
-
AlignLeft
-
-
AlignRight
-
-
BinOpLookup
-
-
fl
-
-
FuncLookup
-
-
halfSMUsize
-
-
PDWidth
-
-
SMUsize
-
-
Noad()
-
-
Align()
- Returns the alignment of the Noad (0, 1, or 2).
-
Depth()
- Returns the depth the Noad in SMU's.
-
Display(Graphics, int, int, FontList, int)
-
-
Display(Graphics, int, int, int)
- Draw the Noad structure on the graphics device g.
-
DrawBoundingBox(Graphics, int, int, int, Color, Color)
-
-
Height()
- Returns the height the Noad in SMU's.
-
incDepth(int)
- Add val to the width the Noad
-
incHeight(int)
- Add val to the height the Noad
-
incWidth(int)
- Add val to the width the Noad
-
IsSimple(Node)
-
-
Level()
- Returns the Level of the Noad.
-
NextLevel(int)
- Returns the next level after lev.
-
PixelstoSMU(int)
- Returns the integer number of SMU's corresponding to the given
number of pixels.
-
ProcessNode(Node, int)
- Convert a mathbus Node to a Node.
-
RaiseBaseline(int)
- Raise the baseline of this box by incr.
-
setAlign(int)
- Sets the alignment of the Noad to val.
-
setDepth(int)
- Sets the depth the Noad.
-
setHeight(int)
- Sets the height the Noad.
-
setLevel(int)
- Sets the Level of the Noad.
-
setWidth(int)
- Sets the width the Noad.
-
SizeNoad()
- Compute the actual sizes of the noads of a term.
-
SizeNoad(Graphics)
-
-
SMUtoPixels(int)
- Returns the integer number of pixels corresponding to the given
number of SMU's.
-
Width()
- Returns the width the Noad in SMU's.
AlignDefault
public static final int AlignDefault
AlignCenter
public static final int AlignCenter
AlignLeft
public static final int AlignLeft
AlignRight
public static final int AlignRight
fl
protected static FontList fl
FuncLookup
protected static Hashtable FuncLookup
BinOpLookup
protected static Hashtable BinOpLookup
SMUsize
protected static final int SMUsize
halfSMUsize
protected static final int halfSMUsize
PDWidth
protected static final int PDWidth
Noad
public Noad()
Height
public final int Height()
- Returns the height the Noad in SMU's.
setHeight
public final void setHeight(int val)
- Sets the height the Noad.
- Parameters:
- val - new height of Noad in SMU's
incHeight
public final void incHeight(int val)
- Add val to the height the Noad
- Parameters:
- val - Increment for the height of the Noad in SMU's
Width
public final int Width()
- Returns the width the Noad in SMU's.
setWidth
public final void setWidth(int val)
- Sets the width the Noad.
- Parameters:
- val - new width of Noad in SMU's
incWidth
public final void incWidth(int val)
- Add val to the width the Noad
- Parameters:
- val - Increment for the width of the Noad in SMU's
Depth
public final int Depth()
- Returns the depth the Noad in SMU's.
setDepth
public final void setDepth(int val)
- Sets the depth the Noad.
- Parameters:
- val - new depth of Noad in SMU's
incDepth
public final void incDepth(int val)
- Add val to the width the Noad
- Parameters:
- val - Increment for the width of the Noad in SMU's
Align
public final int Align()
- Returns the alignment of the Noad (0, 1, or 2).
setAlign
public final void setAlign(int val)
- Sets the alignment of the Noad to val.
Level
public final int Level()
- Returns the Level of the Noad.
setLevel
public final void setLevel(int val)
- Sets the Level of the Noad.
Display
protected abstract void Display(Graphics g,
int x,
int y,
FontList DisplayFL,
int c)
Display
public void Display(Graphics g,
int x,
int y,
int c)
- Draw the Noad structure on the graphics device g.
- Parameters:
- g - A Graphics device
- x - The x-coordinate at which to begin drawing.
- y - The y-coordinate for the baseline of the text.
- c - The scaling factor at which to do this drawing.
SMUtoPixels
public static int SMUtoPixels(int smu)
- Returns the integer number of pixels corresponding to the given
number of SMU's.
PixelstoSMU
public static int PixelstoSMU(int pix)
- Returns the integer number of SMU's corresponding to the given
number of pixels.
NextLevel
public static int NextLevel(int lev)
- Returns the next level after lev. It usually esthetially more
pleasing to top out after three levels of scripting. This
enforces that limitation.
IsSimple
protected static boolean IsSimple(Node n)
RaiseBaseline
public void RaiseBaseline(int incr)
- Raise the baseline of this box by incr. The height and depth of
the box are changed appropriately.
ProcessNode
public static Noad ProcessNode(Node n,
int lev)
- Convert a mathbus Node to a Node. This is where all the
intelligence about how semantic expressions should be converted
into the topological information about the two dimensional
display. The method SizeNoad is responsible for computing the
sizes of the Noads.
- See Also:
- Noad@SizeNoad
SizeNoad
public void SizeNoad(Graphics g)
DrawBoundingBox
public void DrawBoundingBox(Graphics g,
int x,
int y,
int c,
Color box,
Color baseline)
SizeNoad
public void SizeNoad()
- Compute the actual sizes of the noads of a term.
All Packages Class Hierarchy This Package Previous Next Index