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.


Variable Index

 o AlignCenter
 o AlignDefault
 o AlignLeft
 o AlignRight
 o BinOpLookup
 o fl
 o FuncLookup
 o halfSMUsize
 o PDWidth
 o SMUsize

Constructor Index

 o Noad()

Method Index

 o Align()
Returns the alignment of the Noad (0, 1, or 2).
 o Depth()
Returns the depth the Noad in SMU's.
 o Display(Graphics, int, int, FontList, int)
 o Display(Graphics, int, int, int)
Draw the Noad structure on the graphics device g.
 o DrawBoundingBox(Graphics, int, int, int, Color, Color)
 o Height()
Returns the height the Noad in SMU's.
 o incDepth(int)
Add val to the width the Noad
 o incHeight(int)
Add val to the height the Noad
 o incWidth(int)
Add val to the width the Noad
 o IsSimple(Node)
 o Level()
Returns the Level of the Noad.
 o NextLevel(int)
Returns the next level after lev.
 o PixelstoSMU(int)
Returns the integer number of SMU's corresponding to the given number of pixels.
 o ProcessNode(Node, int)
Convert a mathbus Node to a Node.
 o RaiseBaseline(int)
Raise the baseline of this box by incr.
 o setAlign(int)
Sets the alignment of the Noad to val.
 o setDepth(int)
Sets the depth the Noad.
 o setHeight(int)
Sets the height the Noad.
 o setLevel(int)
Sets the Level of the Noad.
 o setWidth(int)
Sets the width the Noad.
 o SizeNoad()
Compute the actual sizes of the noads of a term.
 o SizeNoad(Graphics)
 o SMUtoPixels(int)
Returns the integer number of pixels corresponding to the given number of SMU's.
 o Width()
Returns the width the Noad in SMU's.

Variables

 o AlignDefault
 public static final int AlignDefault
 o AlignCenter
 public static final int AlignCenter
 o AlignLeft
 public static final int AlignLeft
 o AlignRight
 public static final int AlignRight
 o fl
 protected static FontList fl
 o FuncLookup
 protected static Hashtable FuncLookup
 o BinOpLookup
 protected static Hashtable BinOpLookup
 o SMUsize
 protected static final int SMUsize
 o halfSMUsize
 protected static final int halfSMUsize
 o PDWidth
 protected static final int PDWidth

Constructors

 o Noad
 public Noad()

Methods

 o Height
 public final int Height()
Returns the height the Noad in SMU's.

 o setHeight
 public final void setHeight(int val)
Sets the height the Noad.

Parameters:
val - new height of Noad in SMU's
 o 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
 o Width
 public final int Width()
Returns the width the Noad in SMU's.

 o setWidth
 public final void setWidth(int val)
Sets the width the Noad.

Parameters:
val - new width of Noad in SMU's
 o 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
 o Depth
 public final int Depth()
Returns the depth the Noad in SMU's.

 o setDepth
 public final void setDepth(int val)
Sets the depth the Noad.

Parameters:
val - new depth of Noad in SMU's
 o 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
 o Align
 public final int Align()
Returns the alignment of the Noad (0, 1, or 2).

 o setAlign
 public final void setAlign(int val)
Sets the alignment of the Noad to val.

 o Level
 public final int Level()
Returns the Level of the Noad.

 o setLevel
 public final void setLevel(int val)
Sets the Level of the Noad.

 o Display
 protected abstract void Display(Graphics g,
                                 int x,
                                 int y,
                                 FontList DisplayFL,
                                 int c)
 o 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.
 o SMUtoPixels
 public static int SMUtoPixels(int smu)
Returns the integer number of pixels corresponding to the given number of SMU's.

 o PixelstoSMU
 public static int PixelstoSMU(int pix)
Returns the integer number of SMU's corresponding to the given number of pixels.

 o 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.

 o IsSimple
 protected static boolean IsSimple(Node n)
 o RaiseBaseline
 public void RaiseBaseline(int incr)
Raise the baseline of this box by incr. The height and depth of the box are changed appropriately.

 o 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
 o SizeNoad
 public void SizeNoad(Graphics g)
 o DrawBoundingBox
 public void DrawBoundingBox(Graphics g,
                             int x,
                             int y,
                             int c,
                             Color box,
                             Color baseline)
 o SizeNoad
 public void SizeNoad()
Compute the actual sizes of the noads of a term.


All Packages  Class Hierarchy  This Package  Previous  Next  Index