net.sf.latexdraw.parsers.svg.parsers
Class Shape2D2SVG<S extends java.awt.Shape,T extends SVGElement>

java.lang.Object
  extended by net.sf.latexdraw.parsers.svg.parsers.Shape2D2SVG<S,T>
Type Parameters:
S - The type of the shape to convert.
T - The type of the SVG element to create.
All Implemented Interfaces:
Parser
Direct Known Subclasses:
Path2D2SVGPath

public abstract class Shape2D2SVG<S extends java.awt.Shape,T extends SVGElement>
extends java.lang.Object
implements Parser

This abstract converter converts a Java Shape into an SVG element.

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.

08/03/11

Version:
3.0
Author:
Arnaud BLOUIN

Field Summary
protected  SVGDocument document
          The SVG document that will be used to create SVG elements.
protected  T element
          The generated SVG element.
protected  S shape
          The Java shape to convert.
 
Constructor Summary
Shape2D2SVG(S shape, SVGDocument document)
          Creates the converter.
 
Method Summary
 T getSVGElement()
           
 void setDocument(SVGDocument document)
          Sets the SVG document that will be used to create SVG elements.
 void setShape(S shape)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.latexdraw.parsers.Parser
parse
 

Field Detail

shape

protected S extends java.awt.Shape shape
The Java shape to convert.


element

protected T extends SVGElement element
The generated SVG element.


document

protected SVGDocument document
The SVG document that will be used to create SVG elements.

Constructor Detail

Shape2D2SVG

public Shape2D2SVG(S shape,
                   SVGDocument document)
Creates the converter.

Parameters:
shape - The shape to convert.
document - The document used to create SVG elements.
Since:
3.0
Method Detail

getSVGElement

public T getSVGElement()
Returns:
The generated SVG element.
Since:
3.0

setDocument

public void setDocument(SVGDocument document)
Sets the SVG document that will be used to create SVG elements.

Parameters:
document - The new SVG document.
Since:
3.0

setShape

public void setShape(S shape)
Parameters:
shape - The shape to convert. Must not be null.
Since:
3.0