net.sf.latexdraw.generators.svg
Class LGridSVGGenerator

java.lang.Object
  extended by net.sf.latexdraw.generators.svg.LShapeSVGGenerator<IGrid>
      extended by net.sf.latexdraw.generators.svg.LGridSVGGenerator

 class LGridSVGGenerator
extends LShapeSVGGenerator<IGrid>

Defines a SVG generator for a grid.

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
 
Fields inherited from class net.sf.latexdraw.generators.svg.LShapeSVGGenerator
shape, SVG_URL_TOKEN_BEGIN
 
Constructor Summary
protected LGridSVGGenerator(IGrid grid)
          Creates a generator of SVG grids.
protected LGridSVGGenerator(SVGGElement elt)
          Creates a grid from a G SVG element.
protected LGridSVGGenerator(SVGGElement elt, boolean withTransformation)
          Creates a grid from a latexdraw-SVG element.
 
Method Summary
protected  void createSVGGrid(SVGElement elt, SVGDocument document)
          Creates the SVG element corresponding to the grid.
private  void createSVGGridDiv(SVGDocument document, SVGElement elt, java.lang.String prefix, double minX, double maxX, double minY, double maxY, double tlx, double tly, double brx, double bry, double posX, double posY, double xStep, double yStep, double gridWidth, java.awt.Color linesColour)
          Creates the SVG element corresponding to the main not-dotted part of the grid.
private  void createSVGGridDots(SVGDocument document, SVGElement elt, java.lang.String prefix, double absStep, double minX, double maxX, double minY, double maxY, double tlx, double tly, double brx, double bry, double unit, double posX, double posY, double xStep, double yStep, double gridWidth, java.awt.Color linesColour)
          Creates the SVG element corresponding to the main dotted part of the grid.
private  void createSVGGridLabels(SVGDocument document, SVGElement elt, java.lang.String prefix, double minX, double maxX, double minY, double maxY, double tlx, double tly, double xStep, double yStep, double gridWidth, double absStep)
          Creates the SVG element corresponding to the labels of the grid.
private  void createSVGSubGridDiv(SVGDocument document, SVGElement elt, java.lang.String prefix, double subGridDiv, double xSubStep, double ySubStep, double minX, double maxX, double minY, double maxY, int subGridDots, double subGridWidth, double tlx, double tly, double brx, double bry, java.awt.Color subGridColour, double posX, double posY, double xStep, double yStep)
          Creates the SVG element corresponding to the sub not-dotted part of the grid.
private  void createSVGSubGridDots(SVGDocument document, SVGElement elt, java.lang.String prefix, double subGridDiv, double unit, double xSubStep, double ySubStep, double minX, double maxX, double minY, double maxY, int subGridDots, double subGridWidth, double tlx, double tly, double brx, double bry, java.awt.Color subGridColour)
          Creates the SVG element corresponding to the sub dotted part of the grid.
private  void setDimensionGridElement(SVGGElement elt, java.lang.String prefix)
          Sets the dimensions of a grid from an SVGGElement.
private  void setLabelGridElement(SVGElement labelElt)
          Sets the label properties of a grid from an SVGElement.
private  void setMainGridElement(SVGElement mainGridElt, java.lang.String prefix)
          Sets the main grid properties of a grid from an SVGElement.
private  void setSubGridElement(SVGElement subGridElt, java.lang.String prefix)
          Sets the sub-grid properties of a grid from an SVGElement.
 SVGElement toSVG(SVGDocument doc)
          Creates an SVG element from the current latexdraw shape.
 
Methods inherited from class net.sf.latexdraw.generators.svg.LShapeSVGGenerator
applyTransformation, applyTransformations, getGradientPoints, getLaTeXDrawElement, getPositionGap, getShape, getShowPointsDot, getShowPointsLine, getSVGHatchingsPath, getSVGID, homogeniseArrowFrom, homogeniseArrows, setDashedDotted, setDashedDotted, setFill, setLineColour, setNumber, setSVGArrow, setSVGArrow, setSVGAttributes, setSVGBorderBackground, setSVGDbleBordersParameters, setSVGDoubleBordersAttributes, setSVGLatexdrawParameters, setSVGParameters, setSVGRotationAttribute, setSVGShadowAttributes, setSVGShadowParameters, setThickness, setThickness
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LGridSVGGenerator

protected LGridSVGGenerator(IGrid grid)
Creates a generator of SVG grids.

