cox.jmatt.java.MathTools.markup.svg
Class PolygonTag

java.lang.Object
  extended by cox.jmatt.java.MathTools.markup.Tag
      extended by cox.jmatt.java.MathTools.markup.svg.StyleTag
          extended by cox.jmatt.java.MathTools.markup.svg.PolygonTag

public class PolygonTag
extends StyleTag

This class provides both the <polygon> and <polyline>: tags. The difference is in closure: the polygon automatically connects the last point added to the first; the polyline does not. Apart from that there is no difference between the two tags.


Nested Class Summary
 
Nested classes/interfaces inherited from class cox.jmatt.java.MathTools.markup.svg.StyleTag
StyleTag.TagKeys
 
Field Summary
 
Fields inherited from class cox.jmatt.java.MathTools.markup.Tag
myTagName
 
Constructor Summary
PolygonTag()
          Only one constructor.
 
Method Summary
 PolygonTag addPoints(java.lang.String pPoints)
          Add a String of space-separated points directly.
 PolygonTag addVertex(double vX, double vY)
          Add a vertex (point) to the current polything.
 PolygonTag copyOf()
          Copy this class.
 void reset()
          Overridden to clear the internal point data also.
 PolygonTag setPolygon(boolean isClosed)
          Determine whether this tag is a polygon or polyline.
 java.lang.String toString()
          Overridden to add the points at the last possible instant.
 
Methods inherited from class cox.jmatt.java.MathTools.markup.svg.StyleTag
_configureTag, _enableCopy, canHaveDefs, isInDefs, setDefaultPen, setDefaultStyle, setDefaultTransform, setPen, setStyle, setTransform
 
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, setID, validString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PolygonTag

public PolygonTag()
Only one constructor. No more are needed.

Method Detail

setPolygon

public PolygonTag setPolygon(boolean isClosed)
Determine whether this tag is a polygon or polyline. The reset() method does not affect this! Returns a self-reference to allow new PolygonTag().setPolygon(false) to generate a polyline in one statement.

Parameters:
isClosed - true for a polygon, false for a polyline.

addVertex

public PolygonTag addVertex(double vX,
                            double vY)
Add a vertex (point) to the current polything.


addPoints

public PolygonTag addPoints(java.lang.String pPoints)
Add a String of space-separated points directly. Returns a self-reference for method chaining.


reset

public void reset()
Overridden to clear the internal point data also.

Overrides:
reset in class Tag

copyOf

public PolygonTag copyOf()
Copy this class.


toString

public java.lang.String toString()
Overridden to add the points at the last possible instant.

Overrides:
toString in class Tag