edu.gatech.cs2335.lemmings.gui
Class GamePlayPanel

java.lang.Object
  extended byedu.gatech.cs2335.lemmings.gui.LComponent
      extended byedu.gatech.cs2335.lemmings.gui.LLeafComponent
          extended byedu.gatech.cs2335.lemmings.gui.GamePlayPanel
All Implemented Interfaces:
IClickable, IMouseMotionable, IMouseWheelable

public class GamePlayPanel
extends LLeafComponent
implements IMouseMotionable, IMouseWheelable, IClickable

Class GamePlayPanel: This class will display the game itself.

 Revision History:
     v1.0 (Mar. 28, 2004) - Created the GamePlayPanel class
 

Version:
Version 1.0, Mar. 28, 2004
Author:
Vladimir Urazov

Field Summary
static int SCROLL_OFFSET
          If the cursor is within this many pixels of the edge of the map, we will scroll.
 
Constructor Summary
GamePlayPanel(Renderer r)
          Creates a new GamePlayPanel instance.
 
Method Summary
protected  void copy(LComponent component)
          Deep-copies self into the component passed in.
 Renderer getRenderer()
          Returns a renderer
protected  boolean paint(java.awt.Graphics g)
          Performs all of the necessary drawing for this control only.
 void processMouseMotion(int oldX, int oldY, int newX, int newY)
          Allows the implementing class to be told when the mouse has moved.
 void processMouseWheel(int numClicks)
          Processes the mouse wheel rotation.
 void registerMouseClick(int button, java.awt.Point coord)
          Registers the click of a mouse button at the specified coordinates.
 
Methods inherited from class edu.gatech.cs2335.lemmings.gui.LLeafComponent
makeDirty, move, renderAll
 
Methods inherited from class edu.gatech.cs2335.lemmings.gui.LComponent
bringToTop, cleanUp, getBounds, getParent, initialize, isActive, isComponentDirty, isShown, setBounds, setDirty, setParent, setPosition, setShown, setSize, setSize, updateDimensions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCROLL_OFFSET

public static final int SCROLL_OFFSET
If the cursor is within this many pixels of the edge of the map, we will scroll.

See Also:
Constant Field Values
Constructor Detail

GamePlayPanel

public GamePlayPanel(Renderer r)
Creates a new GamePlayPanel instance.

Parameters:
r - r
Method Detail

getRenderer

public Renderer getRenderer()
Returns a renderer

Returns:
renderer

copy

protected void copy(LComponent component)
Deep-copies self into the component passed in.

Specified by:
copy in class LComponent
Parameters:
component - a LComponent value

paint

protected boolean paint(java.awt.Graphics g)
Performs all of the necessary drawing for this control only. The children will be taken care of separately. This method need not concern itself with them.

Specified by:
paint in class LComponent
Parameters:
g - a Graphics value
Returns:
a boolean value

processMouseMotion

public void processMouseMotion(int oldX,
                               int oldY,
                               int newX,
                               int newY)
Allows the implementing class to be told when the mouse has moved.

Specified by:
processMouseMotion in interface IMouseMotionable
Parameters:
oldX - an int value
oldY - an int value
newX - an int value
newY - an int value

registerMouseClick

public void registerMouseClick(int button,
                               java.awt.Point coord)
Registers the click of a mouse button at the specified coordinates.

Specified by:
registerMouseClick in interface IClickable
Parameters:
button - an int value
coord - a Point value

processMouseWheel

public void processMouseWheel(int numClicks)
Processes the mouse wheel rotation.

Specified by:
processMouseWheel in interface IMouseWheelable
Parameters:
numClicks - The number of clicks the wheel was rotated. A negative value means the wheel was rotated away from the user, and positive means it was rotated towards the user.