net.sf.latexdraw.generators.svg
Class LArrowSVGGenerator

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

 class LArrowSVGGenerator
extends java.lang.Object

Defines an SVG generator for arrows.

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.

11/11/07

Version:
3.0
Author:
Arnaud BLOUIN

Field Summary
protected  IArrow arrow
          The arrowhead generated or used to generate the SVG-arrow.
 
Constructor Summary
protected LArrowSVGGenerator(IArrow arr)
          Creates an SVG arrow generator.
  LArrowSVGGenerator(SVGMarkerElement elt, IShape owner)
          Creates an SVG-arrowhead generator using an SVGMarkerElement.
 
Method Summary
protected  void setArrow(SVGCircleElement circle, SVGMarkerElement elt, IShape owner)
          Initialises the arrowhead using a circle arrow.
protected  void setArrow(SVGMarkerElement elt, IShape owner)
          Initialises the arrow using an SVGMarkerElement.
protected  void setArrow(SVGPathElement path, SVGMarkerElement elt, IShape owner)
          Initialises the arrowhead using a path arrow.
private  void setArrowArrow(SVGPathElement path, SVGPathSegMoveto m, double lineWidth, SVGPathSeg seg, SVGPathSegList list, boolean isInverted)
           
private  void setArrowBarBracket(SVGPathElement path, SVGPathSegMoveto m, double lineWidth, SVGPathSeg seg, SVGMarkerElement elt, SVGPathSegList list, boolean isInverted)
           
 SVGElement toSVG(SVGDocument doc, boolean isShadow)
          Return the SVG tree of the arrowhead or null if this arrowhead has no style.
private  void toSVGArrow(SVGDocument doc, double lineWidth, boolean isShadow, SVGElement marker)
           
private  void toSVGBar(SVGDocument doc, double lineWidth, boolean isShadow, SVGElement marker)
           
private  double toSVGCircle(SVGDocument doc, double lineWidth, boolean isShadow, SVGElement marker)
           
private  double toSVGDisk(SVGDocument doc, double lineWidth, boolean isShadow, SVGElement marker)
           
private  void toSVGDoubleArrow(SVGDocument doc, double lineWidth, boolean isShadow, SVGElement marker)
           
private  void toSVGRoundBracket(SVGDocument doc, double lineWidth, boolean isShadow, SVGElement marker)
           
private  void toSVGRoundIn(SVGDocument doc, boolean isShadow, SVGElement marker)
           
private  double toSVGSquareBracket(SVGDocument doc, double lineWidth, boolean isShadow, SVGElement marker)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

arrow

protected IArrow arrow
The arrowhead generated or used to generate the SVG-arrow.

Constructor Detail

LArrowSVGGenerator

protected LArrowSVGGenerator(IArrow arr)
Creates an SVG arrow generator.

Parameters:
arr - The arrow. Must not be null.

LArrowSVGGenerator

public LArrowSVGGenerator(SVGMarkerElement elt,
                          IShape owner)
Creates an SVG-arrowhead generator using an SVGMarkerElement.

Parameters:
elt - The SVGMarkerElement uses to creates the arrow.
owner - The shape that has the arrow.
Method Detail

setArrow

protected void setArrow(SVGMarkerElement elt,
                        IShape owner)
Initialises the arrow using an SVGMarkerElement.

Parameters:
elt - The SVGMarkerElement uses to initialise the arrow.
owner - The figure the has the arrow.
Since:
2.0.0

setArrow

protected void setArrow(SVGCircleElement circle,
                        SVGMarkerElement elt,
                        IShape owner)
Initialises the arrowhead using a circle arrow.

Parameters:
circle - The circle element.
elt - The arrowhead element.
owner - The shape that has the arrow.
Since:
2.0.0

setArrowBarBracket

private void setArrowBarBracket(SVGPathElement path,
                                SVGPathSegMoveto m,
                                double lineWidth,
                                SVGPathSeg seg,
                                SVGMarkerElement elt,
                                SVGPathSegList list,
                                boolean isInverted)

setArrowArrow

private void setArrowArrow(SVGPathElement path,
                           SVGPathSegMoveto m,
                           double lineWidth,
                           SVGPathSeg seg,
                           SVGPathSegList list,
                           boolean isInverted)

setArrow

protected void setArrow(SVGPathElement path,
                        SVGMarkerElement elt,
                        IShape owner)
Initialises the arrowhead using a path arrow.

Parameters:
path - The path element.
elt - The arrowhead element.
owner - The shape that has the arrow.
Since:
2.0.0

toSVGCircle

private double toSVGCircle(SVGDocument doc,
                           double lineWidth,
                           boolean isShadow,
                           SVGElement marker)

toSVGDisk

private double toSVGDisk(SVGDocument doc,
                         double lineWidth,
                         boolean isShadow,
                         SVGElement marker)

toSVGBar

private void toSVGBar(SVGDocument doc,
                      double lineWidth,
                      boolean isShadow,
                      SVGElement marker)

toSVGSquareBracket

private double toSVGSquareBracket(SVGDocument doc,
                                  double lineWidth,
                                  boolean isShadow,
                                  SVGElement marker)

toSVGArrow

private void toSVGArrow(SVGDocument doc,
                        double lineWidth,
                        boolean isShadow,
                        SVGElement marker)

toSVGRoundBracket

private void toSVGRoundBracket(SVGDocument doc,
                               double lineWidth,
                               boolean isShadow,
                               SVGElement marker)

toSVGDoubleArrow

private void toSVGDoubleArrow(SVGDocument doc,
                              double lineWidth,
                              boolean isShadow,
                              SVGElement marker)

toSVGRoundIn

private void toSVGRoundIn(SVGDocument doc,
                          boolean isShadow,
                          SVGElement marker)

toSVG

public SVGElement toSVG(SVGDocument doc,
                        boolean isShadow)
Return the SVG tree of the arrowhead or null if this arrowhead has no style.

Parameters:
doc - The document used to create elements.
isShadow - True: this operation is call to create the SVG shadow of the shape.
Returns:
The SVG tree of the arrowhead or null if doc is null.
Since:
2.0.0