summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/kitfox/salamander/svg/paths/SVGPathElement.java
blob: a1e6e9f8fbbf4f78db804b3586681426b5cd6944 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
/*
 * SVGPathElement.java
 *
 * Created on April 12, 2007, 9:19 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template the editor.
 */

package com.kitfox.salamander.svg.paths;

import com.kitfox.salamander.svg.basic.SVGAnimatedNumber;
import com.kitfox.salamander.svg.basic.SVGElement;
import com.kitfox.salamander.svg.basic.SVGExternalResourcesRequired;
import com.kitfox.salamander.svg.basic.SVGLangSpace;
import com.kitfox.salamander.svg.basic.SVGStylable;
import com.kitfox.salamander.svg.basic.SVGTests;
import com.kitfox.salamander.svg.basic.SVGTransformable;
import com.kitfox.salamander.svg.coordSystems.SVGPoint;
import org.w3c.dom.events.EventTarget;

/**
 * 
 * The SVGPathElement  interface corresponds to the 'path' element.
 * @author kitfox
 */
public interface SVGPathElement extends SVGElement, SVGTests, SVGLangSpace,
        SVGExternalResourcesRequired, SVGStylable, SVGTransformable,
        EventTarget, SVGAnimatedPathData
{
    /**
     * Corresponds to attribute pathLength on the given 'path' element.
     */
    public SVGAnimatedNumber getPathLength();
    /**
     * Returns the user agent's computed value for the total length of the path using the user agent's distance-along-a-path algorithm, as a distance in the current user coordinate system.
     * @return The total length of the path.
     */
    public float getTotalLength();
    /**
     * Returns the (x,y) coordinate in user space which is distance units along the path, utilizing the user agent's distance-along-a-path algorithm.
     * @param distance The distance along the path, relative to the start of the path, as a distance in the current user coordinate system.
     * @return The returned point in user space.
     */
    public SVGPoint getPointAtLength(float distance);
    /**
     * Returns the index into pathSegList which is distance units along the path, utilizing the user agent's distance-along-a-path algorithm.
     * @param distance The distance along the path, relative to the start of the path, as a distance in the current user coordinate system.
     * @return The index of the path segment, where the first path segment is number 0.
     */
    public int getPathSegAtLength(float distance);
    /**
     * Returns a stand-alone, parentless SVGPathSegClosePath object.
     * @return A stand-alone, parentless SVGPathSegClosePath object.
     */
    public SVGPathSegClosePath createSVGPathSegClosePath();
    /**
     * Returns a stand-alone, parentless SVGPathSegMovetoAbs object.
     * @param x The absolute X coordinate for the end point of this path segment.
     * @param y The absolute Y coordinate for the end point of this path segment.
     * @return A stand-alone, parentless SVGPathSegMovetoAbs object.
     */
    public SVGPathSegMovetoAbs createSVGPathSegMovetoAbs(float x, float y);
    /**
     * Returns a stand-alone, parentless SVGPathSegMovetoRel object.
     * @param x The relative X coordinate for the end point of this path segment.
     * @param y The relative Y coordinate for the end point of this path segment.
     * @return A stand-alone, parentless SVGPathSegMovetoRel object.
     */
    public SVGPathSegMovetoRel createSVGPathSegMovetoRel(float x, float y);
    /**
     * Returns a stand-alone, parentless SVGPathSegLinetoAbs object.
     * @param x The absolute X coordinate for the end point of this path segment.
     * @param y The absolute Y coordinate for the end point of this path segment.
     * @return A stand-alone, parentless SVGPathSegLinetoAbs object.
     */
    public SVGPathSegLinetoAbs createSVGPathSegLinetoAbs(float x, float y);
    /**
     * Returns a stand-alone, parentless SVGPathSegLinetoRel object.
     * @param x The relative X coordinate for the end point of this path segment.
     * @param y The relative Y coordinate for the end point of this path segment.
     * @return A stand-alone, parentless SVGPathSegLinetoRel object.
     */
    public SVGPathSegLinetoRel createSVGPathSegLinetoRel(float x, float y);
    /**
     * Returns a stand-alone, parentless SVGPathSegCurvetoCubicAbs object.
     * @param x The absolute X coordinate for the end point of this path segment.
     * @param y The absolute Y coordinate for the end point of this path segment.
     * @param x1 The absolute X coordinate for the first control point.
     * @param y1 The absolute Y coordinate for the first control point.
     * @param x2 The absolute X coordinate for the second control point.
     * @param y2 The absolute Y coordinate for the second control point.
     * @return A stand-alone, parentless SVGPathSegCurvetoCubicAbs object.
     */
    public SVGPathSegCurvetoCubicAbs createSVGPathSegCurvetoCubicAbs(float x, float y, float x1, float y1, float x2, float y2);
    /**
     * Returns a stand-alone, parentless SVGPathSegCurvetoCubicRel object.
     * @param x The relative X coordinate for the end point of this path segment.
     * @param y The relative Y coordinate for the end point of this path segment.
     * @param x1 The relative X coordinate for the first control point.
     * @param y1 The relative Y coordinate for the first control point.
     * @param x2 The relative X coordinate for the second control point.
     * @param y2 The relative Y coordinate for the second control point.
     * @return A stand-alone, parentless SVGPathSegCurvetoCubicRel object.
     */
    public SVGPathSegCurvetoCubicRel createSVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2);
    /**
     * Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticAbs object.
     * @param x The absolute X coordinate for the end point of this path segment.
     * @param y The absolute Y coordinate for the end point of this path segment.
     * @param x1 The absolute X coordinate for the control point.
     * @param y1 The absolute Y coordinate for the control point.
     * @return A stand-alone, parentless SVGPathSegCurvetoQuadraticAbs object.
     */
    public SVGPathSegCurvetoQuadraticAbs createSVGPathSegCurvetoQuadraticAbs(float x, float y, float x1, float y1);
    /**
     * Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticRel object.
     * @param x The relative X coordinate for the end point of this path segment.
     * @param y The relative Y coordinate for the end point of this path segment.
     * @param x1 The relative X coordinate for the control point.
     * @param y1 The relative Y coordinate for the control point.
     * @return A stand-alone, parentless SVGPathSegCurvetoQuadraticRel object.
     */
    public SVGPathSegCurvetoQuadraticRel createSVGPathSegCurvetoQuadraticRel(float x, float y, float x1, float y1);
    /**
     * Returns a stand-alone, parentless SVGPathSegArcAbs object.
     * @param x The absolute X coordinate for the end point of this path segment.
     * @param y The absolute Y coordinate for the end point of this path segment.
     * @param r1 The x-axis radius for the ellipse (i.e., r1).
     * @param r2 The y-axis radius for the ellipse (i.e., r2).
     * @param angle The rotation angle in degrees for the ellipse's x-axis relative to the x-axis of the user coordinate system.
     * @param largeArcFlag The value for the large-arc-flag parameter.
     * @param sweepFlag The value for the sweep-flag parameter.
     * @return   	A stand-alone, parentless SVGPathSegArcAbs object.	A stand-alone, parentless SVGPathSegArcAbs object.
     */
    public SVGPathSegCurvetoArcAbs createSVGPathSegArcAbs(float x, float y, float r1, float r2, float angle, boolean largeArcFlag, boolean sweepFlag);
    /**
     * Returns a stand-alone, parentless SVGPathSegArcRel object.
     * @param x The relative X coordinate for the end point of this path segment.
     * @param y The relative Y coordinate for the end point of this path segment.
     * @param r1 The x-axis radius for the ellipse (i.e., r1).
     * @param r2 The y-axis radius for the ellipse (i.e., r2).
     * @param angle The rotation angle in degrees for the ellipse's x-axis relative to the x-axis of the user coordinate system.
     * @param largeArcFlag The value for the large-arc-flag parameter.
     * @param sweepFlag The value for the sweep-flag parameter.
     * @return A stand-alone, parentless SVGPathSegArcRel object.
     */
    public SVGPathSegCurvetoArcRel createSVGPathSegArcRel(float x, float y, float r1, float r2, float angle, boolean largeArcFlag, boolean sweepFlag);
    /**
     * Returns a stand-alone, parentless SVGPathSegLinetoHorizontalAbs object.
     * @param x The absolute X coordinate for the end point of this path segment.
     * @return A stand-alone, parentless SVGPathSegLinetoHorizontalAbs object.
     */
    public SVGPathSegLinetoHorizontalAbs createSVGPathSegLinetoHorizontalAbs(float x);
    /**
     * Returns a stand-alone, parentless SVGPathSegLinetoHorizontalRel object.
     * @param x The relative X coordinate for the end point of this path segment.
     * @return A stand-alone, parentless SVGPathSegLinetoHorizontalRel object.
     */
    public SVGPathSegLinetoHorizontalRel createSVGPathSegLinetoHorizontalRel(float x);
    /**
     * Returns a stand-alone, parentless SVGPathSegLinetoVerticalAbs object.
     * @param y The absolute Y coordinate for the end point of this path segment.
     * @return A stand-alone, parentless SVGPathSegLinetoVerticalAbs object.
     */
    public SVGPathSegLinetoVerticalAbs createSVGPathSegLinetoVerticalAbs(float y);
    /**
     * Returns a stand-alone, parentless SVGPathSegLinetoVerticalRel object.
     * @param y The relative Y coordinate for the end point of this path segment.
     * @return   	A stand-alone, parentless SVGPathSegLinetoVerticalRel object.
     */
    public SVGPathSegLinetoVerticalRel createSVGPathSegLinetoVerticalRel(float y);
    /**
     * Returns a stand-alone, parentless SVGPathSegCurvetoCubicSmoothAbs object.
     * @param x The absolute X coordinate for the end point of this path segment.
     * @param y The absolute Y coordinate for the end point of this path segment.
     * @param x2 The absolute X coordinate for the second control point.
     * @param y2 The absolute Y coordinate for the second control point.
     * @return   	A stand-alone, parentless SVGPathSegCurvetoCubicSmoothAbs object.
     */
    public SVGPathSegCurvetoCubicSmoothAbs createSVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2);
    /**
     * Returns a stand-alone, parentless SVGPathSegCurvetoCubicSmoothRel object.
     * @param x The relative X coordinate for the end point of this path segment.
     * @param y The relative Y coordinate for the end point of this path segment.
     * @param x2 The relative X coordinate for the second control point.
     * @param y2 The relative Y coordinate for the second control point.
     * @return A stand-alone, parentless SVGPathSegCurvetoCubicSmoothRel object.
     */
    public SVGPathSegCurvetoCubicSmoothRel createSVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2);
    /**
     * Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticSmoothAbs object.
     * @param x The absolute X coordinate for the end point of this path segment.
     * @param y The absolute Y coordinate for the end point of this path segment.
     * @return A stand-alone, parentless SVGPathSegCurvetoQuadraticSmoothAbs object.
     */
    public SVGPathSegCurvetoQuadraticSmoothAbs createSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y);
    /**
     * Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticSmoothRel object.
     * @param x The relative X coordinate for the end point of this path segment.
     * @param y The relative Y coordinate for the end point of this path segment.
     * @return A stand-alone, parentless SVGPathSegCurvetoQuadraticSmoothRel object.
     */
    public SVGPathSegCurvetoQuadraticSmoothRel createSVGPathSegCurvetoQuadraticSmoothRel(float x, float y);
}