de.steeringbehaviors.simulation.renderer
Class Tile

java.lang.Object
  extended by de.steeringbehaviors.simulation.renderer.RenderInfo
      extended by de.steeringbehaviors.simulation.renderer.Tile
All Implemented Interfaces:
java.lang.Comparable

public class Tile
extends RenderInfo


Field Summary
protected  int m_height
           
protected  java.awt.Image m_texture
           
protected  int m_width
           
protected  int m_zoomedHeight
          Height used for drawing on the screen
protected  int m_zoomedWidth
          Width used for drawing on the screen
 
Fields inherited from class de.steeringbehaviors.simulation.renderer.RenderInfo
CIRCLE, INFOBOX, m_color, m_parent, m_pos, m_scaleX, m_scaleY, m_type, m_z, POLYGONSHAPE, RENDERINFO, TILE, VECTORSHAPE
 
Constructor Summary
Tile(java.awt.Image texture)
           
Tile(java.awt.Image texture, int width, int height)
           
 
Method Summary
 double getFarthestDistance()
          Returns the distance of the point on the shape that is farthest away from the center of the geometrie.
 int getHeight()
           
 java.awt.Image getImage()
           
 int getWidth()
           
 boolean isInside(double x, double y)
          Tests if the point is inside the shape
 void setHeight(int height)
           
 void setWidth(int width)
           
 void setZoomedHeight(int zoomedHeight)
           
 void setZoomedWidth(int zoomedWidth)
           
 
Methods inherited from class de.steeringbehaviors.simulation.renderer.RenderInfo
compareTo, getColor, getParent, getPos, getScaleX, getScaleY, getType, getZ, moveCenter, setColor, setParent, setPos, setScaleX, setScaleY, setZ
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_texture

protected java.awt.Image m_texture

m_width

protected int m_width

m_height

protected int m_height

m_zoomedWidth

protected int m_zoomedWidth
Width used for drawing on the screen


m_zoomedHeight

protected int m_zoomedHeight
Height used for drawing on the screen

Constructor Detail

Tile

public Tile(java.awt.Image texture)

Tile

public Tile(java.awt.Image texture,
            int width,
            int height)
Method Detail

setZoomedWidth

public void setZoomedWidth(int zoomedWidth)

setZoomedHeight

public void setZoomedHeight(int zoomedHeight)

setWidth

public void setWidth(int width)

setHeight

public void setHeight(int height)

getFarthestDistance

public double getFarthestDistance()
Returns the distance of the point on the shape that is farthest away from the center of the geometrie.

Overrides:
getFarthestDistance in class RenderInfo
Returns:
The farthest distance from the center of the geometrie

getImage

public java.awt.Image getImage()
Returns:

getWidth

public int getWidth()
Returns:
The width of the image

getHeight

public int getHeight()
Returns:
The height of the image

isInside

public boolean isInside(double x,
                        double y)
Tests if the point is inside the shape

Overrides:
isInside in class RenderInfo
Parameters:
x - The x position in screen coordinates
y - The y position in screen coordinates
Returns:
True if the point is inside, False if not