|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--AbstractGRWrappedTextVisitor
Abstract class implementing common functionality between visitors
creating a wrapped text representation of a GenRecoupCoeff
in some format. This class implements some basic wrapping functionality
based on the length in characters if no font is specified, or in pixels
if a font is specified. The generated text is held internally as a
StringBuffer.
GRVisitor
,
GenRecoupCoeff
Field Summary | |
protected java.lang.StringBuffer |
wrappedstring
Stores the wrapped String representation under construction. |
Constructor Summary | |
AbstractGRWrappedTextVisitor()
Constructs a new AbstractGRWrappedTextVisitor. |
|
AbstractGRWrappedTextVisitor(int wrapsize)
Constructs a new AbstractGRWrappedTextVisitor which wraps at wrapsize characters. |
|
AbstractGRWrappedTextVisitor(int wrapsize,
java.awt.FontMetrics fm)
Constructs a new AbstarctGRWrappedTextVisitor, with given wrapsize in pixels and the FontMetrics class for the used font. |
Method Summary | |
protected void |
append(java.lang.String s)
Appends the given String to the generated String as one entity on a line, wrapping on demand. |
protected int |
size(java.lang.String s)
Returns the size of the given string in pixels when a font is specified, otherwise the length is returned. |
protected void |
wrap()
Puts a newline in the generated String. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface GRVisitor |
result, visitGenRecoupCoeff, visitGR6jSymbol, visitGRCompoundFactor, visitGRKrDelta, visitGRPreFactor, visitGRSummation |
Field Detail |
protected java.lang.StringBuffer wrappedstring
Constructor Detail |
public AbstractGRWrappedTextVisitor()
public AbstractGRWrappedTextVisitor(int wrapsize)
wrapsize
characters.
wrapsize
- number of allowed chars on one linepublic AbstractGRWrappedTextVisitor(int wrapsize, java.awt.FontMetrics fm)
wrapsize
- number of allowed pixels on a lineMethod Detail |
protected void wrap()
protected void append(java.lang.String s)
s
- the String to be appended as one entityprotected int size(java.lang.String s)
s
- string of which the size needs to be calculated
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |