1 18 package org.apache.batik.dom.svg; 19 20 import org.w3c.dom.DOMException ; 21 import org.w3c.dom.svg.SVGMatrix; 22 import org.w3c.dom.svg.SVGPoint; 23 24 31 public class SVGOMPoint implements SVGPoint { 32 float x, y; 33 public SVGOMPoint() { x=0; y=0; } 34 public SVGOMPoint(float x, float y) { 35 this.x = x; 36 this.y = y; 37 } 38 39 public float getX( ) { return x; } 40 public void setX( float x ) throws DOMException { this.x = x; } 41 public float getY( ) { return y; } 42 public void setY( float y ) throws DOMException { this.y = y; } 43 44 public SVGPoint matrixTransform ( SVGMatrix matrix ) { 45 float newX = matrix.getA()*getX() + matrix.getC()*getY() + matrix.getE(); 46 float newY = matrix.getB()*getX() + matrix.getD()*getY() + matrix.getF(); 47 return new SVGOMPoint(newX, newY); 48 } 49 } 50 | Popular Tags |