public class MapObject extends CustomPropertyProvider implements IMapObject
Constructor and Description |
---|
MapObject()
Instantiates a new
MapObject instance. |
MapObject(MapObject original)
Instantiates a new
MapObject instance by copying the specified original instance. |
MapObject(MapObject original,
boolean keepID)
Instantiates a new
MapObject instance by copying the specified original instance. |
MapObject(MapObject original,
int id)
Instantiates a new
MapObject instance by copying the specified original instance. |
MapObject(java.lang.String type)
Instantiates a new
MapObject instance. |
Modifier and Type | Method and Description |
---|---|
java.awt.geom.Rectangle2D |
getBoundingBox()
Gets the hit box.
|
static java.awt.geom.Rectangle2D |
getBounds(IMapObject... objects) |
static java.awt.geom.Rectangle2D |
getBounds(java.lang.Iterable<IMapObject> objects) |
java.awt.geom.Ellipse2D |
getEllipse() |
int |
getGridId()
Gets the grid id.
|
float |
getHeight() |
int |
getId()
Gets the id.
|
IMapObjectLayer |
getLayer() |
java.awt.geom.Point2D |
getLocation()
Gets the location.
|
java.lang.String |
getName()
Gets the name.
|
IPolyShape |
getPolygon() |
IPolyShape |
getPolyline() |
IMapObjectText |
getText() |
ITilesetEntry |
getTile() |
java.lang.String |
getType()
Gets the type.
|
float |
getWidth() |
float |
getX() |
float |
getY() |
boolean |
isEllipse() |
boolean |
isPoint() |
boolean |
isPolygon() |
boolean |
isPolyline() |
void |
setGridId(int gid) |
void |
setHeight(float height) |
void |
setId(int id) |
protected void |
setLayer(MapObjectLayer layer) |
void |
setLocation(float x,
float y) |
void |
setLocation(java.awt.geom.Point2D location) |
void |
setName(java.lang.String name) |
void |
setPolyline(PolyShape polyline) |
void |
setType(java.lang.String type) |
void |
setWidth(float width) |
void |
setX(float x) |
void |
setY(float y) |
java.lang.String |
toString() |
getBoolValue, getBoolValue, getByteValue, getByteValue, getColorValue, getColorValue, getDoubleValue, getDoubleValue, getEnumValue, getEnumValue, getFileValue, getFileValue, getFloatValue, getFloatValue, getIntValue, getIntValue, getLongValue, getProperties, getProperty, getShortValue, getShortValue, getStringValue, getStringValue, getTypeOfProperty, hasCustomProperty, removeProperty, setProperties, setTypeOfProperty, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getBoolValue, getBoolValue, getByteValue, getByteValue, getColorValue, getColorValue, getDoubleValue, getDoubleValue, getEnumValue, getEnumValue, getFileValue, getFileValue, getFloatValue, getFloatValue, getIntValue, getIntValue, getLongValue, getLongValue, getProperties, getProperty, getShortValue, getShortValue, getStringValue, getStringValue, getTypeOfProperty, hasCustomProperty, removeProperty, setProperties, setTypeOfProperty, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue
public MapObject()
MapObject
instance.public MapObject(java.lang.String type)
MapObject
instance.type
- The type of this map object.public MapObject(MapObject original)
MapObject
instance by copying the specified original instance.
This variant of the constructor will assign an entirely new ID to the newly created MapObject.
original
- the MapObject we want to copypublic MapObject(MapObject original, boolean keepID)
MapObject
instance by copying the specified original instance.
This variant of the constructor lets you decide if the copy instance will get the same ID as the old MapObject or get a new ID.
original
- the MapObject we want to copykeepID
- decide if the new instance will adopt the old MapObject's ID or get a new, unique one.public MapObject(MapObject original, int id)
MapObject
instance by copying the specified original instance.original
- the MapObject we want to copyid
- The id of this instance.public static java.awt.geom.Rectangle2D getBounds(IMapObject... objects)
public static java.awt.geom.Rectangle2D getBounds(java.lang.Iterable<IMapObject> objects)
public int getGridId()
IMapObject
getGridId
in interface IMapObject
public ITilesetEntry getTile()
getTile
in interface IMapObject
public java.awt.geom.Rectangle2D getBoundingBox()
IMapObject
getBoundingBox
in interface IMapObject
public int getId()
IMapObject
getId
in interface IMapObject
public java.awt.geom.Point2D getLocation()
IMapObject
getLocation
in interface IMapObject
public java.lang.String getName()
Resource
public java.lang.String getType()
getType
in interface IMapObject
public IPolyShape getPolyline()
getPolyline
in interface IMapObject
public IPolyShape getPolygon()
getPolygon
in interface IMapObject
public java.awt.geom.Ellipse2D getEllipse()
getEllipse
in interface IMapObject
public IMapObjectText getText()
getText
in interface IMapObject
public void setGridId(int gid)
setGridId
in interface IMapObject
public void setHeight(float height)
setHeight
in interface IMapObject
public void setId(int id)
setId
in interface IMapObject
public void setType(java.lang.String type)
setType
in interface IMapObject
public void setWidth(float width)
setWidth
in interface IMapObject
public void setX(float x)
setX
in interface IMapObject
public void setY(float y)
setY
in interface IMapObject
public void setLocation(java.awt.geom.Point2D location)
setLocation
in interface IMapObject
public void setLocation(float x, float y)
setLocation
in interface IMapObject
public java.lang.String toString()
toString
in class java.lang.Object
public float getX()
getX
in interface IMapObject
public float getY()
getY
in interface IMapObject
public void setPolyline(PolyShape polyline)
public float getWidth()
getWidth
in interface IMapObject
public float getHeight()
getHeight
in interface IMapObject
public IMapObjectLayer getLayer()
getLayer
in interface IMapObject
public boolean isPolyline()
isPolyline
in interface IMapObject
public boolean isPolygon()
isPolygon
in interface IMapObject
public boolean isPoint()
isPoint
in interface IMapObject
public boolean isEllipse()
isEllipse
in interface IMapObject
protected void setLayer(MapObjectLayer layer)