org.deken.game.map.renderer
Class MouseScrollTileMapRenderer

java.lang.Object
  extended by org.deken.game.map.renderer.BaseMapRenderer
      extended by org.deken.game.map.renderer.TileMapRenderer
          extended by org.deken.game.map.renderer.ScrollTileMapRenderer
              extended by org.deken.game.map.renderer.MouseScrollTileMapRenderer
All Implemented Interfaces:
InputListener, InputMouseListener, MapRenderer

public class MouseScrollTileMapRenderer
extends ScrollTileMapRenderer
implements InputMouseListener, InputListener

Title: MouseScrollTileMapRenderer

Description: TileMapRenderer where the scrolling of the map is based on the Mouse. Scrolling can be on the mouse clicking and dragging movement.

Copyright: Copyright (c) Nov 9, 2013

Version:
1.0
Author:
Gary Deken

Nested Class Summary
static class MouseScrollTileMapRenderer.SCROLL_TYPE
           
 
Field Summary
 
Fields inherited from class org.deken.game.map.renderer.ScrollTileMapRenderer
mapHeight, mapWidth
 
Fields inherited from class org.deken.game.map.renderer.BaseMapRenderer
map, mapSize, screenHeight, screenWidth
 
Constructor Summary
MouseScrollTileMapRenderer(GameMap map, MouseScrollTileMapRenderer.SCROLL_TYPE scrollType)
           
MouseScrollTileMapRenderer(GameMap map, MouseScrollTileMapRenderer.SCROLL_TYPE scrollType, boolean scrollBackGround)
          The background does not scroll by default.
MouseScrollTileMapRenderer(int mapWidth, int mapHeight, GameMap map, MouseScrollTileMapRenderer.SCROLL_TYPE scrollType)
           
MouseScrollTileMapRenderer(int mapWidth, int mapHeight, GameMap map, MouseScrollTileMapRenderer.SCROLL_TYPE scrollType, boolean scrollBackGround)
          The background does not scroll by default.
 
Method Summary
 void addInputAction(InputAction inputAction)
          add an InputAction for monitoring.
 void draw(java.awt.Graphics2D graphics)
          Draws the TileMap.
 int[] getInputActionIds()
          Gets the Key IDs.
 int getScrollXOffset()
           
 int getScrollYOffset()
           
 void notifyListener(InputAction inputAction)
          This method is called when any event occurs.
 void notifyListener(InputMouseAction ima)
          notifyListener
 
Methods inherited from class org.deken.game.map.renderer.ScrollTileMapRenderer
getEdgeBottom, getEdgeLeft, getEdgeRight, getEdgeTop, setScreenSize
 
Methods inherited from class org.deken.game.map.renderer.BaseMapRenderer
getScreenHeight, getScreenWidth, renderBackground, renderGameComponents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MouseScrollTileMapRenderer

public MouseScrollTileMapRenderer(GameMap map,
                                  MouseScrollTileMapRenderer.SCROLL_TYPE scrollType)

MouseScrollTileMapRenderer

public MouseScrollTileMapRenderer(int mapWidth,
                                  int mapHeight,
                                  GameMap map,
                                  MouseScrollTileMapRenderer.SCROLL_TYPE scrollType)

MouseScrollTileMapRenderer

public MouseScrollTileMapRenderer(GameMap map,
                                  MouseScrollTileMapRenderer.SCROLL_TYPE scrollType,
                                  boolean scrollBackGround)
The background does not scroll by default.

Parameters:
map -
scrollType -
scrollBackGround -

MouseScrollTileMapRenderer

public MouseScrollTileMapRenderer(int mapWidth,
                                  int mapHeight,
                                  GameMap map,
                                  MouseScrollTileMapRenderer.SCROLL_TYPE scrollType,
                                  boolean scrollBackGround)
The background does not scroll by default.

Parameters:
mapWidth -
mapHeight -
map -
scrollType -
scrollBackGround -
Method Detail

addInputAction

public void addInputAction(InputAction inputAction)
Description copied from interface: InputListener
add an InputAction for monitoring.

Specified by:
addInputAction in interface InputListener

draw

public void draw(java.awt.Graphics2D graphics)
Draws the TileMap.

Specified by:
draw in interface MapRenderer
Overrides:
draw in class ScrollTileMapRenderer
Parameters:
graphics -

getInputActionIds

public int[] getInputActionIds()
Description copied from interface: InputListener
Gets the Key IDs. This is mainly used for wiring the object into the current GameMap Actions.

Specified by:
getInputActionIds in interface InputListener
Returns:
Array of InputActionIDs

getScrollXOffset

public int getScrollXOffset()

getScrollYOffset

public int getScrollYOffset()

notifyListener

public void notifyListener(InputAction inputAction)
Description copied from interface: InputListener
This method is called when any event occurs.

Specified by:
notifyListener in interface InputListener
Parameters:
inputAction - InputAction

notifyListener

public void notifyListener(InputMouseAction ima)
Description copied from interface: InputMouseListener
notifyListener

This method is called when any Mouse Motion event occurs.

Specified by:
notifyListener in interface InputMouseListener
Parameters:
ima - InputMouseAction