Class GRWrappedLaTeXVisitor

java.lang.Object
  |
  +--AbstractGRWrappedTextVisitor
        |
        +--GRWrappedLaTeXVisitor
All Implemented Interfaces:
GRVisitor

public class GRWrappedLaTeXVisitor
extends AbstractGRWrappedTextVisitor

A GRVisitor which constructs a wrapped String representation of an object from the GR-family in LaTeX format, including GenRecoupCoeff. When a FontMetrics Class is specified in the constructor, the wrapsize is in pixels and takes in account the used font.

Author:
Dries.VanDyck@rug.ac.be
See Also:
AbstractGRWrappedTextVisitor, GRVisitor, GenRecoupCoeff, GRCompoundFactor, GRSummation, GRFactor, GRPreFactor, GRKrDelta, GR6jSymbol

Field Summary
static java.lang.String SIXJ_MACRO
          The LaTeX macro for a Wigner 6-j symbol.
 
Fields inherited from class AbstractGRWrappedTextVisitor
wrappedstring
 
Constructor Summary
GRWrappedLaTeXVisitor()
          Constructs a new GRWrappedLaTeXVisitor.
GRWrappedLaTeXVisitor(int wrapsize)
          Constructs a new GRWrappedLaTeXVisitor which wraps at wrapsize characters.
GRWrappedLaTeXVisitor(int wrapsize, java.awt.FontMetrics fm)
          Constructs a new GRWrappedLaTeXVisitor, with given wrapsize in pixels and the FontMetrics class for the used font.
 
Method Summary
static java.lang.String macros()
          Returns some LaTeX macros to be used with the generated formula if useMacros(boolean) is set to true.
 java.lang.Object result()
          Returns the wrapped String representing the object visited.
 boolean useMacros()
          Returns true if macros will be used in the generated formula.
 void useMacros(boolean usemacros)
          If set to true LaTeX macros will be used to simplify the generated formula.
 void visitGenRecoupCoeff(GenRecoupCoeff grc)
          Specific method for visiting a GenRecoupCoeff object.
 void visitGR6jSymbol(GR6jSymbol gr6j)
          Specific method for visiting a GR6jSymbol object.
 void visitGRCompoundFactor(GRCompoundFactor grcf)
          Specific method for visiting a GRCompoundFactor object.
 void visitGRKrDelta(GRKrDelta grkd)
          Specific method for visiting a GRKrDelta object.
 void visitGRPreFactor(GRPreFactor grpf)
          Specific method for visiting a GRPreFactor object.
 void visitGRSummation(GRSummation grs)
          Specific method for visiting a GRSummation object.
 
Methods inherited from class AbstractGRWrappedTextVisitor
append, size, wrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIXJ_MACRO

public static final java.lang.String SIXJ_MACRO
The LaTeX macro for a Wigner 6-j symbol.

See Also:
Constant Field Values
Constructor Detail

GRWrappedLaTeXVisitor

public GRWrappedLaTeXVisitor()
Constructs a new GRWrappedLaTeXVisitor. Default wrapsize is 80 characters.


GRWrappedLaTeXVisitor

public GRWrappedLaTeXVisitor(int wrapsize)
Constructs a new GRWrappedLaTeXVisitor which wraps at wrapsize characters.

Parameters:
wrapsize - number of allowed chars on one line

GRWrappedLaTeXVisitor

public GRWrappedLaTeXVisitor(int wrapsize,
                             java.awt.FontMetrics fm)
Constructs a new GRWrappedLaTeXVisitor, with given wrapsize in pixels and the FontMetrics class for the used font.

Parameters:
wrapsize - number of allowed pixels on a line
Method Detail

visitGenRecoupCoeff

public void visitGenRecoupCoeff(GenRecoupCoeff grc)
Specific method for visiting a GenRecoupCoeff object.

Parameters:
grc - the GenRecoupCoeff to be visited
See Also:
GenRecoupCoeff

visitGRCompoundFactor

public void visitGRCompoundFactor(GRCompoundFactor grcf)
Specific method for visiting a GRCompoundFactor object.

Parameters:
grcf - the GRCompoundFactor to be visited
See Also:
GRCompoundFactor

visitGRSummation

public void visitGRSummation(GRSummation grs)
Specific method for visiting a GRSummation object.

Parameters:
grs - the GRSummation to be visited
See Also:
GRSummation

visitGRPreFactor

public void visitGRPreFactor(GRPreFactor grpf)
Specific method for visiting a GRPreFactor object.

Parameters:
grpf - the GRPreFactorto be visited
See Also:
GRPreFactor

visitGRKrDelta

public void visitGRKrDelta(GRKrDelta grkd)
Specific method for visiting a GRKrDelta object.

Parameters:
grkd - the GRKrDelta to be visited
See Also:
GRKrDelta

visitGR6jSymbol

public void visitGR6jSymbol(GR6jSymbol gr6j)
Specific method for visiting a GR6jSymbol object.

Parameters:
gr6j - the GR6jSymbol to be visited
See Also:
GR6jSymbol

result

public java.lang.Object result()
Returns the wrapped String representing the object visited.

Returns:
the resulting wrapped String as an Object

useMacros

public boolean useMacros()
Returns true if macros will be used in the generated formula.

Returns:
true if macros will be used in the generated formula, false otherwise.
See Also:
macros()

useMacros

public void useMacros(boolean usemacros)
If set to true LaTeX macros will be used to simplify the generated formula. The default value is false.

Parameters:
usemacros - the value to be set.
See Also:
macros()

macros

public static java.lang.String macros()
Returns some LaTeX macros to be used with the generated formula if useMacros(boolean) is set to true.

Returns:
the needed macros as a String
See Also:
useMacros()