|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.latexdraw.parsers.svg.SVGTransform
public class SVGTransform
Defines an SVG transformation.
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
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.
10/16/07
Field Summary | |
---|---|
protected double |
angle
The angle of a possible rotation or skew. |
protected double |
cx
The possible rotation X-position. |
protected double |
cy
The possible rotation Y-position. |
protected SVGMatrix |
matrix
The matrix of the transformation. |
static int |
SVG_TRANSFORM_MATRIX
|
static int |
SVG_TRANSFORM_ROTATE
|
static int |
SVG_TRANSFORM_SCALE
|
static int |
SVG_TRANSFORM_SKEWX
|
static int |
SVG_TRANSFORM_SKEWY
|
static int |
SVG_TRANSFORM_TRANSLATE
|
static int |
SVG_TRANSFORM_UNKNOWN
|
protected int |
type
The type of the transformation. |
Constructor Summary | |
---|---|
SVGTransform()
Creates a transformation with no type. |
|
SVGTransform(java.lang.String transformation)
The constructor using a string containing the transformation. |
Method Summary | |
---|---|
boolean |
cancels(SVGTransform transform)
Tests if the given transformation cancels the calling one. |
private boolean |
cancelsRotation(SVGTransform transform)
|
private boolean |
cancelsScale(SVGTransform transform)
|
private boolean |
cancelsTranslation(SVGTransform transform)
|
private boolean |
cancelsXSkew(SVGTransform transform)
|
private boolean |
cancelsYSkew(SVGTransform transform)
|
static SVGTransform |
createRotation(double angle,
double cx,
double cy)
Creates a rotation. |
static SVGTransform |
createTranslation(double x,
double y)
Creates a translation. |
double |
getCx()
|
double |
getCy()
|
SVGMatrix |
getMatrix()
|
double |
getRotationAngle()
|
double |
getTX()
|
double |
getTY()
|
int |
getType()
|
double |
getXScaleFactor()
|
double |
getXSkewAngle()
|
double |
getYScaleFactor()
|
double |
getYSkewAngle()
|
boolean |
isRotation()
|
boolean |
isScale()
|
boolean |
isTranslation()
|
boolean |
isXSkew()
|
boolean |
isYSkew()
|
void |
setMatrix(double a,
double b,
double c,
double d,
double e,
double f)
The transformation will be set by the given values. |
void |
setRotate(double angle,
double cx,
double cy)
The transformation will be a rotation form the origin. |
void |
setScale(double sx,
double sy)
The transformation will be a scaling. |
void |
setSkewX(double angle)
The transformation will be a X skew. |
void |
setSkewY(double angle)
The transformation will be a Y skew. |
void |
setTransformation(java.lang.String transformation)
Parses a string containing the SVG transformation in order to set the transformation. |
void |
setTranslate(double tx,
double ty)
The transformation will be a translation. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int SVG_TRANSFORM_UNKNOWN
public static final int SVG_TRANSFORM_MATRIX
public static final int SVG_TRANSFORM_TRANSLATE
public static final int SVG_TRANSFORM_SCALE
public static final int SVG_TRANSFORM_ROTATE
public static final int SVG_TRANSFORM_SKEWX
public static final int SVG_TRANSFORM_SKEWY
protected int type
protected SVGMatrix matrix
protected double angle
protected double cx
protected double cy
Constructor Detail |
---|
public SVGTransform()
public SVGTransform(java.lang.String transformation)
transformation
- The SVG transformation.
java.lang.IllegalArgumentException
- If the transformation is no valid.Method Detail |
---|
public void setTransformation(java.lang.String transformation)
transformation
- The string to parse.
java.lang.IllegalArgumentException
- If the transformation is no valid.public void setTranslate(double tx, double ty)
tx
- The X translation.ty
- The Y translation.public void setMatrix(double a, double b, double c, double d, double e, double f)
a
- The values of the matrix: [a, c, e, b, d, f, 0, 0, 1].b
- The values of the matrix: [a, c, e, b, d, f, 0, 0, 1].c
- The values of the matrix: [a, c, e, b, d, f, 0, 0, 1].d
- The values of the matrix: [a, c, e, b, d, f, 0, 0, 1].e
- The values of the matrix: [a, c, e, b, d, f, 0, 0, 1].f
- The values of the matrix: [a, c, e, b, d, f, 0, 0, 1].public void setScale(double sx, double sy)
sx
- The X scaling.sy
- The Y scaling.public void setRotate(double angle, double cx, double cy)
angle
- The rotation angle in degree.cx
- The X centre of the rotation.cy
- The Y centre of the rotation.public void setSkewX(double angle)
angle
- The angle of the skew in degree.public void setSkewY(double angle)
angle
- The angle of the skew in degree.public int getType()
public boolean isRotation()
public boolean isTranslation()
public boolean isScale()
public boolean isXSkew()
public boolean isYSkew()
public double getRotationAngle()
public double getXSkewAngle()
public double getYSkewAngle()
public double getXScaleFactor()
public double getYScaleFactor()
public double getTX()
public double getTY()
public SVGMatrix getMatrix()
public double getCx()
public double getCy()
public static SVGTransform createTranslation(double x, double y)
x
- The tx.y
- The ty.
public static SVGTransform createRotation(double angle, double cx, double cy)
cx
- The X centre of the rotation.cy
- The Y centre of the rotation.angle
- The angle of rotation in radian.
public boolean cancels(SVGTransform transform)
transform
- The transformation to test.
private boolean cancelsRotation(SVGTransform transform)
transform
- The transformation to test.
private boolean cancelsTranslation(SVGTransform transform)
transform
- The transformation to test.
private boolean cancelsScale(SVGTransform transform)
transform
- The transformation to test.
private boolean cancelsXSkew(SVGTransform transform)
transform
- The transformation to test.
private boolean cancelsYSkew(SVGTransform transform)
transform
- The transformation to test.
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |