| •1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
package com.github.weisj.jsvg.nodes; |
| 23 |
|
| 24 |
import org.jetbrains.annotations.NotNull; |
| 25 |
|
| 26 |
import com.github.weisj.jsvg.attributes.Animatable; |
| 27 |
import com.github.weisj.jsvg.attributes.Inherited; |
| 28 |
import com.github.weisj.jsvg.attributes.value.PercentageDimension; |
| 29 |
import com.github.weisj.jsvg.geometry.SVGCircle; |
| 30 |
import com.github.weisj.jsvg.geometry.SVGShape; |
| 31 |
import com.github.weisj.jsvg.geometry.size.Length; |
| 32 |
import com.github.weisj.jsvg.nodes.prototype.spec.Category; |
| 33 |
import com.github.weisj.jsvg.nodes.prototype.spec.ElementCategories; |
| 34 |
import com.github.weisj.jsvg.nodes.prototype.spec.PermittedContent; |
| 35 |
import com.github.weisj.jsvg.parser.impl.AttributeNode; |
| 36 |
|
| 37 |
@ElementCategories({Category.BasicShape, Category.Graphic, Category.Shape}) |
| 38 |
@PermittedContent(categories = {Category.Animation, Category.Descriptive}) |
| 39 |
public final class Circle extends ShapeNode { |
| 40 |
public static final String TAG = "circle"; |
| 41 |
|
| 42 |
@Override |
| 43 |
public @NotNull String tagName() { |
| 44 |
return TAG; |
| 45 |
} |
| 46 |
|
| 47 |
@Override |
| 48 |
protected @NotNull SVGShape buildShape(@NotNull AttributeNode attributeNode) { |
| 49 |
return new SVGCircle( |
| 50 |
attributeNode.getLength("cx", PercentageDimension.WIDTH, Length.ZERO, |
| 51 |
Inherited.NO, Animatable.YES), |
| 52 |
attributeNode.getLength("cy", PercentageDimension.HEIGHT, Length.ZERO, |
| 53 |
Inherited.NO, Animatable.YES), |
| 54 |
attributeNode.getLength("r", PercentageDimension.LENGTH, Length.ZERO, |
| 55 |
Inherited.NO, Animatable.YES)); |
| 56 |
} |
| 57 |
} |