mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-10 05:41:51 +09:00
Former-commit-id: 1647fa32ef6894bd7db44f741f07c2f4dcdf9054 Former-commit-id: 0e5810dcfbe1fd59b13e7cabe9f1e93c5542da2d
85 lines
1.8 KiB
Java
85 lines
1.8 KiB
Java
package org.newdawn.slick.svg;
|
|
|
|
import org.newdawn.slick.geom.Shape;
|
|
import org.newdawn.slick.geom.Transform;
|
|
|
|
/**
|
|
* A figure that is part of diagram loaded from SVG
|
|
*
|
|
* @author kevin
|
|
*/
|
|
public class Figure {
|
|
/** Ellipse Type */
|
|
public static final int ELLIPSE = 1;
|
|
/** Line Type */
|
|
public static final int LINE = 2;
|
|
/** Rectangle Type */
|
|
public static final int RECTANGLE = 3;
|
|
/** Path Type */
|
|
public static final int PATH = 4;
|
|
/** Polygon Type */
|
|
public static final int POLYGON = 5;
|
|
|
|
/** The type of this figure */
|
|
private int type;
|
|
|
|
/** The geometric shape of the figure */
|
|
private Shape shape;
|
|
/** The other bits of data assocaited with the SVG element */
|
|
private NonGeometricData data;
|
|
/** The transform that has already been applied to the shape */
|
|
private Transform transform;
|
|
|
|
/**
|
|
* Create a new figure
|
|
*
|
|
* @param type The type of the figure
|
|
* @param shape The shape of the figure
|
|
* @param data The other associated data
|
|
* @param transform The transform that was applied to the shape
|
|
*/
|
|
public Figure(int type, Shape shape, NonGeometricData data, Transform transform) {
|
|
this.shape = shape;
|
|
this.data = data;
|
|
this.type = type;
|
|
this.transform = transform;
|
|
}
|
|
|
|
/**
|
|
* Get the transform that was applied to the shape given in the SVG
|
|
* to get it to it's currently state
|
|
*
|
|
* @return The transform specified in the SVG
|
|
*/
|
|
public Transform getTransform() {
|
|
return transform;
|
|
}
|
|
|
|
/**
|
|
* Get the type of this figure
|
|
*
|
|
* @return The type of this figure
|
|
*/
|
|
public int getType() {
|
|
return type;
|
|
}
|
|
|
|
/**
|
|
* Get the shape of this figure
|
|
*
|
|
* @return The shape of this figure
|
|
*/
|
|
public Shape getShape() {
|
|
return shape;
|
|
}
|
|
|
|
/**
|
|
* Get the data associated with this figure
|
|
*
|
|
* @return The data associated with this figure
|
|
*/
|
|
public NonGeometricData getData() {
|
|
return data;
|
|
}
|
|
}
|