Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
epoxy
GitHub Repository: epoxy/proj11
Path: blob/master/SLICK_HOME/src/org/newdawn/slick/svg/Figure.java
1463 views
1
package org.newdawn.slick.svg;
2
3
import org.newdawn.slick.geom.Shape;
4
import org.newdawn.slick.geom.Transform;
5
6
/**
7
* A figure that is part of diagram loaded from SVG
8
*
9
* @author kevin
10
*/
11
public class Figure {
12
/** Ellipse Type */
13
public static final int ELLIPSE = 1;
14
/** Line Type */
15
public static final int LINE = 2;
16
/** Rectangle Type */
17
public static final int RECTANGLE = 3;
18
/** Path Type */
19
public static final int PATH = 4;
20
/** Polygon Type */
21
public static final int POLYGON = 5;
22
23
/** The type of this figure */
24
private int type;
25
26
/** The geometric shape of the figure */
27
private Shape shape;
28
/** The other bits of data assocaited with the SVG element */
29
private NonGeometricData data;
30
/** The transform that has already been applied to the shape */
31
private Transform transform;
32
33
/**
34
* Create a new figure
35
*
36
* @param type The type of the figure
37
* @param shape The shape of the figure
38
* @param data The other associated data
39
* @param transform The transform that was applied to the shape
40
*/
41
public Figure(int type, Shape shape, NonGeometricData data, Transform transform) {
42
this.shape = shape;
43
this.data = data;
44
this.type = type;
45
this.transform = transform;
46
}
47
48
/**
49
* Get the transform that was applied to the shape given in the SVG
50
* to get it to it's currently state
51
*
52
* @return The transform specified in the SVG
53
*/
54
public Transform getTransform() {
55
return transform;
56
}
57
58
/**
59
* Get the type of this figure
60
*
61
* @return The type of this figure
62
*/
63
public int getType() {
64
return type;
65
}
66
67
/**
68
* Get the shape of this figure
69
*
70
* @return The shape of this figure
71
*/
72
public Shape getShape() {
73
return shape;
74
}
75
76
/**
77
* Get the data associated with this figure
78
*
79
* @return The data associated with this figure
80
*/
81
public NonGeometricData getData() {
82
return data;
83
}
84
}
85
86