[VCLab-Main] [Software] [HotEqn] [cHotEqnComponent]


cHotEqn Component

The IMGless AWT-based Equation Viewer
for use in other applications and applets


Hot Links

Download
Documentation: Inheritance ---- Constructors ---- Public Methods
FAQ ---- Update ---- Errors

Inheritance

java.lang.Object
   |
   +----java.awt.Component
           |
           +----cHotEqn
public class cHotEqn
extends Component
implements MouseListener, MouseMotionListener

Constructors

Constructors Explanation
 public cHotEqn()
Construtor without any initial equation.
 public cHotEqn(String equation)
Construtor with initial equation to display.
 public cHotEqn(String equation,
                Applet app, String name)
Construtor with initial equation to display in an applet context. name is the applet name.

Methods

Method / Syntax Explanation
public void setEquation(String equation)
Sets the current equation.
 public String getEquation()
Returns the current equation.
 public void setDebug(boolean debug)
Switches debug mode on and off. The component will print debug information to the console while working.
 public boolean isDebug()
Returns if the debug mode is on or off.
 public void setFontname(String fontname)
Sets one of the fonts available in java. Note: the font for Greek letters and all symbols cannot be changed.
 public String getFontname()
Returns the current fontname.
 public void setFontsizes(int gsize1,
                          int gsize2,
                          int gsize3,
                          int gsize4)
Sets the fontsizes for rendering. Possible values are 18, 14, 16, 12, 10 and 8.
 public void setBackground(Color BGColor)
Overrides:
setBackground in class Component
Sets the background color.
 public Color getBackground()
Overrides:
getBackground in class Component
Returns the used background color.
 public void setForeground(Color FGColor)
Overrides:
setForeground in class Component
Sets the foreground color.
 public Color getForeground()
Overrides:
getForeground in class Component
Returns the used foreground color.
 public void setBorderColor(Color border)
Sets the color for the optional border.
 public Color getBorderColor()
Returns the color of the optional border.
 public void setBorder(boolean borderB)
Switches the border on and off.
 public boolean isBorder()
Returns wether or not a border is displayed.
 public void 
   setRoundRectBorder(boolean borderB)
Switches between a round and a rectangular border.
TRUE: round border
FALSE: rectangular border
 public boolean isRoundRectBorder()
Returns if the border is round or rectangular.
 public void setEnvColor(Color env)
Sets the color for the environment. Only useful if border is round.
 public Color getEnvColor()
Returns the color of the environment.
 public void setHAlign(String halign)
Sets the horizontal alignment. Possible values are: left, center and right.
 public String getHAlign()
Returns the horizontal alignment of the equation.
 public void setVAlign(String valign)
Sets the vertical alignment. Possible values are: top, middle and bottom.
 public String getVAlign()
Returns the vertical alignment of the equation.
 public void setEditable(boolean editableB)
Makes the component almost editable. Parts of the displayed equation are selectable when editable is set true.
This is turned on by default.
 public boolean isEditable()
Returns wether or not the equation if editable (selectable).
 public String getSelectedArea()
Return the selected area text of an expression. The selection is performed by pressing left mouse button down, dragging and mouse button up. The area pointed between button down and up is selected.
 public Dimension getPreferredSize()
Overrides:
getPreferredSize in class Component
Returns the preferred size required to display the whole equation.
 public Dimension getMinimumSize()
Overrides:
getMinimumSize in class Component
Returns the minimum size required to display the whole equation. This method return the same value as getPreferredSize
 public Dimension getSizeof(String equation)
Returns the size required to display the given equation.
public void 
   addActionListener(ActionListener
                      listener)
Adds the specified action listener to recieve action events from this text field.
public void 
   removeActionListener(ActionListener 
                         listener)
Removes the specified action listener to recieve action events from this text field.
public Image 
   getImage()
Returns the Image object of this component. If null returned, the image is not ready.

cHotEqn Download

The cHotEqn component is included together with applets and font files in a jar archive, which can be downloaded below.

cHotEqn
Download HotEqn.jar.zip (83 KB)

[VCLab-Main] [Software] [HotEqn] [cHotEqnComponent]


© CS SM 1998, 2001, 2002, 2003