|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcox.jmatt.java.MathTools.markup.Tag
cox.jmatt.java.MathTools.markup.svg.StyleTag
public class StyleTag
This class provides the basic machinery for the other SVG tags. It provides the mechanism for default styles and attributes the SVG implementation needs
beyond what Tag
supplies.
Every SVG tag class has default values for such things as style attributes, StylePen
s, and transformations. The TagKeys enum
keeps
up with this information and supplies it as needed. All the methods to set defaults are here; only the tag-critical methods are in the individual tag classes.
Nested Class Summary | |
---|---|
static class |
StyleTag.TagKeys
This enum is used internally by the SVG classes to store defaults and other such information. |
Field Summary |
---|
Fields inherited from class cox.jmatt.java.MathTools.markup.Tag |
---|
myTagName |
Constructor Summary | |
---|---|
protected |
StyleTag(StyleTag.TagKeys pTagKey)
This is the protected constructor used to build all SVG tags. |
Method Summary | |
---|---|
protected void |
_configureTag(java.lang.String pPrefix,
java.util.Properties pPizza)
This method establishes the pattern for pizza-configuring SVG package classes. |
protected void |
_enableCopy()
After calling this method, the next instantiation of a subclass (only) will instead produce a copy. |
boolean |
canHaveDefs()
Specify whether or not this subclass can have a <defs> block. |
boolean |
isInDefs()
Specify whether or not this subclass should be within a <defs> block. |
void |
setDefaultPen(int pPen)
Set the default pen number for this type of tag. |
void |
setDefaultStyle(StylePen pPen)
Set the default 'style=' attribute for this type of tag. |
void |
setDefaultTransform(TransformPen pPen)
Set the default transformations for this type of tag. |
void |
setPen(int pPen)
Set the StylePen number to be used for the tag. |
void |
setStyle(StylePen pPen)
Set the 'style=' attribute for this tag. |
void |
setTransform(TransformPen pPen)
Set the transform(s) for this tag. |
Methods inherited from class cox.jmatt.java.MathTools.markup.Tag |
---|
_addAttribute, _addAttributes, _addNAttribute, _asBoolean, _asDouble, _asInt, _attributes, _clampNAttribute, _clampNAttribute, _content, _fixKey, _setContent, _setEnableXMLTag, badPizza, closeTag, configureTag, configureTagFromGlobalPizza, makeTag, openTag, reset, setID, toString, validString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected StyleTag(StyleTag.TagKeys pTagKey)
TagKeys
constant, which contains all necessary information
about the tag's name and its current default settings. If subclassing, never, never, NEVER call this constructor with null!
Method Detail |
---|
public void setPen(int pPen)
public void setStyle(StylePen pPen)
StylePen
but it is converted to String as soon as it is set. Changing the
data in the StylePen after calling this method will not affect the data here. If pPen is null the tag's StylePen is set to null and disabled.
pPen
- The StylePen
to apply to this tag.public void setTransform(TransformPen pPen)
toString()
on the supplied TransformPen
so any changes to the pen afterward
will not affect the transforms already set.
pPen
- The TransformPen
containing the desired transforms.protected void _configureTag(java.lang.String pPrefix, java.util.Properties pPizza)
This method establishes the pattern for pizza-configuring SVG package classes. The only configurable attributes are ID and pen number but they can apply to any other tag class that calls this method. The 'pPrefix' String is for anything prepended to the prefixes described below. This allows different tag classes to have different configuration lines in the overall pizza.
The configuration options available from this method are:
StylePen
number. Non-parseable values are silently ignored.This is the pattern that is used for each configurable tag class. It has a tag-specific prefix for each identifier, so when the tag prefix is prepended to 'Style.pen' and this method called, the pen number will be set. This is done to allow maximum flexibility in configuring these classes. If the prefix is null or blank it is ignored but the keys listed above are still checked. If 'pPizza' is null or empty this method returns silently.
pPrefix
- The String prefix to prepend when extracting key values. If it does not end with a dot one will be supplied.pPizza
- The Properties
object used to configure the class.public void setDefaultPen(int pPen)
public void setDefaultStyle(StylePen pPen)
public void setDefaultTransform(TransformPen pPen)
protected final void _enableCopy()
After calling this method, the next instantiation of a subclass (only) will instead produce a copy. This should ONLY be used in a copying method!
public StyleTagSubclass copyOf() { _enableCopy(); return new StyleTagSubclass(); }Only the first instantiation after this method is called creates a copy; the data set is cleared when accessed. This method uses
_getContent()
to set the content of the copied tag and the subsequent constructor calls _setContent()
.
public boolean canHaveDefs()
public boolean isInDefs()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |