|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcox.jmatt.java.MathTools.markup.latex.LaBaseTag
public abstract class LaBaseTag
This is the abstract superclass of all other LaTeX markup-generating classes. It is primarily geared for block-style tags therefore it contains the necessary equipment to generate both the initial tag and the end tag.
A quick perusal of the methods here shows more than a few concerning whether or not an '/end...' tag exists, is created or is printed. This was done to
allow subclasses fine-grained control over the nesting of blocks. As a general rule the toString()
method returns a block of LaTeX ready to be
pasted into a document. This means the classes MUST be able to handle nested blocks automatically, consistently and correctly. Of course this also allows
users that same fine-grained control while maintaining the integrity of the individual constructs. Use with care!
Two methods give full information on end tags. hasEndTag()
returns true only if a non-null, non-blank end tag is defined. If it returns false
then no end tag is possible because there isn't one defined. isEndTagEnabled()
reports whether or not end-tag printing is enabled. If not then
toString()
won't include an end tag, even if one exists.getEndTag()
always creates an end tag if possible, even if end tags are
disabled. This plus the two copy methods allow a tag to be fully printed WITH or WITHOUT an end tag; those can be collected and stored for later use and
nesting.
Field Summary | |
---|---|
static java.lang.String |
BS
This is a Java-escaped backslash, defined here for convenience. |
static java.lang.String |
DBS
Double-backslash, to prevent frustration. |
static java.lang.String |
DBSN
Double-backslash plus a newline. |
protected java.lang.String |
myAuthor
This is the title information used in LaDocument . |
protected java.lang.String |
myDate
This is the title information used in LaDocument . |
protected java.lang.String |
myEndTag
This is the end tag. |
protected java.lang.String |
myEnvironment
This is the content of the first set of curly braces after the '/begin' tag and also within the braces with the 'end' tag. |
protected java.lang.String[] |
myEnvParams
These are the extra curly braces that may appear after the initial set. |
protected java.lang.String |
myOptions
Options appear in square brackets between the '/begin' sequence and the first opening curly brace. |
protected boolean |
myPicHasOrigin
Flag to indicate whether or not origin coordinates were given. |
protected int |
myPicX
This is picture size information stored here for proper print placement. |
protected int |
myPicXOrigin
This is picture size information stored here for proper print placement. |
protected int |
myPicY
This is picture size information stored here for proper print placement. |
protected int |
myPicYOrigin
This is picture size information stored here for proper print placement. |
protected java.lang.String |
mySectionLabel
This is the section label. |
protected java.lang.String |
myTagName
All LaTeX tags, statements and commands have a name. |
protected java.lang.String |
myTitle
This is the title information used in LaDocument . |
Constructor Summary | |
---|---|
protected |
LaBaseTag(java.lang.String pTagName,
java.lang.String pEndTag,
java.lang.String pEnvironment,
java.lang.String pOptions,
java.lang.String pContent)
This constructor allows every aspect of a subclass to be set. |
Method Summary | |
---|---|
protected void |
_addContent(java.lang.String pData)
Add content to the internal buffer. |
protected void |
_addRawContent(java.lang.String pData)
This method adds content with NO checking whatsoever. |
protected java.lang.String |
_getContent()
Retrieve the raw content that has been added without any other formatting. |
protected void |
_setEndTagEnabled(boolean pEnable)
Subclasses use this method to enable or disable end tag printing. |
protected static void |
_setETEn(boolean pEnable)
Use this method to allow a tag to be created with its end tag disabled. |
abstract LaBaseTag |
copyOf()
This method provides a copy of a LaBaseTag subclass. |
abstract LaBaseTag |
copyOfSET()
Create and return a copy of this tag with its end tag suppressed. |
java.lang.String |
getEndTag()
This method creates and returns the end tag for this instance. |
boolean |
hasEndTag()
This method determines whether or not this instance has a valid ending tag. |
boolean |
isEndTagEnabled()
This method determines whether or not the end tag is enabled. |
void |
reset()
This method clears all internal content. |
void |
setLabel(java.lang.String pLabel)
This method allows a '/label{}' tag to appear immediately after the opening line of the block. |
java.lang.String |
toString()
Print all the data within this tag as a properly-formatted String. |
java.lang.String |
toStringSET()
This instance method is identical to toString() with the end tag suppressed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String BS
public static final java.lang.String DBS
public static final java.lang.String DBSN
protected java.lang.String myTagName
protected java.lang.String myEndTag
protected java.lang.String myEnvironment
protected java.lang.String myOptions
protected java.lang.String[] myEnvParams
protected java.lang.String mySectionLabel
protected java.lang.String myTitle
LaDocument
. It is stored here to allow proper print placement.
protected java.lang.String myDate
LaDocument
. It is stored here to allow proper print placement.
protected java.lang.String myAuthor
LaDocument
. It is stored here to allow proper print placement.
protected int myPicX
protected int myPicY
protected int myPicXOrigin
protected int myPicYOrigin
protected boolean myPicHasOrigin
Constructor Detail |
---|
protected LaBaseTag(java.lang.String pTagName, java.lang.String pEndTag, java.lang.String pEnvironment, java.lang.String pOptions, java.lang.String pContent)
pTagName
- The tag name OR beginning tag name. Defaults to 'begin'. Null or blank values are silently ignored.pEndTag
- The end tag name. Defaults to 'end'. Null or blank values are ignored.pEnvironment
- The initial environment. Defaults to null.pOptions
- Initial options. Defaults to null.pContent
- The content to be set. Ignored if null.Method Detail |
---|
protected static final void _setETEn(boolean pEnable)
public void reset()
super.reset()
to ensure proper cleaning.
public final boolean hasEndTag()
public boolean isEndTagEnabled()
protected void _setEndTagEnabled(boolean pEnable)
public final java.lang.String getEndTag()
protected final void _addContent(java.lang.String pData)
pData
- The content to be added to the internal buffer.protected final void _addRawContent(java.lang.String pData)
protected final java.lang.String _getContent()
_addContent()
is returned.
public void setLabel(java.lang.String pLabel)
pLabel
- The label to assign or null to disable.public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStringSET()
toString()
with the end tag suppressed. SET means Suppress End Tag and the
end tag is explicitly disabled for the duration of this method only. When it returns the original state of the end tag is restored.
public abstract LaBaseTag copyOf()
LaBaseTag
subclass. Each subclass casts its return value as its own type.
public abstract LaBaseTag copyOfSET()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |