org.scilab.forge.jlatexmath
Class Atom

java.lang.Object
  extended by org.scilab.forge.jlatexmath.Atom
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
AccentedAtom, BigDelimiterAtom, BigOperatorAtom, BoldAtom, CedillaAtom, CharSymbol, ColorAtom, CumulativeScriptsAtom, DdotsAtom, DynamicAtom, EmptyAtom, FBoxAtom, FencedAtom, FractionAtom, GeoGebraLogoAtom, GraphicsAtom, HlineAtom, IddotsAtom, IJAtom, ItAtom, LapedAtom, LaTeXAtom, LCaronAtom, MathAtom, MatrixAtom, MiddleAtom, MulticolumnAtom, MultlineAtom, NthRoot, OgonekAtom, OverlinedAtom, OverUnderDelimiter, PhantomAtom, RaiseAtom, ReflectAtom, ResizeAtom, RomanAtom, RotateAtom, RowAtom, RuleAtom, ScaleAtom, ScriptsAtom, SmallCapAtom, SmashedAtom, SpaceAtom, SsAtom, StyleAtom, tcaronAtom, TextCircledAtom, TextStyleAtom, TStrokeAtom, TtAtom, TypedAtom, UnderOverArrowAtom, UnderOverAtom, UnderscoreAtom, VCenteredAtom, VdotsAtom, VlineAtom, VRowAtom, XArrowAtom

public abstract class Atom
extends java.lang.Object
implements java.lang.Cloneable

An abstract superclass for all logical mathematical constructions that can be a part of a TeXFormula. All subclasses must implement the abstract createBox(TeXEnvironment) method that transforms this logical unit into a concrete box (that can be painted). They also must define their type, used for determining what glue to use between adjacent atoms in a "row construction". That can be one single type by asigning one of the type constants to the type field. But they can also be defined as having two types: a "left type" and a "right type". This can be done by implementing the methods getLeftType() and getRightType(). The left type will then be used for determining the glue between this atom and the previous one (in a row, if any) and the right type for the glue between this atom and the following one (in a row, if any).

Author:
Kurt Vermeulen

Field Summary
 int alignment
           
 int type
          The type of the atom (default value: ordinary atom)
 int type_limits
           
 
Constructor Summary
Atom()
           
 
Method Summary
 Atom clone()
           
abstract  Box createBox(TeXEnvironment env)
          Convert this atom into a Box, using properties set by "parent" atoms, like the TeX style, the last used font, color settings, ...
 int getLeftType()
          Get the type of the leftermost child atom.
 int getRightType()
          Get the type of the rightermost child atom.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

public int type
The type of the atom (default value: ordinary atom)


type_limits

public int type_limits

alignment

public int alignment
Constructor Detail

Atom

public Atom()
Method Detail

createBox

public abstract Box createBox(TeXEnvironment env)
Convert this atom into a Box, using properties set by "parent" atoms, like the TeX style, the last used font, color settings, ...

Parameters:
env - the current environment settings
Returns:
the resulting box.

getLeftType

public int getLeftType()
Get the type of the leftermost child atom. Most atoms have no child atoms, so the "left type" and the "right type" are the same: the atom's type. This also is the default implementation. But Some atoms are composed of child atoms put one after another in a horizontal row. These atoms must override this method.

Returns:
the type of the leftermost child atom

getRightType

public int getRightType()
Get the type of the rightermost child atom. Most atoms have no child atoms, so the "left type" and the "right type" are the same: the atom's type. This also is the default implementation. But Some atoms are composed of child atoms put one after another in a horizontal row. These atoms must override this method.

Returns:
the type of the rightermost child atom

clone

public Atom clone()
Overrides:
clone in class java.lang.Object