fr.umlv.remix
Class Arena<I>

java.lang.Object
  extended by fr.umlv.remix.Arena<I>
Type Parameters:
I - type of elements to be handle

public class Arena<I>
extends java.lang.Object

An Arena is a simplified way of handling graphical elements for Java project at the University Paris-East. The Arena handle the rendering of a collection of items of type I which should be provided with an ItemManager. The Arena reacts to mouse events by calling MouseHandler methods with some useful parameters such as a List of items of type I which are in the range of the mouse action.


Method Summary
 javax.swing.JComponent createComponent(int width, int height, MouseHandler<I> mouseHandler, KeyHandler keyHandler)
          Method which create the graphical component to add to a JFrame in order to render the application.
 void refresh()
          Cleans the Arena and redraws all the items of the Collection in the order of iteration of this last
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

refresh

public void refresh()
Cleans the Arena and redraws all the items of the Collection in the order of iteration of this last


createComponent

public javax.swing.JComponent createComponent(int width,
                                              int height,
                                              MouseHandler<I> mouseHandler,
                                              KeyHandler keyHandler)
Method which create the graphical component to add to a JFrame in order to render the application.

Parameters:
width - width in pixels of the interface
height - height in pixels of the interface
mouseHandler - the MouseHandler which will be called by the Arena in case of mouse events such as mouse click, drag & drop or mouse wheel move
Returns:
a JComponent to add to a JFrame