More view JavaDoc

git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@63 72836036-5685-4462-b002-a69064685172
This commit is contained in:
Matthias Schiffer 2011-05-02 04:19:39 +02:00
parent e39dc98249
commit 91b921248f
7 changed files with 35 additions and 3 deletions

View file

@ -2,20 +2,34 @@ package jrummikub.util;
/** /**
* A pair of objects * A pair of objects
* @param <T1> the first type of the pair
* @param <T2> the second type of the pair
*/ */
public class Pair<T1, T2> { public class Pair<T1, T2> {
final T1 first; private final T1 first;
final T2 second; private final T2 second;
/**
* Create a new pair
*
* @param first the first value
* @param second the second value
*/
public Pair(T1 first, T2 second) { public Pair(T1 first, T2 second) {
this.first = first; this.first = first;
this.second = second; this.second = second;
} }
/**
* @return the first value
*/
public T1 getFirst() { public T1 getFirst() {
return first; return first;
} }
/**
* @return the first value
*/
public T2 getSecond() { public T2 getSecond() {
return second; return second;
} }

View file

@ -5,6 +5,9 @@ import java.util.Map;
import jrummikub.model.Position; import jrummikub.model.Position;
import jrummikub.model.Stone; import jrummikub.model.Stone;
/**
* The view for a player's board that displayed his stones
*/
public interface IBoard extends IClickable { public interface IBoard extends IClickable {
/** /**
* Set the player's stones to display on the board * Set the player's stones to display on the board

View file

@ -3,6 +3,9 @@ package jrummikub.view;
import jrummikub.model.Position; import jrummikub.model.Position;
import jrummikub.util.IEvent2; import jrummikub.util.IEvent2;
/**
* An interface for view elements that can emit click events
*/
public interface IClickable { public interface IClickable {
/** /**
* the click event is emitted when the player clicks on the table/board/etc. * the click event is emitted when the player clicks on the table/board/etc.

View file

@ -2,9 +2,12 @@ package jrummikub.view;
import jrummikub.util.IEvent; import jrummikub.util.IEvent;
/**
* The player panel that contains a player's board and other user interfaces
*/
public interface IPlayerPanel { public interface IPlayerPanel {
/** /**
* @return * @return the board where the players hand stones are displayed
*/ */
public IBoard getBoard(); public IBoard getBoard();

View file

@ -1,4 +1,7 @@
package jrummikub.view; package jrummikub.view;
/**
* The view of the collection that shows the stones a player has selected
*/
public interface IStoneCollection extends IClickable { public interface IStoneCollection extends IClickable {
} }

View file

@ -5,6 +5,9 @@ import java.util.Map;
import jrummikub.model.Position; import jrummikub.model.Position;
import jrummikub.model.StoneSet; import jrummikub.model.StoneSet;
/**
* The view of the table, where the stone sets lie
*/
public interface ITable extends IClickable { public interface ITable extends IClickable {
/** /**
* Sets the player name on the left label * Sets the player name on the left label

View file

@ -4,6 +4,9 @@ import java.util.Collection;
import jrummikub.model.Stone; import jrummikub.model.Stone;
/**
* The top-level view interface
*/
public interface IView { public interface IView {
/** /**
* Returns the table * Returns the table