0001: /*
0002:
0003: Licensed to the Apache Software Foundation (ASF) under one or more
0004: contributor license agreements. See the NOTICE file distributed with
0005: this work for additional information regarding copyright ownership.
0006: The ASF licenses this file to You under the Apache License, Version 2.0
0007: (the "License"); you may not use this file except in compliance with
0008: the License. You may obtain a copy of the License at
0009:
0010: http://www.apache.org/licenses/LICENSE-2.0
0011:
0012: Unless required by applicable law or agreed to in writing, software
0013: distributed under the License is distributed on an "AS IS" BASIS,
0014: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0015: See the License for the specific language governing permissions and
0016: limitations under the License.
0017:
0018: */
0019: package org.apache.batik.dom.svg;
0020:
0021: import org.apache.batik.dom.AbstractDocument;
0022: import org.apache.batik.dom.util.DoublyIndexedTable;
0023: import org.apache.batik.util.SVGTypes;
0024:
0025: import org.w3c.dom.Node;
0026: import org.w3c.dom.svg.SVGAnimatedNumber;
0027: import org.w3c.dom.svg.SVGPathElement;
0028: import org.w3c.dom.svg.SVGPathSeg;
0029: import org.w3c.dom.svg.SVGPathSegArcAbs;
0030: import org.w3c.dom.svg.SVGPathSegArcRel;
0031: import org.w3c.dom.svg.SVGPathSegClosePath;
0032: import org.w3c.dom.svg.SVGPathSegCurvetoCubicAbs;
0033: import org.w3c.dom.svg.SVGPathSegCurvetoCubicRel;
0034: import org.w3c.dom.svg.SVGPathSegCurvetoCubicSmoothAbs;
0035: import org.w3c.dom.svg.SVGPathSegCurvetoCubicSmoothRel;
0036: import org.w3c.dom.svg.SVGPathSegCurvetoQuadraticAbs;
0037: import org.w3c.dom.svg.SVGPathSegCurvetoQuadraticRel;
0038: import org.w3c.dom.svg.SVGPathSegCurvetoQuadraticSmoothAbs;
0039: import org.w3c.dom.svg.SVGPathSegCurvetoQuadraticSmoothRel;
0040: import org.w3c.dom.svg.SVGPathSegLinetoAbs;
0041: import org.w3c.dom.svg.SVGPathSegLinetoHorizontalAbs;
0042: import org.w3c.dom.svg.SVGPathSegLinetoHorizontalRel;
0043: import org.w3c.dom.svg.SVGPathSegLinetoRel;
0044: import org.w3c.dom.svg.SVGPathSegLinetoVerticalAbs;
0045: import org.w3c.dom.svg.SVGPathSegLinetoVerticalRel;
0046: import org.w3c.dom.svg.SVGPathSegList;
0047: import org.w3c.dom.svg.SVGPathSegMovetoAbs;
0048: import org.w3c.dom.svg.SVGPathSegMovetoRel;
0049: import org.w3c.dom.svg.SVGPoint;
0050:
0051: /**
0052: * This class implements {@link SVGPathElement}.
0053: *
0054: * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
0055: * @version $Id: SVGOMPathElement.java 489964 2006-12-24 01:30:23Z cam $
0056: */
0057: public class SVGOMPathElement extends SVGGraphicsElement implements
0058: SVGPathElement, SVGPathSegConstants {
0059:
0060: /**
0061: * Table mapping XML attribute names to TraitInformation objects.
0062: */
0063: protected static DoublyIndexedTable xmlTraitInformation;
0064: static {
0065: DoublyIndexedTable t = new DoublyIndexedTable(
0066: SVGGraphicsElement.xmlTraitInformation);
0067: t.put(null, SVG_D_ATTRIBUTE, new TraitInformation(true,
0068: SVGTypes.TYPE_PATH_DATA));
0069: t.put(null, SVG_PATH_LENGTH_ATTRIBUTE, new TraitInformation(
0070: true, SVGTypes.TYPE_NUMBER));
0071: xmlTraitInformation = t;
0072: }
0073:
0074: /**
0075: * The 'd' attribute value.
0076: */
0077: protected SVGOMAnimatedPathData d;
0078:
0079: /**
0080: * Creates a new SVGOMPathElement object.
0081: */
0082: protected SVGOMPathElement() {
0083: }
0084:
0085: /**
0086: * Creates a new SVGOMPathElement object.
0087: * @param prefix The namespace prefix.
0088: * @param owner The owner document.
0089: */
0090: public SVGOMPathElement(String prefix, AbstractDocument owner) {
0091: super (prefix, owner);
0092: initializeLiveAttributes();
0093: }
0094:
0095: /**
0096: * Initializes all live attributes for this element.
0097: */
0098: protected void initializeAllLiveAttributes() {
0099: super .initializeAllLiveAttributes();
0100: initializeLiveAttributes();
0101: }
0102:
0103: /**
0104: * Initializes the live attribute values of this element.
0105: */
0106: private void initializeLiveAttributes() {
0107: d = createLiveAnimatedPathData(null, SVG_D_ATTRIBUTE, "");
0108: }
0109:
0110: /**
0111: * <b>DOM</b>: Implements {@link org.w3c.dom.Node#getLocalName()}.
0112: */
0113: public String getLocalName() {
0114: return SVG_PATH_TAG;
0115: }
0116:
0117: /**
0118: * <b>DOM</b>: Implements {@link SVGPathElement#getPathLength()}.
0119: */
0120: public SVGAnimatedNumber getPathLength() {
0121: throw new UnsupportedOperationException(
0122: "SVGPathElement.getPathLength is not implemented"); // XXX
0123: }
0124:
0125: /**
0126: * <b>DOM</b>: Implements {@link SVGPathElement#getTotalLength()}.
0127: */
0128: public float getTotalLength() {
0129: return SVGPathSupport.getTotalLength(this );
0130: }
0131:
0132: /**
0133: * <b>DOM</b>: Implements {@link SVGPathElement#getPointAtLength(float)}.
0134: */
0135: public SVGPoint getPointAtLength(float distance) {
0136: return SVGPathSupport.getPointAtLength(this , distance);
0137: }
0138:
0139: /**
0140: * <b>DOM</b>: Implements {@link SVGPathElement#getPathSegAtLength(float)}.
0141: */
0142: public int getPathSegAtLength(float distance) {
0143: return SVGPathSupport.getPathSegAtLength(this , distance);
0144: }
0145:
0146: /**
0147: * <b>DOM</b>: Implements {@link SVGPathElement#getPathSegList()}.
0148: */
0149: public SVGPathSegList getPathSegList() {
0150: return d.getPathSegList();
0151: }
0152:
0153: /**
0154: * <b>DOM</b>: Implements {@link SVGPathElement#getNormalizedPathSegList()}.
0155: */
0156: public SVGPathSegList getNormalizedPathSegList() {
0157: return d.getNormalizedPathSegList();
0158: }
0159:
0160: /**
0161: * <b>DOM</b>: Implements {@link SVGPathElement#getAnimatedPathSegList()}.
0162: */
0163: public SVGPathSegList getAnimatedPathSegList() {
0164: return d.getAnimatedPathSegList();
0165: }
0166:
0167: /**
0168: * <b>DOM</b>: Implements {@link
0169: * SVGPathElement#getAnimatedNormalizedPathSegList()}.
0170: */
0171: public SVGPathSegList getAnimatedNormalizedPathSegList() {
0172: return d.getAnimatedNormalizedPathSegList();
0173: }
0174:
0175: // Factory methods /////////////////////////////////////////////////////
0176:
0177: /**
0178: * <b>DOM</b>: Implements {@link SVGPathElement#createSVGPathSegClosePath()}.
0179: */
0180: public SVGPathSegClosePath createSVGPathSegClosePath() {
0181: return new SVGPathSegClosePath() {
0182: public short getPathSegType() {
0183: return SVGPathSeg.PATHSEG_CLOSEPATH;
0184: }
0185:
0186: public String getPathSegTypeAsLetter() {
0187: return PATHSEG_CLOSEPATH_LETTER;
0188: }
0189: };
0190: }
0191:
0192: /**
0193: * <b>DOM</b>: Implements {@link
0194: * SVGPathElement#createSVGPathSegMovetoAbs(float,float)}.
0195: */
0196: public SVGPathSegMovetoAbs createSVGPathSegMovetoAbs(
0197: final float x_value, final float y_value) {
0198: return new SVGPathSegMovetoAbs() {
0199: protected float x = x_value;
0200: protected float y = y_value;
0201:
0202: public short getPathSegType() {
0203: return SVGPathSeg.PATHSEG_MOVETO_ABS;
0204: }
0205:
0206: public String getPathSegTypeAsLetter() {
0207: return PATHSEG_MOVETO_ABS_LETTER;
0208: }
0209:
0210: public float getX() {
0211: return x;
0212: }
0213:
0214: public void setX(float x) {
0215: this .x = x;
0216: }
0217:
0218: public float getY() {
0219: return y;
0220: }
0221:
0222: public void setY(float y) {
0223: this .y = y;
0224: }
0225: };
0226: }
0227:
0228: /**
0229: * <b>DOM</b>: Implements {@link
0230: * SVGPathElement#createSVGPathSegMovetoRel(float,float)}.
0231: */
0232: public SVGPathSegMovetoRel createSVGPathSegMovetoRel(
0233: final float x_value, final float y_value) {
0234: return new SVGPathSegMovetoRel() {
0235: protected float x = x_value;
0236: protected float y = y_value;
0237:
0238: public short getPathSegType() {
0239: return SVGPathSeg.PATHSEG_MOVETO_REL;
0240: }
0241:
0242: public String getPathSegTypeAsLetter() {
0243: return PATHSEG_MOVETO_REL_LETTER;
0244: }
0245:
0246: public float getX() {
0247: return x;
0248: }
0249:
0250: public void setX(float x) {
0251: this .x = x;
0252: }
0253:
0254: public float getY() {
0255: return y;
0256: }
0257:
0258: public void setY(float y) {
0259: this .y = y;
0260: }
0261: };
0262: }
0263:
0264: /**
0265: * <b>DOM</b>: Implements {@link
0266: * SVGPathElement#createSVGPathSegLinetoAbs(float,float)}.
0267: */
0268: public SVGPathSegLinetoAbs createSVGPathSegLinetoAbs(
0269: final float x_value, final float y_value) {
0270: return new SVGPathSegLinetoAbs() {
0271: protected float x = x_value;
0272: protected float y = y_value;
0273:
0274: public short getPathSegType() {
0275: return SVGPathSeg.PATHSEG_LINETO_ABS;
0276: }
0277:
0278: public String getPathSegTypeAsLetter() {
0279: return PATHSEG_LINETO_ABS_LETTER;
0280: }
0281:
0282: public float getX() {
0283: return x;
0284: }
0285:
0286: public void setX(float x) {
0287: this .x = x;
0288: }
0289:
0290: public float getY() {
0291: return y;
0292: }
0293:
0294: public void setY(float y) {
0295: this .y = y;
0296: }
0297: };
0298: }
0299:
0300: /**
0301: * <b>DOM</b>: Implements {@link
0302: * SVGPathElement#createSVGPathSegLinetoRel(float,float)}.
0303: */
0304: public SVGPathSegLinetoRel createSVGPathSegLinetoRel(
0305: final float x_value, final float y_value) {
0306: return new SVGPathSegLinetoRel() {
0307: protected float x = x_value;
0308: protected float y = y_value;
0309:
0310: public short getPathSegType() {
0311: return SVGPathSeg.PATHSEG_LINETO_REL;
0312: }
0313:
0314: public String getPathSegTypeAsLetter() {
0315: return PATHSEG_LINETO_REL_LETTER;
0316: }
0317:
0318: public float getX() {
0319: return x;
0320: }
0321:
0322: public void setX(float x) {
0323: this .x = x;
0324: }
0325:
0326: public float getY() {
0327: return y;
0328: }
0329:
0330: public void setY(float y) {
0331: this .y = y;
0332: }
0333: };
0334: }
0335:
0336: /**
0337: * <b>DOM</b>: Implements {@link
0338: * SVGPathElement#createSVGPathSegLinetoHorizontalAbs(float)}.
0339: */
0340: public SVGPathSegLinetoHorizontalAbs createSVGPathSegLinetoHorizontalAbs(
0341: final float x_value) {
0342: return new SVGPathSegLinetoHorizontalAbs() {
0343: protected float x = x_value;
0344:
0345: public short getPathSegType() {
0346: return SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS;
0347: }
0348:
0349: public String getPathSegTypeAsLetter() {
0350: return PATHSEG_LINETO_HORIZONTAL_ABS_LETTER;
0351: }
0352:
0353: public float getX() {
0354: return x;
0355: }
0356:
0357: public void setX(float x) {
0358: this .x = x;
0359: }
0360: };
0361: }
0362:
0363: /**
0364: * <b>DOM</b>: Implements {@link
0365: * SVGPathElement#createSVGPathSegLinetoHorizontalRel(float)}.
0366: */
0367: public SVGPathSegLinetoHorizontalRel createSVGPathSegLinetoHorizontalRel(
0368: final float x_value) {
0369: return new SVGPathSegLinetoHorizontalRel() {
0370: protected float x = x_value;
0371:
0372: public short getPathSegType() {
0373: return SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL;
0374: }
0375:
0376: public String getPathSegTypeAsLetter() {
0377: return PATHSEG_LINETO_HORIZONTAL_REL_LETTER;
0378: }
0379:
0380: public float getX() {
0381: return x;
0382: }
0383:
0384: public void setX(float x) {
0385: this .x = x;
0386: }
0387: };
0388: }
0389:
0390: /**
0391: * <b>DOM</b>: Implements {@link
0392: * SVGPathElement#createSVGPathSegLinetoVerticalAbs(float)}.
0393: */
0394: public SVGPathSegLinetoVerticalAbs createSVGPathSegLinetoVerticalAbs(
0395: final float y_value) {
0396: return new SVGPathSegLinetoVerticalAbs() {
0397: protected float y = y_value;
0398:
0399: public short getPathSegType() {
0400: return SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS;
0401: }
0402:
0403: public String getPathSegTypeAsLetter() {
0404: return PATHSEG_LINETO_VERTICAL_ABS_LETTER;
0405: }
0406:
0407: public float getY() {
0408: return y;
0409: }
0410:
0411: public void setY(float y) {
0412: this .y = y;
0413: }
0414: };
0415: }
0416:
0417: /**
0418: * <b>DOM</b>: Implements {@link
0419: * SVGPathElement#createSVGPathSegLinetoVerticalRel(float)}.
0420: */
0421: public SVGPathSegLinetoVerticalRel createSVGPathSegLinetoVerticalRel(
0422: final float y_value) {
0423: return new SVGPathSegLinetoVerticalRel() {
0424: protected float y = y_value;
0425:
0426: public short getPathSegType() {
0427: return SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL;
0428: }
0429:
0430: public String getPathSegTypeAsLetter() {
0431: return PATHSEG_LINETO_VERTICAL_REL_LETTER;
0432: }
0433:
0434: public float getY() {
0435: return y;
0436: }
0437:
0438: public void setY(float y) {
0439: this .y = y;
0440: }
0441: };
0442: }
0443:
0444: /**
0445: * <b>DOM</b>: Implements {@link
0446: * SVGPathElement#createSVGPathSegCurvetoCubicAbs(float,float,float,float,float,float)}.
0447: */
0448: public SVGPathSegCurvetoCubicAbs createSVGPathSegCurvetoCubicAbs(
0449: final float x_value, final float y_value,
0450: final float x1_value, final float y1_value,
0451: final float x2_value, final float y2_value) {
0452: return new SVGPathSegCurvetoCubicAbs() {
0453: protected float x = x_value;
0454: protected float y = y_value;
0455: protected float x1 = x1_value;
0456: protected float y1 = y1_value;
0457: protected float x2 = x2_value;
0458: protected float y2 = y2_value;
0459:
0460: public short getPathSegType() {
0461: return SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS;
0462: }
0463:
0464: public String getPathSegTypeAsLetter() {
0465: return PATHSEG_CURVETO_CUBIC_ABS_LETTER;
0466: }
0467:
0468: public float getX() {
0469: return x;
0470: }
0471:
0472: public void setX(float x) {
0473: this .x = x;
0474: }
0475:
0476: public float getY() {
0477: return y;
0478: }
0479:
0480: public void setY(float y) {
0481: this .y = y;
0482: }
0483:
0484: public float getX1() {
0485: return x1;
0486: }
0487:
0488: public void setX1(float x1) {
0489: this .x1 = x1;
0490: }
0491:
0492: public float getY1() {
0493: return y1;
0494: }
0495:
0496: public void setY1(float y1) {
0497: this .y1 = y1;
0498: }
0499:
0500: public float getX2() {
0501: return x2;
0502: }
0503:
0504: public void setX2(float x2) {
0505: this .x2 = x2;
0506: }
0507:
0508: public float getY2() {
0509: return y2;
0510: }
0511:
0512: public void setY2(float y2) {
0513: this .y2 = y2;
0514: }
0515: };
0516: }
0517:
0518: /**
0519: * <b>DOM</b>: Implements {@link
0520: * SVGPathElement#createSVGPathSegCurvetoCubicRel(float,float,float,float,float,float)}.
0521: */
0522: public SVGPathSegCurvetoCubicRel createSVGPathSegCurvetoCubicRel(
0523: final float x_value, final float y_value,
0524: final float x1_value, final float y1_value,
0525: final float x2_value, final float y2_value) {
0526: return new SVGPathSegCurvetoCubicRel() {
0527: protected float x = x_value;
0528: protected float y = y_value;
0529: protected float x1 = x1_value;
0530: protected float y1 = y1_value;
0531: protected float x2 = x2_value;
0532: protected float y2 = y2_value;
0533:
0534: public short getPathSegType() {
0535: return SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL;
0536: }
0537:
0538: public String getPathSegTypeAsLetter() {
0539: return PATHSEG_CURVETO_CUBIC_REL_LETTER;
0540: }
0541:
0542: public float getX() {
0543: return x;
0544: }
0545:
0546: public void setX(float x) {
0547: this .x = x;
0548: }
0549:
0550: public float getY() {
0551: return y;
0552: }
0553:
0554: public void setY(float y) {
0555: this .y = y;
0556: }
0557:
0558: public float getX1() {
0559: return x1;
0560: }
0561:
0562: public void setX1(float x1) {
0563: this .x1 = x1;
0564: }
0565:
0566: public float getY1() {
0567: return y1;
0568: }
0569:
0570: public void setY1(float y1) {
0571: this .y1 = y1;
0572: }
0573:
0574: public float getX2() {
0575: return x2;
0576: }
0577:
0578: public void setX2(float x2) {
0579: this .x2 = x2;
0580: }
0581:
0582: public float getY2() {
0583: return y2;
0584: }
0585:
0586: public void setY2(float y2) {
0587: this .y2 = y2;
0588: }
0589: };
0590: }
0591:
0592: /**
0593: * <b>DOM</b>: Implements {@link
0594: * SVGPathElement#createSVGPathSegCurvetoQuadraticAbs(float,float,float,float)}.
0595: */
0596: public SVGPathSegCurvetoQuadraticAbs createSVGPathSegCurvetoQuadraticAbs(
0597: final float x_value, final float y_value,
0598: final float x1_value, final float y1_value) {
0599: return new SVGPathSegCurvetoQuadraticAbs() {
0600: protected float x = x_value;
0601: protected float y = y_value;
0602: protected float x1 = x1_value;
0603: protected float y1 = y1_value;
0604:
0605: public short getPathSegType() {
0606: return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS;
0607: }
0608:
0609: public String getPathSegTypeAsLetter() {
0610: return PATHSEG_CURVETO_QUADRATIC_ABS_LETTER;
0611: }
0612:
0613: public float getX() {
0614: return x;
0615: }
0616:
0617: public void setX(float x) {
0618: this .x = x;
0619: }
0620:
0621: public float getY() {
0622: return y;
0623: }
0624:
0625: public void setY(float y) {
0626: this .y = y;
0627: }
0628:
0629: public float getX1() {
0630: return x1;
0631: }
0632:
0633: public void setX1(float x1) {
0634: this .x1 = x1;
0635: }
0636:
0637: public float getY1() {
0638: return y1;
0639: }
0640:
0641: public void setY1(float y1) {
0642: this .y1 = y1;
0643: }
0644: };
0645: }
0646:
0647: /**
0648: * <b>DOM</b>: Implements {@link
0649: * SVGPathElement#createSVGPathSegCurvetoQuadraticRel(float,float,float,float)}.
0650: */
0651: public SVGPathSegCurvetoQuadraticRel createSVGPathSegCurvetoQuadraticRel(
0652: final float x_value, final float y_value,
0653: final float x1_value, final float y1_value) {
0654: return new SVGPathSegCurvetoQuadraticRel() {
0655: protected float x = x_value;
0656: protected float y = y_value;
0657: protected float x1 = x1_value;
0658: protected float y1 = y1_value;
0659:
0660: public short getPathSegType() {
0661: return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL;
0662: }
0663:
0664: public String getPathSegTypeAsLetter() {
0665: return PATHSEG_CURVETO_QUADRATIC_REL_LETTER;
0666: }
0667:
0668: public float getX() {
0669: return x;
0670: }
0671:
0672: public void setX(float x) {
0673: this .x = x;
0674: }
0675:
0676: public float getY() {
0677: return y;
0678: }
0679:
0680: public void setY(float y) {
0681: this .y = y;
0682: }
0683:
0684: public float getX1() {
0685: return x1;
0686: }
0687:
0688: public void setX1(float x1) {
0689: this .x1 = x1;
0690: }
0691:
0692: public float getY1() {
0693: return y1;
0694: }
0695:
0696: public void setY1(float y1) {
0697: this .y1 = y1;
0698: }
0699: };
0700: }
0701:
0702: /**
0703: * <b>DOM</b>: Implements {@link
0704: * SVGPathElement#createSVGPathSegCurvetoCubicSmoothAbs(float,float,float,float)}.
0705: */
0706: public SVGPathSegCurvetoCubicSmoothAbs createSVGPathSegCurvetoCubicSmoothAbs(
0707: final float x_value, final float y_value,
0708: final float x2_value, final float y2_value) {
0709: return new SVGPathSegCurvetoCubicSmoothAbs() {
0710: protected float x = x_value;
0711: protected float y = y_value;
0712: protected float x2 = x2_value;
0713: protected float y2 = y2_value;
0714:
0715: public short getPathSegType() {
0716: return SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;
0717: }
0718:
0719: public String getPathSegTypeAsLetter() {
0720: return PATHSEG_CURVETO_CUBIC_SMOOTH_ABS_LETTER;
0721: }
0722:
0723: public float getX() {
0724: return x;
0725: }
0726:
0727: public void setX(float x) {
0728: this .x = x;
0729: }
0730:
0731: public float getY() {
0732: return y;
0733: }
0734:
0735: public void setY(float y) {
0736: this .y = y;
0737: }
0738:
0739: public float getX2() {
0740: return x2;
0741: }
0742:
0743: public void setX2(float x2) {
0744: this .x2 = x2;
0745: }
0746:
0747: public float getY2() {
0748: return y2;
0749: }
0750:
0751: public void setY2(float y2) {
0752: this .y2 = y2;
0753: }
0754: };
0755: }
0756:
0757: /**
0758: * <b>DOM</b>: Implements {@link
0759: * SVGPathElement#createSVGPathSegCurvetoCubicSmoothRel(float,float,float,float)}.
0760: */
0761: public SVGPathSegCurvetoCubicSmoothRel createSVGPathSegCurvetoCubicSmoothRel(
0762: final float x_value, final float y_value,
0763: final float x2_value, final float y2_value) {
0764: return new SVGPathSegCurvetoCubicSmoothRel() {
0765: protected float x = x_value;
0766: protected float y = y_value;
0767: protected float x2 = x2_value;
0768: protected float y2 = y2_value;
0769:
0770: public short getPathSegType() {
0771: return SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL;
0772: }
0773:
0774: public String getPathSegTypeAsLetter() {
0775: return PATHSEG_CURVETO_CUBIC_SMOOTH_REL_LETTER;
0776: }
0777:
0778: public float getX() {
0779: return x;
0780: }
0781:
0782: public void setX(float x) {
0783: this .x = x;
0784: }
0785:
0786: public float getY() {
0787: return y;
0788: }
0789:
0790: public void setY(float y) {
0791: this .y = y;
0792: }
0793:
0794: public float getX2() {
0795: return x2;
0796: }
0797:
0798: public void setX2(float x2) {
0799: this .x2 = x2;
0800: }
0801:
0802: public float getY2() {
0803: return y2;
0804: }
0805:
0806: public void setY2(float y2) {
0807: this .y2 = y2;
0808: }
0809: };
0810: }
0811:
0812: /**
0813: * <b>DOM</b>: Implements {@link
0814: * SVGPathElement#createSVGPathSegCurvetoQuadraticSmoothAbs(float,float)}.
0815: */
0816: public SVGPathSegCurvetoQuadraticSmoothAbs createSVGPathSegCurvetoQuadraticSmoothAbs(
0817: final float x_value, final float y_value) {
0818: return new SVGPathSegCurvetoQuadraticSmoothAbs() {
0819: protected float x = x_value;
0820: protected float y = y_value;
0821:
0822: public short getPathSegType() {
0823: return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS;
0824: }
0825:
0826: public String getPathSegTypeAsLetter() {
0827: return PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS_LETTER;
0828: }
0829:
0830: public float getX() {
0831: return x;
0832: }
0833:
0834: public void setX(float x) {
0835: this .x = x;
0836: }
0837:
0838: public float getY() {
0839: return y;
0840: }
0841:
0842: public void setY(float y) {
0843: this .y = y;
0844: }
0845: };
0846:
0847: }
0848:
0849: /**
0850: * <b>DOM</b>: Implements {@link
0851: * SVGPathElement#createSVGPathSegCurvetoQuadraticSmoothRel(float,float)}.
0852: */
0853: public SVGPathSegCurvetoQuadraticSmoothRel createSVGPathSegCurvetoQuadraticSmoothRel(
0854: final float x_value, final float y_value) {
0855: return new SVGPathSegCurvetoQuadraticSmoothRel() {
0856: protected float x = x_value;
0857: protected float y = y_value;
0858:
0859: public short getPathSegType() {
0860: return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL;
0861: }
0862:
0863: public String getPathSegTypeAsLetter() {
0864: return PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL_LETTER;
0865: }
0866:
0867: public float getX() {
0868: return x;
0869: }
0870:
0871: public void setX(float x) {
0872: this .x = x;
0873: }
0874:
0875: public float getY() {
0876: return y;
0877: }
0878:
0879: public void setY(float y) {
0880: this .y = y;
0881: }
0882: };
0883: }
0884:
0885: /**
0886: * <b>DOM</b>: Implements {@link
0887: * SVGPathElement#createSVGPathSegArcAbs(float,float,float,float,float,boolean,boolean)}.
0888: */
0889: public SVGPathSegArcAbs createSVGPathSegArcAbs(final float x_value,
0890: final float y_value, final float r1_value,
0891: final float r2_value, final float angle_value,
0892: final boolean largeArcFlag_value,
0893: final boolean sweepFlag_value) {
0894: return new SVGPathSegArcAbs() {
0895: protected float x = x_value;
0896: protected float y = y_value;
0897: protected float r1 = r1_value;
0898: protected float r2 = r2_value;
0899: protected float angle = angle_value;
0900: protected boolean largeArcFlag = largeArcFlag_value;
0901: protected boolean sweepFlag = sweepFlag_value;
0902:
0903: public short getPathSegType() {
0904: return SVGPathSeg.PATHSEG_ARC_ABS;
0905: }
0906:
0907: public String getPathSegTypeAsLetter() {
0908: return PATHSEG_ARC_ABS_LETTER;
0909: }
0910:
0911: public float getX() {
0912: return x;
0913: }
0914:
0915: public void setX(float x) {
0916: this .x = x;
0917: }
0918:
0919: public float getY() {
0920: return y;
0921: }
0922:
0923: public void setY(float y) {
0924: this .y = y;
0925: }
0926:
0927: public float getR1() {
0928: return r1;
0929: }
0930:
0931: public void setR1(float r1) {
0932: this .r1 = r1;
0933: }
0934:
0935: public float getR2() {
0936: return r2;
0937: }
0938:
0939: public void setR2(float r2) {
0940: this .r2 = r2;
0941: }
0942:
0943: public float getAngle() {
0944: return angle;
0945: }
0946:
0947: public void setAngle(float angle) {
0948: this .angle = angle;
0949: }
0950:
0951: public boolean getLargeArcFlag() {
0952: return largeArcFlag;
0953: }
0954:
0955: public void setLargeArcFlag(boolean largeArcFlag) {
0956: this .largeArcFlag = largeArcFlag;
0957: }
0958:
0959: public boolean getSweepFlag() {
0960: return sweepFlag;
0961: }
0962:
0963: public void setSweepFlag(boolean sweepFlag) {
0964: this .sweepFlag = sweepFlag;
0965: }
0966:
0967: };
0968: }
0969:
0970: /**
0971: * <b>DOM</b>: Implements {@link
0972: * SVGPathElement#createSVGPathSegArcRel(float,float,float,float,float,boolean,boolean)}.
0973: */
0974: public SVGPathSegArcRel createSVGPathSegArcRel(final float x_value,
0975: final float y_value, final float r1_value,
0976: final float r2_value, final float angle_value,
0977: final boolean largeArcFlag_value,
0978: final boolean sweepFlag_value) {
0979: return new SVGPathSegArcRel() {
0980: protected float x = x_value;
0981: protected float y = y_value;
0982: protected float r1 = r1_value;
0983: protected float r2 = r2_value;
0984: protected float angle = angle_value;
0985: protected boolean largeArcFlag = largeArcFlag_value;
0986: protected boolean sweepFlag = sweepFlag_value;
0987:
0988: public short getPathSegType() {
0989: return SVGPathSeg.PATHSEG_ARC_REL;
0990: }
0991:
0992: public String getPathSegTypeAsLetter() {
0993: return PATHSEG_ARC_REL_LETTER;
0994: }
0995:
0996: public float getX() {
0997: return x;
0998: }
0999:
1000: public void setX(float x) {
1001: this .x = x;
1002: }
1003:
1004: public float getY() {
1005: return y;
1006: }
1007:
1008: public void setY(float y) {
1009: this .y = y;
1010: }
1011:
1012: public float getR1() {
1013: return r1;
1014: }
1015:
1016: public void setR1(float r1) {
1017: this .r1 = r1;
1018: }
1019:
1020: public float getR2() {
1021: return r2;
1022: }
1023:
1024: public void setR2(float r2) {
1025: this .r2 = r2;
1026: }
1027:
1028: public float getAngle() {
1029: return angle;
1030: }
1031:
1032: public void setAngle(float angle) {
1033: this .angle = angle;
1034: }
1035:
1036: public boolean getLargeArcFlag() {
1037: return largeArcFlag;
1038: }
1039:
1040: public void setLargeArcFlag(boolean largeArcFlag) {
1041: this .largeArcFlag = largeArcFlag;
1042: }
1043:
1044: public boolean getSweepFlag() {
1045: return sweepFlag;
1046: }
1047:
1048: public void setSweepFlag(boolean sweepFlag) {
1049: this .sweepFlag = sweepFlag;
1050: }
1051:
1052: };
1053: }
1054:
1055: /**
1056: * Returns a new uninitialized instance of this object's class.
1057: */
1058: protected Node newNode() {
1059: return new SVGOMPathElement();
1060: }
1061:
1062: /**
1063: * Returns the table of TraitInformation objects for this element.
1064: */
1065: protected DoublyIndexedTable getTraitInformationTable() {
1066: return xmlTraitInformation;
1067: }
1068: }
|