Skip to content

Commit cb02a46

Browse files
committed
Add javadoc to a few interfaces
1 parent 845bcb4 commit cb02a46

File tree

4 files changed

+219
-0
lines changed

4 files changed

+219
-0
lines changed

svgom-api/src/main/java/org/w3c/dom/svg/SVGPoint.java

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,58 @@
1414

1515
import org.w3c.dom.DOMException;
1616

17+
/**
18+
* An <code>(x, y)</code> coordinate pair.
19+
* <p>
20+
* When used in matrix operations, an SVGPoint is treated as a vector of the
21+
* form:
22+
* </p>
23+
*
24+
* <pre>
25+
* [x]
26+
* [y]
27+
* [1]
28+
* </pre>
29+
*/
1730
public interface SVGPoint {
31+
32+
/**
33+
* Get the x coordinate.
34+
*
35+
* @return the x coordinate.
36+
*/
1837
float getX();
1938

39+
/**
40+
* Sets the x coordinate.
41+
*
42+
* @param x the x coordinate.
43+
* @throws DOMException NO_MODIFICATION_ALLOWED_ERR if this value is read only.
44+
*/
2045
void setX(float x) throws DOMException;
2146

47+
/**
48+
* Get the y coordinate.
49+
*
50+
* @return the y coordinate.
51+
*/
2252
float getY();
2353

54+
/**
55+
* Sets the y coordinate.
56+
*
57+
* @param y the y coordinate.
58+
* @throws DOMException NO_MODIFICATION_ALLOWED_ERR if this value is read only.
59+
*/
2460
void setY(float y) throws DOMException;
2561

62+
/**
63+
* Applies a 2x3 matrix transformation on this SVGPoint object and returns a
64+
* new, transformed SVGPoint object.
65+
*
66+
* @param matrix the matrix.
67+
* @return a new SVGPoint object.
68+
*/
2669
SVGPoint matrixTransform(SVGMatrix matrix);
70+
2771
}

svgom-api/src/main/java/org/w3c/dom/svg/SVGPointList.java

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,110 @@
1414

1515
import org.w3c.dom.DOMException;
1616

17+
/**
18+
* A list of {@link SVGPoint} objects.
19+
*/
1720
public interface SVGPointList {
21+
22+
/**
23+
* The number of items in the list.
24+
*
25+
* @return The number of items.
26+
*/
1827
int getNumberOfItems();
1928

29+
/**
30+
* Clears all existing current items from the list, with the result being an
31+
* empty list.
32+
*
33+
* @throws DOMException NO_MODIFICATION_ALLOWED_ERR if this list is read only.
34+
*/
2035
void clear() throws DOMException;
2136

37+
/**
38+
* Clear this list and add the given value to it.
39+
*
40+
* @param newItem the value.
41+
* @return the value.
42+
* @throws DOMException NO_MODIFICATION_ALLOWED_ERR if this list is read only.
43+
*/
2244
SVGPoint initialize(SVGPoint newItem) throws DOMException, SVGException;
2345

46+
/**
47+
* Get the specified item from the list.
48+
*
49+
* @param index The index of the item from the list which is to be returned. The
50+
* first item is number 0.
51+
* @return the specified item from the list.
52+
* @throws DOMException INDEX_SIZE_ERR if the index number is greater than or
53+
* equal to numberOfItems.
54+
*/
2455
SVGPoint getItem(int index) throws DOMException;
2556

57+
/**
58+
* Inserts a new item into the list at the specified position.
59+
* <p>
60+
* The first item is number 0. If newItem is already in a list, it is removed
61+
* from its previous list before it is inserted into this list. The inserted
62+
* item is the item itself and not a copy. If the item is already in this list,
63+
* note that the index of the item to insert before is before the removal of the
64+
* item.
65+
* </p>
66+
*
67+
* @param newItem The item which is to be inserted into the list.
68+
* @param index The index of the item before which the new item is to be
69+
* inserted. The first item is number 0. If the index is equal to
70+
* 0, then the new item is inserted at the front of the list. If
71+
* the index is greater than or equal to numberOfItems, then the
72+
* new item is appended to the end of the list.
73+
* @return The inserted item.
74+
* @throws DOMException NO_MODIFICATION_ALLOWED_ERR if this list is read only.
75+
*/
2676
SVGPoint insertItemBefore(SVGPoint newItem, int index) throws DOMException, SVGException;
2777

78+
/**
79+
* Replaces an existing item in the list with a new item.
80+
* <p>
81+
* If newItem is already in a list, it is removed from its previous list before
82+
* it is inserted into this list. The inserted item is the item itself and not a
83+
* copy. If the item is already in this list, note that the index of the item to
84+
* replace is before the removal of the item.
85+
* </p>
86+
*
87+
* @param newItem The item which is to be inserted into the list.
88+
* @param index The index of the item which is to be replaced. The first item
89+
* is number 0.
90+
* @return The inserted item.
91+
* @throws DOMException NO_MODIFICATION_ALLOWED_ERR if this list is read only,
92+
* INDEX_SIZE_ERR if the index number is greater than or
93+
* equal to numberOfItems.
94+
*/
2895
SVGPoint replaceItem(SVGPoint newItem, int index) throws DOMException, SVGException;
2996

97+
/**
98+
* Removes an existing item from the list.
99+
*
100+
* @param index The index of the item which is to be removed. The first item is
101+
* number 0.
102+
* @return The removed item.
103+
* @throws DOMException NO_MODIFICATION_ALLOWED_ERR if this list is read only,
104+
* INDEX_SIZE_ERR if the index number is greater than or
105+
* equal to numberOfItems.
106+
*/
30107
SVGPoint removeItem(int index) throws DOMException;
31108

109+
/**
110+
* Inserts a new item at the end of the list.
111+
* <p>
112+
* If newItem is already in a list, it is removed from its previous list before
113+
* it is inserted into this list. The inserted item is the item itself and not a
114+
* copy.
115+
* </p>
116+
*
117+
* @param newItem The item which is to be appended.
118+
* @return the new item.
119+
* @throws DOMException NO_MODIFICATION_ALLOWED_ERR if this list is read only.
120+
*/
32121
SVGPoint appendItem(SVGPoint newItem) throws DOMException, SVGException;
122+
33123
}

