fr.umlv.lawrence
Class GridPane<E>

java.lang.Object
  extended by fr.umlv.lawrence.GridPane<E>
Type Parameters:
E - type of elements.

public class GridPane<E>
extends Object

View of a GridModel whose values are represented by images given by an ImageProvider

Author:
Julien Cervelle

Constructor Summary
GridPane(GridModel<? extends E> model, ImageProvider<E> imageProvider, int tileWidth, int tileHeight)
          Construct an object that control the graphical view of a GridModel.
 
Method Summary
 void addCursorListener(CursorListener listener)
          Register a CursorListener to be notified of user action
 void addInputListener(InputListener listener)
          Register a InputListener to be notified of user action
 void displayMessage(String message)
          Display a message and wait until the user validate the message box.
 CursorListener[] getCursorListeners()
          Returns all registered cursor listeners.
 InputListener[] getInputListeners()
          Returns all registered input listeners.
 Location pointerPosition()
           
 void removeCursorListener(CursorListener listener)
          Remove a InputListener from notification
 void removeInputListener(InputListener listener)
          Remove a InputListener from notification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridPane

public GridPane(GridModel<? extends E> model,
                ImageProvider<E> imageProvider,
                int tileWidth,
                int tileHeight)
Construct an object that control the graphical view of a GridModel.

Parameters:
model - the model to represent
imageProvider - an object that is able to provide an image for each element of the model.
tileWidth - the width for the tile representing a element
tileHeight - the width for the tile representing a element
Method Detail

addInputListener

public void addInputListener(InputListener listener)
Register a InputListener to be notified of user action

Parameters:
listener - the InputListener to register

removeInputListener

public void removeInputListener(InputListener listener)
Remove a InputListener from notification

Parameters:
listener - the InputListener to remove

getInputListeners

public InputListener[] getInputListeners()
Returns all registered input listeners.

Returns:
all registered input listeners.

addCursorListener

public void addCursorListener(CursorListener listener)
Register a CursorListener to be notified of user action

Parameters:
listener - the InputListener to register

removeCursorListener

public void removeCursorListener(CursorListener listener)
Remove a InputListener from notification

Parameters:
listener - the InputListener to remove

getCursorListeners

public CursorListener[] getCursorListeners()
Returns all registered cursor listeners.

Returns:
all registered cursor listeners.

pointerPosition

public Location pointerPosition()

displayMessage

public void displayMessage(String message)
Display a message and wait until the user validate the message box.

Parameters:
message - the message to display