Parameters:
grid - The grid used for the generation.
Throws:
java.lang.IllegalArgumentException - If grid is null.

LGridSVGGenerator

protected LGridSVGGenerator(SVGGElement elt)
Creates a grid from a G SVG element.

Parameters:
elt - The G SVG element used for the creation of a grid.
Throws:
java.lang.IllegalArgumentException - If the given element is null.

LGridSVGGenerator

protected LGridSVGGenerator(SVGGElement elt,
                            boolean withTransformation)
Creates a grid from a latexdraw-SVG element.

Parameters:
elt - The source element.
Since:
2.0.0
Method Detail

setDimensionGridElement

private void setDimensionGridElement(SVGGElement elt,
                                     java.lang.String prefix)
Sets the dimensions of a grid from an SVGGElement.


setLabelGridElement

private void setLabelGridElement(SVGElement labelElt)
Sets the label properties of a grid from an SVGElement.


setMainGridElement

private void setMainGridElement(SVGElement mainGridElt,
                                java.lang.String prefix)
Sets the main grid properties of a grid from an SVGElement.


setSubGridElement

private void setSubGridElement(SVGElement subGridElt,
                               java.lang.String prefix)
Sets the sub-grid properties of a grid from an SVGElement.


createSVGSubGridDots

private void createSVGSubGridDots(SVGDocument document,
                                  SVGElement elt,
                                  java.lang.String prefix,
                                  double subGridDiv,
                                  double unit,
                                  double xSubStep,
                                  double ySubStep,
                                  double minX,
                                  double maxX,
                                  double minY,
                                  double maxY,
                                  int subGridDots,
                                  double subGridWidth,
                                  double tlx,
                                  double tly,
                                  double brx,
                                  double bry,
                                  java.awt.Color subGridColour)
Creates the SVG element corresponding to the sub dotted part of the grid.


createSVGSubGridDiv

private void createSVGSubGridDiv(SVGDocument document,
                                 SVGElement elt,
                                 java.lang.String prefix,
                                 double subGridDiv,
                                 double xSubStep,
                                 double ySubStep,
                                 double minX,
                                 double maxX,
                                 double minY,
                                 double maxY,
                                 int subGridDots,
                                 double subGridWidth,
                                 double tlx,
                                 double tly,
                                 double brx,
                                 double bry,
                                 java.awt.Color subGridColour,
                                 double posX,
                                 double posY,
                                 double xStep,
                                 double yStep)
Creates the SVG element corresponding to the sub not-dotted part of the grid.


createSVGGridDots

private void createSVGGridDots(SVGDocument document,
                               SVGElement elt,
                               java.lang.String prefix,
                               double absStep,
                               double minX,
                               double maxX,
                               double minY,
                               double maxY,
                               double tlx,
                               double tly,
                               double brx,
                               double bry,
                               double unit,
                               double posX,
                               double posY,
                               double xStep,
                               double yStep,
                               double gridWidth,
                               java.awt.Color linesColour)
Creates the SVG element corresponding to the main dotted part of the grid.


createSVGGridDiv

private void createSVGGridDiv(SVGDocument document,
                              SVGElement elt,
                              java.lang.String prefix,
                              double minX,
                              double maxX,
                              double minY,
                              double maxY,
                              double tlx,
                              double tly,
                              double brx,
                              double bry,
                              double posX,
                              double posY,
                              double xStep,
                              double yStep,
                              double gridWidth,
                              java.awt.Color linesColour)
Creates the SVG element corresponding to the main not-dotted part of the grid.


createSVGGridLabels

private void createSVGGridLabels(SVGDocument document,
                                 SVGElement elt,
                                 java.lang.String prefix,
                                 double minX,
                                 double maxX,
                                 double minY,
                                 double maxY,
                                 double tlx,
                                 double tly,
                                 double xStep,
                                 double yStep,
                                 double gridWidth,
                                 double absStep)
Creates the SVG element corresponding to the labels of the grid.


createSVGGrid

protected void createSVGGrid(SVGElement elt,
                             SVGDocument document)
Creates the SVG element corresponding to the grid.


toSVG

public SVGElement toSVG(SVGDocument doc)
Description copied from class: LShapeSVGGenerator
Creates an SVG element from the current latexdraw shape.

Specified by:
toSVG in class LShapeSVGGenerator<IGrid>
Parameters:
doc - The SVG document.
Returns:
The created SVGElement or null.