net.sf.latexdraw.generators.svg
Class SVGShapesFactory

java.lang.Object
  extended by net.sf.latexdraw.generators.svg.SVGShapesFactory

public final class SVGShapesFactory
extends java.lang.Object

Creates SVG elements based on latexdraw.

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/21/07

Version:
3.0
Author:
Arnaud BLOUIN

Nested Class Summary
private  class SVGShapesFactory.CreateViewSVGCmd
          This class is a mix of the design patterns Command and Chain of responsibility.
 
Field Summary
private  SVGShapesFactory.CreateViewSVGCmd createCmd
          The chain of responsibility used to reduce the complexity of the factory.
static SVGShapesFactory INSTANCE
          The singleton.
 
Constructor Summary
private SVGShapesFactory()
          Creates the factory.
 
Method Summary
 SVGElement createSVGElement(IShape shape, SVGDocument doc)
          Creates an SVG Element corresponding to the given shape.
private  void initCommands()
          Initialises the chain of responsibility.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final SVGShapesFactory INSTANCE
The singleton.


createCmd

private SVGShapesFactory.CreateViewSVGCmd createCmd
The chain of responsibility used to reduce the complexity of the factory.

Constructor Detail

SVGShapesFactory

private SVGShapesFactory()
Creates the factory.

Method Detail

createSVGElement

public SVGElement createSVGElement(IShape shape,
                                   SVGDocument doc)
Creates an SVG Element corresponding to the given shape.

Parameters:
shape - The shape used to determine which SVG element to create.
doc - The SVG document used to instantiate to SVG element.
Returns:
The created SVG element.

initCommands

private void initCommands()
Initialises the chain of responsibility.