edu.gatech.cs2335.lemmings.graphics
Class Renderer

java.lang.Object
  extended byedu.gatech.cs2335.lemmings.graphics.Renderer

public final class Renderer
extends java.lang.Object

The Lemmings Renderer Takes care of drawing stuff to screen


Field Summary
static boolean DEBUG
          Display a lot of debug information?
static boolean VERBOSE
          Display debug information?
 
Constructor Summary
Renderer(Level l, java.awt.Rectangle disp)
          Creates a new Renderer instance.
 
Method Summary
 void calculateWaterLevel()
          Once the level has been set, calculates how water needs to be drawn.
 java.awt.Rectangle getDisplay()
          Get the value of display.
 Level getLevel()
          Get the value of level.
 java.awt.Dimension getMapSize()
          Get the value of mapSize.
 java.awt.Rectangle getMapViewPort()
          accessor for renderer
 java.awt.Point getMouseCoordinates()
          Describe getMouseCoordinates method here.
 java.awt.Point getScrollRate()
          Describe getScrollRate method here.
 Lemming getSelectedLemming()
          Describe getSelectedLemming method here.
 int getZoomFactor()
          Get the value of zoomFactor.
static void main(java.lang.String[] args)
           
 java.awt.Point mouseToWorld(java.awt.Point c)
          Converts mouse coordinates to world coordinates.
 void rerenderTerrain()
          Rerenders the terrain.
 void scroll(java.awt.Point offset)
          Scroll the map by offset in the x-y directions.
 void setDisplay(java.awt.Rectangle v)
          Set the value of display.
 void setLevel(Level v)
          Set the value of level.
protected  void setMapSize(java.awt.Dimension v)
          Set the value of mapSize.
 void setMouseCoordinates(java.awt.Point coord)
          Describe setMouseCoordinates method here.
 void setZoomFactor(int v)
          Set the value of zoomFactor.
 java.lang.String toString()
          Returns a string representation of the renderer.
 void updateCursor()
          Updates the cursor.
 boolean updateFrame(java.awt.Graphics target)
          Update a given Graphics Frame
 java.awt.Point worldToMouse(java.awt.Point c)
          Converts world coordinates to mouse coordinates.
 void zoomIn()
          Zooms in.
 void zoomOut()
          Zooms out.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VERBOSE

public static final boolean VERBOSE
Display debug information?

See Also:
Constant Field Values

DEBUG

public static final boolean DEBUG
Display a lot of debug information?

See Also:
Constant Field Values
Constructor Detail

Renderer

public Renderer(Level l,
                java.awt.Rectangle disp)
Creates a new Renderer instance.

Parameters:
l - The level that we will be rendering.
disp - The display bounds.
Method Detail

updateCursor

public void updateCursor()
Updates the cursor.


getMapViewPort

public java.awt.Rectangle getMapViewPort()
accessor for renderer

Returns:
Rectangle

getLevel

public Level getLevel()
Get the value of level.

Returns:
value of level.

setLevel

public void setLevel(Level v)
Set the value of level.

Parameters:
v - Value to assign to level.

getDisplay

public java.awt.Rectangle getDisplay()
Get the value of display.

Returns:
value of display.

setDisplay

public void setDisplay(java.awt.Rectangle v)
Set the value of display.

Parameters:
v - Value to assign to display.

getMapSize

public java.awt.Dimension getMapSize()
Get the value of mapSize.

Returns:
value of mapSize.

setMapSize

protected void setMapSize(java.awt.Dimension v)
Set the value of mapSize.

Parameters:
v - Value to assign to mapSize.

getZoomFactor

public int getZoomFactor()
Get the value of zoomFactor.

Returns:
value of zoomFactor.

setZoomFactor

public void setZoomFactor(int v)
Set the value of zoomFactor.

Parameters:
v - Value to assign to zoomFactor.

zoomIn

public void zoomIn()
Zooms in.


zoomOut

public void zoomOut()
Zooms out.


scroll

public void scroll(java.awt.Point offset)
Scroll the map by offset in the x-y directions.

Parameters:
offset - the amount to offset

getScrollRate

public java.awt.Point getScrollRate()
Describe getScrollRate method here.

Returns:
a Point value

getMouseCoordinates

public java.awt.Point getMouseCoordinates()
Describe getMouseCoordinates method here.

Returns:
a Point value

setMouseCoordinates

public void setMouseCoordinates(java.awt.Point coord)
Describe setMouseCoordinates method here.

Parameters:
coord - a Point value

mouseToWorld

public java.awt.Point mouseToWorld(java.awt.Point c)
Converts mouse coordinates to world coordinates.

Parameters:
c - a Point value
Returns:
a Point value

worldToMouse

public java.awt.Point worldToMouse(java.awt.Point c)
Converts world coordinates to mouse coordinates.

Parameters:
c - a Point value
Returns:
a Point value

updateFrame

public boolean updateFrame(java.awt.Graphics target)
Update a given Graphics Frame

Parameters:
target - the frame to update
Returns:
success

calculateWaterLevel

public void calculateWaterLevel()
Once the level has been set, calculates how water needs to be drawn.


getSelectedLemming

public Lemming getSelectedLemming()
Describe getSelectedLemming method here.

Returns:
a Lemming value

rerenderTerrain

public void rerenderTerrain()
Rerenders the terrain.


toString

public java.lang.String toString()
Returns a string representation of the renderer.

Returns:
a String value

main

public static void main(java.lang.String[] args)
Parameters:
args - args