public abstract class MapElementContainer extends java.lang.Object implements java.lang.Comparable<MapElementContainer>
Modifier and Type | Field and Description |
---|---|
protected Rectangle |
boundary |
protected Rectangle |
boundaryAbsolute |
protected Display |
display |
protected int |
priority |
protected Point |
xy |
Modifier | Constructor and Description |
---|---|
protected |
MapElementContainer(Point xy,
Display display,
int priority) |
Modifier and Type | Method and Description |
---|---|
boolean |
clashesWith(MapElementContainer other)
Returns if MapElementContainers clash with each other
|
int |
compareTo(MapElementContainer other)
Compares elements according to their priority.
|
abstract void |
draw(Canvas canvas,
Point origin,
Matrix matrix,
Filter filter)
Drawing method: element will draw itself on canvas shifted by origin point of canvas and
using the matrix if rotation is required.
|
boolean |
equals(java.lang.Object obj) |
protected Rectangle |
getBoundaryAbsolute()
Gets the pixel absolute boundary for this element.
|
Point |
getPoint()
Gets the center point of this element.
|
int |
getPriority() |
int |
hashCode() |
boolean |
intersects(Rectangle rectangle) |
java.lang.String |
toString() |
protected Rectangle boundary
protected Rectangle boundaryAbsolute
protected Display display
protected final int priority
protected final Point xy
public int compareTo(MapElementContainer other)
compareTo
in interface java.lang.Comparable<MapElementContainer>
other
- public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public abstract void draw(Canvas canvas, Point origin, Matrix matrix, Filter filter)
protected Rectangle getBoundaryAbsolute()
public boolean intersects(Rectangle rectangle)
public boolean clashesWith(MapElementContainer other)
other
- element to test againstpublic int hashCode()
hashCode
in class java.lang.Object
public Point getPoint()
public int getPriority()
public java.lang.String toString()
toString
in class java.lang.Object