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

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.DrawableContainerTag
              extended by cox.jmatt.java.MathTools.markup.svg.MaskTag

public class MaskTag
extends DrawableContainerTag

This class implements the <mask> tag. It is a <defs> block and is used to describe a mask. As with ClipTag a valid ID is mandatory, so there is no public constructor. The static method will NOT create a tag around a null or blank ID.

To mask a graphic, first define a MaskTag and use it to describe the mask to be applied. Add it to the base document. To apply the mask, set the mask URL on the tag to which it applies, using the ID assigned when creating the mask.


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
 
Method Summary
static MaskTag newInstance(java.lang.String pTagID)
          This is the only way to construct an instance of this class.
 void reset()
          Overridden to preserve the ID.
 void reset(java.lang.String newID)
          Call this method to clear data and re-set the ID in one fell swoop.
 void setID(java.lang.String pID)
          Overridden to ensure the ID set is valid.
 MaskTag setMaskContentUnits(boolean pUserSpace)
          Set the reference coordinates for elements contained within the <mask> tag.
 MaskTag setMaskUnits(boolean pUserSpace)
          Set the 'maskUnits=' attribute for this tag.
 MaskTag setSize(java.lang.Double pX, java.lang.Double pY, java.lang.Double pWidth, java.lang.Double pHeight)
          Set the dimensions of the <mask> relative to the masked object's bounding box.
 
Methods inherited from class cox.jmatt.java.MathTools.markup.svg.DrawableContainerTag
_addContent, _addCSS, _addDef, _content, _setContent, _setDesc, _setOBUS, _setPAR, _setTitle, _setViewBox, add, addRaw, drawCircle, drawEllipse, drawLine, drawPath, drawPoint, drawPolygon, drawPolyline, drawRectangle, drawRectangle, drawText
 
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, _fixKey, _setEnableXMLTag, badPizza, closeTag, configureTag, configureTagFromGlobalPizza, makeTag, openTag, toString, validString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

newInstance

public static MaskTag newInstance(java.lang.String pTagID)
This is the only way to construct an instance of this class. If the ID argument is null or blank the return value is null!


setID

public void setID(java.lang.String pID)
Overridden to ensure the ID set is valid.

Overrides:
setID in class Tag

reset

public void reset()
Overridden to preserve the ID. To change it use reset(String) or re-set manually afterward.

Overrides:
reset in class Tag

reset

public void reset(java.lang.String newID)
Call this method to clear data and re-set the ID in one fell swoop.


setSize

public MaskTag setSize(java.lang.Double pX,
                       java.lang.Double pY,
                       java.lang.Double pWidth,
                       java.lang.Double pHeight)
Set the dimensions of the <mask> relative to the masked object's bounding box. For user coordinates, setMaskUnits(true). If any of these numbers is null it is ignored.

Parameters:
pX - The X-coordinate of the clip rectangle's upper left corner.
pY - The Y-coordinate of the clip rectangle's upper left corner.
pWidth - The width of the mask's clipping rectangle.
pHeight - The height of the mask clipping rectangle.

setMaskUnits

public MaskTag setMaskUnits(boolean pUserSpace)
Set the 'maskUnits=' attribute for this tag. This is 'objectBoundingBox' or 'userSpaceOnUse'.

See Also:
DrawableContainerTag._setOBUS(java.lang.String, boolean)

setMaskContentUnits

public MaskTag setMaskContentUnits(boolean pUserSpace)
Set the reference coordinates for elements contained within the <mask> tag.

See Also:
DrawableContainerTag._setOBUS(java.lang.String, boolean)