You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SVGPathElementImpl.java 7.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. /*-- $Id$ --
  2. ============================================================================
  3. The Apache Software License, Version 1.1
  4. ============================================================================
  5. Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
  6. Redistribution and use in source and binary forms, with or without modifica-
  7. tion, are permitted provided that the following conditions are met:
  8. 1. Redistributions of source code must retain the above copyright notice,
  9. this list of conditions and the following disclaimer.
  10. 2. Redistributions in binary form must reproduce the above copyright notice,
  11. this list of conditions and the following disclaimer in the documentation
  12. and/or other materials provided with the distribution.
  13. 3. The end-user documentation included with the redistribution, if any, must
  14. include the following acknowledgment: "This product includes software
  15. developed by the Apache Software Foundation (http://www.apache.org/)."
  16. Alternately, this acknowledgment may appear in the software itself, if
  17. and wherever such third-party acknowledgments normally appear.
  18. 4. The names "FOP" and "Apache Software Foundation" must not be used to
  19. endorse or promote products derived from this software without prior
  20. written permission. For written permission, please contact
  21. apache@apache.org.
  22. 5. Products derived from this software may not be called "Apache", nor may
  23. "Apache" appear in their name, without prior written permission of the
  24. Apache Software Foundation.
  25. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  26. INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  27. FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  28. APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  29. INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  30. DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  31. OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  32. ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  33. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  34. THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  35. This software consists of voluntary contributions made by many individuals
  36. on behalf of the Apache Software Foundation and was originally created by
  37. James Tauber <jtauber@jtauber.com>. For more information on the Apache
  38. Software Foundation, please see <http://www.apache.org/>.
  39. */
  40. package org.apache.fop.dom.svg;
  41. import java.util.*;
  42. import org.w3c.dom.svg.*;
  43. /**
  44. * TODO: implement properly
  45. */
  46. public class SVGPathElementImpl extends GraphicElement implements SVGPathElement {
  47. public Vector pathElements;
  48. /**
  49. * construct a line graphic
  50. */
  51. public SVGPathElementImpl(Vector v)
  52. {
  53. this.pathElements = v;
  54. }
  55. public SVGAnimatedNumber getPathLength()
  56. {
  57. return null;
  58. }
  59. public SVGRect getBBox()
  60. {
  61. float minX = 10000000; // a big number
  62. float maxX = -10000000; // a low number
  63. float minY = 10000000; // a big number
  64. float maxY = -10000000; // a low number
  65. // the bounds of a path is always within the end points and
  66. // the control points, so adjust the min and max to be these extremes
  67. for(Enumeration e = pathElements.elements(); e.hasMoreElements(); ) {
  68. SVGPathSegImpl pc = (SVGPathSegImpl)e.nextElement();
  69. float[] vals = pc.getValues();
  70. switch(pc.getPathSegType()) {
  71. case SVGPathSeg.PATHSEG_MOVETO_ABS:
  72. break;
  73. case SVGPathSeg.PATHSEG_MOVETO_REL:
  74. break;
  75. case SVGPathSeg.PATHSEG_LINETO_ABS:
  76. break;
  77. case SVGPathSeg.PATHSEG_LINETO_REL:
  78. break;
  79. case SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:
  80. break;
  81. case SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:
  82. break;
  83. case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:
  84. break;
  85. case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:
  86. break;
  87. case SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS:
  88. break;
  89. case SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL:
  90. break;
  91. case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:
  92. break;
  93. case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:
  94. break;
  95. case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:
  96. break;
  97. case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:
  98. break;
  99. case SVGPathSeg.PATHSEG_ARC_ABS:
  100. break;
  101. case SVGPathSeg.PATHSEG_ARC_REL:
  102. break;
  103. case SVGPathSeg.PATHSEG_CLOSEPATH:
  104. break;
  105. }
  106. }
  107. SVGRect rect = new SVGRectImpl();
  108. rect.setX(minX);
  109. rect.setY(minY);
  110. rect.setWidth(maxX - minX);
  111. rect.setHeight(maxY - minY);
  112. return rect;
  113. }
  114. public void setPathLength( SVGAnimatedNumber length )
  115. {
  116. }
  117. public SVGList getPathSegList()
  118. {
  119. return null;
  120. }
  121. public SVGList getNormalizedPathSegList()
  122. {
  123. return null;
  124. }
  125. public float getTotalLength()
  126. {
  127. return 0;
  128. }
  129. public SVGPoint getPointAtLength(float distance)
  130. throws SVGException
  131. {
  132. return null;
  133. }
  134. public int getPathSegAtLength(float distance)
  135. throws SVGException
  136. {
  137. return 0;
  138. }
  139. public short getPathSegType( )
  140. {
  141. return 0;
  142. }
  143. public String getPathSegTypeAsLetter( )
  144. {
  145. return null;
  146. }
  147. public SVGPathSegClosePath createSVGPathSegClosePath ( )
  148. {
  149. return null;
  150. }
  151. public SVGPathSegMovetoAbs createSVGPathSegMovetoAbs ( float x, float y )
  152. {
  153. return null;
  154. }
  155. public SVGPathSegMovetoRel createSVGPathSegMovetoRel ( float x, float y )
  156. {
  157. return null;
  158. }
  159. public SVGPathSegLinetoAbs createSVGPathSegLinetoAbs ( float x, float y )
  160. {
  161. return null;
  162. }
  163. public SVGPathSegLinetoRel createSVGPathSegLinetoRel ( float x, float y )
  164. {
  165. return null;
  166. }
  167. public SVGPathSegCurvetoCubicAbs createSVGPathSegCurvetoCubicAbs ( float x, float y, float x1, float y1, float x2, float y2 )
  168. {
  169. return null;
  170. }
  171. public SVGPathSegCurvetoCubicRel createSVGPathSegCurvetoCubicRel ( float x, float y, float x1, float y1, float x2, float y2 )
  172. {
  173. return null;
  174. }
  175. public SVGPathSegCurvetoQuadraticAbs createSVGPathSegCurvetoQuadraticAbs ( float x, float y, float x1, float y1 )
  176. {
  177. return null;
  178. }
  179. public SVGPathSegCurvetoQuadraticRel createSVGPathSegCurvetoQuadraticRel ( float x, float y, float x1, float y1 )
  180. {
  181. return null;
  182. }
  183. public SVGPathSegArcAbs createSVGPathSegArcAbs ( float x, float y, float r1, float r2, float angle, boolean largeArcFlag, boolean sweepFlag )
  184. {
  185. return null;
  186. }
  187. public SVGPathSegArcRel createSVGPathSegArcRel ( float x, float y, float r1, float r2, float angle, boolean largeArcFlag, boolean sweepFlag )
  188. {
  189. return null;
  190. }
  191. public SVGPathSegLinetoHorizontalAbs createSVGPathSegLinetoHorizontalAbs ( float x )
  192. {
  193. return null;
  194. }
  195. public SVGPathSegLinetoHorizontalRel createSVGPathSegLinetoHorizontalRel ( float x )
  196. {
  197. return null;
  198. }
  199. public SVGPathSegLinetoVerticalAbs createSVGPathSegLinetoVerticalAbs ( float y )
  200. {
  201. return null;
  202. }
  203. public SVGPathSegLinetoVerticalRel createSVGPathSegLinetoVerticalRel ( float y )
  204. {
  205. return null;
  206. }
  207. public SVGPathSegCurvetoCubicSmoothAbs createSVGPathSegCurvetoCubicSmoothAbs ( float x, float y, float x2, float y2 )
  208. {
  209. return null;
  210. }
  211. public SVGPathSegCurvetoCubicSmoothRel createSVGPathSegCurvetoCubicSmoothRel ( float x, float y, float x2, float y2 )
  212. {
  213. return null;
  214. }
  215. public SVGPathSegCurvetoQuadraticSmoothAbs createSVGPathSegCurvetoQuadraticSmoothAbs ( float x, float y )
  216. {
  217. return null;
  218. }
  219. public SVGPathSegCurvetoQuadraticSmoothRel createSVGPathSegCurvetoQuadraticSmoothRel ( float x, float y )
  220. {
  221. return null;
  222. }
  223. public SVGList getAnimatedPathSegList( )
  224. {
  225. return null;
  226. }
  227. public SVGList getAnimatedNormalizedPathSegList( )
  228. {
  229. return null;
  230. }
  231. }