net.sf.latexdraw.parsers.svg
Class AbstractPointsElement

java.lang.Object
  extended by net.sf.latexdraw.parsers.svg.SVGElement
      extended by net.sf.latexdraw.parsers.svg.AbstractPointsElement
All Implemented Interfaces:
java.lang.Cloneable, org.w3c.dom.Element, org.w3c.dom.Node
Direct Known Subclasses:
SVGPolygonElement, SVGPolyLineElement

public abstract class AbstractPointsElement
extends SVGElement

Defines a model for shapes that have the points SVG attribute.

This file is part of LaTeXDraw.
Copyright (c) 2005-2012 Arnaud BLOUIN

LaTeXDraw is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

LaTeXDraw is distributed without any warranty; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

09/11/07

Since:
0.1
Version:
3.0
Author:
Arnaud BLOUIN

Field Summary
protected  java.util.List<java.awt.geom.Point2D> points
          The points of the element.
 
Fields inherited from class net.sf.latexdraw.parsers.svg.SVGElement
attributes, children, name, ownerDocument, parent, stylesCSS, transform
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Constructor Summary
AbstractPointsElement(org.w3c.dom.Node node, SVGElement parent)
          Creates an SVG element that can contains points.
AbstractPointsElement(SVGDocument doc)
          SVGElement.SVGElement(SVGDocument)
 
Method Summary
 boolean checkAttributes()
          Check if the SVG element is valid according to the SVG specification.
 java.lang.String getPoints()
           
 java.util.List<java.awt.geom.Point2D> getPoints2D()
           
 void parsePoints()
          Parses the points of the element.
 void setPoints(java.lang.String points)
          Parses and sets the points to the element.
 
Methods inherited from class net.sf.latexdraw.parsers.svg.SVGElement
appendChild, cloneNode, compareDocumentPosition, enableRendering, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getBaseURI, getChildNodes, getChildren, getDef, getElementsByTagName, getElementsByTagNameNS, getFeature, getFill, getFirstChild, getFontFamily, getFontSize, getFontStyle, getFontWeight, getId, getLastChild, getLocalName, getNamespaceURI, getNbChildren, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParent, getParentNode, getPrefix, getPreviousSibling, getRootElement, getSchemaTypeInfo, getStroke, getStrokeDasharray, getStrokeLinecap, getStrokeLinejoin, getStrokeMiterlimit, getStrokeWidth, getStylesCSS, getSVGAttribute, getSVGRoot, getTagName, getTextContent, getTransform, getUsablePrefix, getUsablePrefix, getUserData, getWholeTransform, hasAttribute, hasAttributeNS, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, lookupPrefixUsable, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, replaceChild, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setAttributes, setFill, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setNodeName, setNodeValue, setOwnerDocument, setParent, setPrefix, setStroke, setStrokeDashArray, setStrokeDashOffset, setStrokeLineCap, setStrokeLineJoin, setStrokeMiterLevel, setStrokeWidth, setTextContent, setUserData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

points

protected java.util.List<java.awt.geom.Point2D> points
The points of the element. @since 2.0.3

Constructor Detail

AbstractPointsElement

public AbstractPointsElement(org.w3c.dom.Node node,
                             SVGElement parent)
                      throws MalformedSVGDocument,
                             java.text.ParseException
Creates an SVG element that can contains points.

Parameters:
node - The node used to create the SVG element.
parent - The parent SVG element.
Throws:
MalformedSVGDocument - If the element is not well formed.
java.text.ParseException - If the points string is not well formed.
Since:
2.0.3

AbstractPointsElement

public AbstractPointsElement(SVGDocument doc)
SVGElement.SVGElement(SVGDocument)

Method Detail

parsePoints

public void parsePoints()
                 throws java.text.ParseException
Parses the points of the element.

Throws:
java.text.ParseException - If the format of the points is not valid.
Since:
2.0.3

checkAttributes

public boolean checkAttributes()
Description copied from class: SVGElement
Check if the SVG element is valid according to the SVG specification.

Specified by:
checkAttributes in class SVGElement
Returns:
True if valid.

setPoints

public void setPoints(java.lang.String points)
               throws java.text.ParseException
Parses and sets the points to the element.

Parameters:
points - The string corresponding to the SVG points of this element.
Throws:
java.text.ParseException - If the format of the points is not valid.
Since:
2.0.3

getPoints

public java.lang.String getPoints()
Returns:
The points that make up the shape.
Since:
0.1

getPoints2D

public java.util.List<java.awt.geom.Point2D> getPoints2D()
Returns:
The set of points in the Point2D format or null if the format of points is not valid.
Since:
0.1