jfreerails.client.view
Class FreerailsCursor

java.lang.Object
  extended by jfreerails.client.view.FreerailsCursor

public final class FreerailsCursor
extends java.lang.Object

Paints the cursor on the map, note the cursor's position is stored on the ModelRoot under the key CURSOR_POSITION.

Author:
Luke

Field Summary
private  java.awt.Image buildTrack
           
private  java.awt.Image infoMode
           
private  ImPoint lastCursorPosition
          The location of the cursor last time paintCursor(.) was called.
private  ModelRoot modelRoot
           
private  java.awt.Image removeTrack
           
private  long timeArrived
          The time in ms the cursor arrived at its current position.
private  java.awt.Image upgradeTrack
           
 
Constructor Summary
FreerailsCursor(ModelRoot mr, RenderersRoot rr)
          Creates a new FreerailsCursor.
 
Method Summary
 void paintCursor(java.awt.Graphics g, java.awt.Dimension tileSize)
          Paints the cursor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buildTrack

private final java.awt.Image buildTrack

upgradeTrack

private final java.awt.Image upgradeTrack

removeTrack

private final java.awt.Image removeTrack

infoMode

private final java.awt.Image infoMode

modelRoot

private final ModelRoot modelRoot

lastCursorPosition

private ImPoint lastCursorPosition
The location of the cursor last time paintCursor(.) was called.


timeArrived

private long timeArrived
The time in ms the cursor arrived at its current position.

Constructor Detail

FreerailsCursor

public FreerailsCursor(ModelRoot mr,
                       RenderersRoot rr)
                throws java.io.IOException
Creates a new FreerailsCursor.

Throws:
java.io.IOException
Method Detail

paintCursor

public void paintCursor(java.awt.Graphics g,
                        java.awt.Dimension tileSize)
Paints the cursor. The method calculates position to paint it based on the tile size and the cursor's map position.

Parameters:
g - The graphics object to paint the cursor on.
tileSize - The dimensions of a tile.