svgom-api/src/main/java/org/w3c/dom/svg/SVGPreserveAspectRatio.java

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,100 @@
1414

1515
import org.w3c.dom.DOMException;
1616

17+
/**
18+
* Represents the <code>preserveAspectRatio</code> attribute.
19+
*/
1720
public interface SVGPreserveAspectRatio {
1821
// Alignment Types
22+
23+
/**
24+
* Some other value.
25+
*/
1926
short SVG_PRESERVEASPECTRATIO_UNKNOWN = 0;
27+
28+
/**
29+
* The none keyword.
30+
*/
2031
short SVG_PRESERVEASPECTRATIO_NONE = 1;
32+
33+
/**
34+
* The xMinYMin keyword.
35+
*/
2136
short SVG_PRESERVEASPECTRATIO_XMINYMIN = 2;
37+
38+
/**
39+
* The xMidYMin keyword.
40+
*/
2241
short SVG_PRESERVEASPECTRATIO_XMIDYMIN = 3;
42+
43+
/**
44+
* The xMaxYMin keyword.
45+
*/
2346
short SVG_PRESERVEASPECTRATIO_XMAXYMIN = 4;
47+
48+
/**
49+
* The xMinYMid keyword.
50+
*/
2451
short SVG_PRESERVEASPECTRATIO_XMINYMID = 5;
52+
53+
/**
54+
* The xMidYMid keyword.
55+
*/
2556
short SVG_PRESERVEASPECTRATIO_XMIDYMID = 6;
57+
58+
/**
59+
* The xMaxYMid keyword.
60+
*/
2661
short SVG_PRESERVEASPECTRATIO_XMAXYMID = 7;
62+
63+
/**
64+
* The xMinYMax keyword.
65+
*/
2766
short SVG_PRESERVEASPECTRATIO_XMINYMAX = 8;
67+
68+
/**
69+
* The xMidYMax keyword.
70+
*/
2871
short SVG_PRESERVEASPECTRATIO_XMIDYMAX = 9;
72+
73+
/**
74+
* The xMaxYMax keyword.
75+
*/
2976
short SVG_PRESERVEASPECTRATIO_XMAXYMAX = 10;
77+
3078
// Meet-or-slice Types
79+
80+
/**
81+
* Some other value.
82+
*/
3183
short SVG_MEETORSLICE_UNKNOWN = 0;
84+
85+
/**
86+
* The meet keyword.
87+
*/
3288
short SVG_MEETORSLICE_MEET = 1;
89+
90+
/**
91+
* The slice keyword.
92+
*/
3393
short SVG_MEETORSLICE_SLICE = 2;
3494

95+
/**
96+
* Get the alignment keyword part of the ‘preserveAspectRatio’ value.
97+
*
98+
* @return the alignment keyword part of the ‘preserveAspectRatio’ value.
99+
*/
35100
short getAlign();
36101

37102
void setAlign(short align) throws DOMException;
38103

104+
/**
105+
* Get the meet-or-slice keyword part of the ‘preserveAspectRatio’ value.
106+
*
107+
* @return the meet-or-slice keyword part of the ‘preserveAspectRatio’ value.
108+
*/
39109
short getMeetOrSlice();
40110

41111
void setMeetOrSlice(short meetOrSlice) throws DOMException;
112+
42113
}

svgom-api/src/main/java/org/w3c/dom/svg/SVGURIReference.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@
1212

1313
package org.w3c.dom.svg;
1414

15+
/**
16+
* Represents the <code>href</code> attribute and the deprecated
17+
* <code>xlink:href</code> attribute.
18+
*/
1519
public interface SVGURIReference {
20+
21+
/**
22+
* Gets the value of the <code>href</code> attribute and, on elements that are
23+
* defined to support it, the deprecated <code>xlink:href</code> attribute.
24+
*
25+
* @return the <code>href</code> attribute if exists, or the deprecated
26+
* <code>xlink:href</code> attribute if exists and the element is
27+
* defined to support it, {@code null} otherwise.
28+
*/
1629
SVGAnimatedString getHref();
30+
1731
}

0 commit comments

Comments
 (0)