net.sf.latexdraw.generators.svg
Class SVGShapesFactory.CreateViewSVGCmd

java.lang.Object
  extended by net.sf.latexdraw.glib.views.CreateViewCmd<IShape,SVGElement,SVGShapesFactory.CreateViewSVGCmd>
      extended by net.sf.latexdraw.generators.svg.SVGShapesFactory.CreateViewSVGCmd
Enclosing class:
SVGShapesFactory

private abstract class SVGShapesFactory.CreateViewSVGCmd
extends CreateViewCmd<IShape,SVGElement,SVGShapesFactory.CreateViewSVGCmd>

This class is a mix of the design patterns Command and Chain of responsibility. The goal is to find the command which can create the view of the given shape.


Field Summary
 
Fields inherited from class net.sf.latexdraw.glib.views.CreateViewCmd
clazz, next
 
Constructor Summary
SVGShapesFactory.CreateViewSVGCmd(SVGShapesFactory.CreateViewSVGCmd next, java.lang.Class<? extends IShape> classShape)
          Creates the command.
 
Method Summary
 SVGElement create(IShape shape)
          Creates an instance of the view corresponding to the given shape.
abstract  SVGElement create(IShape shape, SVGDocument doc)
          Creates an instance of the view corresponding to the given shape.
 SVGElement execute(IShape model, SVGDocument doc)
          Launches the creation process.
 
Methods inherited from class net.sf.latexdraw.glib.views.CreateViewCmd
execute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SVGShapesFactory.CreateViewSVGCmd

public SVGShapesFactory.CreateViewSVGCmd(SVGShapesFactory.CreateViewSVGCmd next,
                                         java.lang.Class<? extends IShape> classShape)
Creates the command.

Parameters:
next - The next command in the chain of responsibility. Can be null.
classShape - The type of the shape supported by the command.
Since:
3.0
Method Detail

create

public SVGElement create(IShape shape)
Description copied from class: CreateViewCmd
Creates an instance of the view corresponding to the given shape.

Specified by:
create in class CreateViewCmd<IShape,SVGElement,SVGShapesFactory.CreateViewSVGCmd>
Parameters:
shape - The model used to create the view.
Returns:
The created view.

create

public abstract SVGElement create(IShape shape,
                                  SVGDocument doc)
Creates an instance of the view corresponding to the given shape.

Parameters:
shape - The model used to create the view.
doc - The SVG document used to create elements.
Returns:
The created view.
Since:
3.0

execute

public SVGElement execute(IShape model,
                          SVGDocument doc)
Launches the creation process.

Parameters:
model - The model used to create the view.
doc - The SVG document used to create elements.
Returns:
The created view or null.
Since:
3.0