public class MapObject extends CustomPropertyProvider implements IMapObject
| Constructor and Description |
|---|
MapObject() |
MapObject(MapObject mapObjectToBeCopied)
Copy Constructor for copying instances of MapObjects.
|
MapObject(MapObject mapObjectToBeCopied,
boolean keepID)
Copy Constructor for copying instances of MapObjects.
|
MapObject(MapObject mapObjectToBeCopied,
int id) |
MapObject(java.lang.String type) |
| 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, setValueclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetBoolValue, 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, setValuepublic MapObject()
public MapObject(java.lang.String type)
public MapObject(MapObject mapObjectToBeCopied)
mapObjectToBeCopied - the MapObject we want to copypublic MapObject(MapObject mapObjectToBeCopied, boolean keepID)
mapObjectToBeCopied - 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 mapObjectToBeCopied, int id)
public static java.awt.geom.Rectangle2D getBounds(IMapObject... objects)
public static java.awt.geom.Rectangle2D getBounds(java.lang.Iterable<IMapObject> objects)
public int getGridId()
IMapObjectgetGridId in interface IMapObjectpublic ITilesetEntry getTile()
getTile in interface IMapObjectpublic java.awt.geom.Rectangle2D getBoundingBox()
IMapObjectgetBoundingBox in interface IMapObjectpublic int getId()
IMapObjectgetId in interface IMapObjectpublic java.awt.geom.Point2D getLocation()
IMapObjectgetLocation in interface IMapObjectpublic java.lang.String getName()
Resourcepublic java.lang.String getType()
getType in interface IMapObjectpublic IPolyShape getPolyline()
getPolyline in interface IMapObjectpublic IPolyShape getPolygon()
getPolygon in interface IMapObjectpublic java.awt.geom.Ellipse2D getEllipse()
getEllipse in interface IMapObjectpublic IMapObjectText getText()
getText in interface IMapObjectpublic void setGridId(int gid)
setGridId in interface IMapObjectpublic void setHeight(float height)
setHeight in interface IMapObjectpublic void setId(int id)
setId in interface IMapObjectpublic void setType(java.lang.String type)
setType in interface IMapObjectpublic void setWidth(float width)
setWidth in interface IMapObjectpublic void setX(float x)
setX in interface IMapObjectpublic void setY(float y)
setY in interface IMapObjectpublic void setLocation(java.awt.geom.Point2D location)
setLocation in interface IMapObjectpublic void setLocation(float x,
float y)
setLocation in interface IMapObjectpublic java.lang.String toString()
toString in class java.lang.Objectpublic float getX()
getX in interface IMapObjectpublic float getY()
getY in interface IMapObjectpublic void setPolyline(PolyShape polyline)
public float getWidth()
getWidth in interface IMapObjectpublic float getHeight()
getHeight in interface IMapObjectpublic IMapObjectLayer getLayer()
getLayer in interface IMapObjectpublic boolean isPolyline()
isPolyline in interface IMapObjectpublic boolean isPolygon()
isPolygon in interface IMapObjectpublic boolean isPoint()
isPoint in interface IMapObjectpublic boolean isEllipse()
isEllipse in interface IMapObjectprotected void setLayer(MapObjectLayer layer)