2011-05-26 01:33:17 +02:00
|
|
|
package jrummikub.view;
|
|
|
|
|
2011-05-27 15:00:28 +02:00
|
|
|
import java.awt.Color;
|
2011-05-31 01:50:56 +02:00
|
|
|
import java.util.Set;
|
2011-05-27 15:00:28 +02:00
|
|
|
|
2011-05-29 22:24:48 +02:00
|
|
|
import jrummikub.control.turn.TurnControlFactory;
|
2011-05-26 01:33:17 +02:00
|
|
|
import jrummikub.model.GameSettings;
|
2011-05-31 01:50:56 +02:00
|
|
|
import jrummikub.model.StoneColor;
|
2011-05-27 15:00:28 +02:00
|
|
|
import jrummikub.util.IEvent;
|
2011-05-26 01:33:17 +02:00
|
|
|
import jrummikub.util.IEvent1;
|
2011-05-27 15:00:28 +02:00
|
|
|
import jrummikub.util.IEvent2;
|
2011-05-26 01:33:17 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The panel for the game setup
|
|
|
|
*/
|
|
|
|
public interface ISettingsPanel {
|
2011-05-28 20:13:35 +02:00
|
|
|
/**
|
|
|
|
* The list of player colors
|
|
|
|
*/
|
|
|
|
public final static Color[] PLAYER_COLORS = { new Color(1.0f, 0, 0), // red
|
|
|
|
new Color(0, 1.0f, 0), // lime
|
|
|
|
new Color(1.0f, 1.0f, 0), // yellow
|
|
|
|
new Color(0, 0, 1.0f), // blue
|
|
|
|
new Color(1.0f, 0, 1.0f), // fuchsia
|
|
|
|
new Color(0, 1.0f, 1.0f), // aqua
|
|
|
|
new Color(0.5f, 0, 0), // maroon
|
|
|
|
new Color(0, 0.5f, 0), // green
|
|
|
|
new Color(0.5f, 0.5f, 0), // olive
|
|
|
|
new Color(0, 0, 0.5f), // navy
|
|
|
|
new Color(0.5f, 0, 0.5f), // purple
|
|
|
|
new Color(0, 0.5f, 0.5f), // teal
|
|
|
|
new Color(0, 0, 0), // black
|
|
|
|
new Color(0.5f, 0.5f, 0.5f), // gray
|
|
|
|
new Color(0.75f, 0.75f, 0.75f), // silver
|
|
|
|
new Color(1.0f, 1.0f, 1.0f), // white
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2011-05-31 15:29:37 +02:00
|
|
|
* The add player event is emitted when the user wants to add a player to
|
|
|
|
* the player list
|
2011-05-28 20:13:35 +02:00
|
|
|
*
|
|
|
|
* @return the event
|
|
|
|
*/
|
2011-05-27 15:00:28 +02:00
|
|
|
public IEvent getAddPlayerEvent();
|
|
|
|
|
2011-05-28 20:13:35 +02:00
|
|
|
/**
|
|
|
|
* The remove player event is emitted when the user wants to remove a player
|
|
|
|
* remove the player list
|
|
|
|
*
|
|
|
|
* @return the event
|
|
|
|
*/
|
2011-05-27 15:00:28 +02:00
|
|
|
public IEvent1<Integer> getRemovePlayerEvent();
|
|
|
|
|
2011-05-28 20:13:35 +02:00
|
|
|
/**
|
|
|
|
* The change player color event is emitted when the user wants change a
|
|
|
|
* player's color
|
|
|
|
*
|
|
|
|
* @return the event
|
|
|
|
*/
|
2011-05-27 15:00:28 +02:00
|
|
|
public IEvent2<Integer, Color> getChangePlayerColorEvent();
|
|
|
|
|
2011-05-28 20:13:35 +02:00
|
|
|
/**
|
|
|
|
* The change player color event is emitted when the user wants change a
|
|
|
|
* player's name
|
|
|
|
*
|
|
|
|
* @return the event
|
|
|
|
*/
|
2011-05-27 15:00:28 +02:00
|
|
|
public IEvent2<Integer, String> getChangePlayerNameEvent();
|
|
|
|
|
2011-05-29 22:24:48 +02:00
|
|
|
/**
|
|
|
|
* The change player color event is emitted when the user wants change a
|
|
|
|
* player's type
|
|
|
|
*
|
|
|
|
* @return the event
|
|
|
|
*/
|
|
|
|
public IEvent2<Integer, TurnControlFactory.Type> getChangePlayerTypeEvent();
|
|
|
|
|
2011-05-28 20:13:35 +02:00
|
|
|
/**
|
|
|
|
* The change initial meld threshold event is emitted when the user wants
|
|
|
|
* change the initial meld threshold
|
|
|
|
*
|
|
|
|
* @return the event
|
|
|
|
*/
|
2011-05-27 15:00:28 +02:00
|
|
|
public IEvent1<Integer> getChangeInitialMeldThresholdEvent();
|
2011-05-31 01:50:56 +02:00
|
|
|
|
2011-05-31 15:29:37 +02:00
|
|
|
/**
|
|
|
|
* The change StoneSet number event is emitted when the user wants to use
|
|
|
|
* more or less than 2 StoneSets per color
|
|
|
|
*
|
|
|
|
* @return number of SoneSets
|
|
|
|
*/
|
2011-05-30 19:50:58 +02:00
|
|
|
public IEvent1<Integer> getChangeStoneSetNumberEvent();
|
2011-05-26 01:33:17 +02:00
|
|
|
|
2011-05-31 15:29:37 +02:00
|
|
|
/**
|
|
|
|
* The change number of Stones dealt event is emitted when the user wants to
|
|
|
|
* be dealt more or less than 14 Stones at the game start
|
|
|
|
*
|
|
|
|
* @return number of Stones dealt
|
|
|
|
*/
|
2011-05-31 01:50:56 +02:00
|
|
|
public IEvent1<Integer> getChangeNumberOfStonesDealtEvent();
|
|
|
|
|
2011-05-31 15:29:37 +02:00
|
|
|
/**
|
|
|
|
* The change highest value event is emitted when the user wants to set the
|
|
|
|
* highest Stone value
|
|
|
|
*
|
|
|
|
* @return highest Stone value
|
|
|
|
*/
|
2011-05-31 01:50:56 +02:00
|
|
|
public IEvent1<Integer> getChangeHighestValueEvent();
|
|
|
|
|
2011-05-31 15:29:37 +02:00
|
|
|
/**
|
|
|
|
* The change Stone colors event is emitted when the user chooses the stone
|
|
|
|
* colors to play with. Minimum 3, maximum 8
|
|
|
|
*
|
|
|
|
* @return set of used StoneColors
|
|
|
|
*/
|
2011-05-31 01:50:56 +02:00
|
|
|
public IEvent1<Set<StoneColor>> getChangeStoneColorsEvent();
|
|
|
|
|
2011-05-26 01:33:17 +02:00
|
|
|
/**
|
|
|
|
* the start game event is emitted when the user wants to start the game
|
|
|
|
*
|
|
|
|
* @return the event
|
|
|
|
*/
|
2011-05-27 15:00:28 +02:00
|
|
|
public IEvent getStartGameEvent();
|
|
|
|
|
2011-05-28 20:13:35 +02:00
|
|
|
/**
|
|
|
|
* Sets an error to display
|
|
|
|
*
|
|
|
|
* @param error
|
2011-05-31 15:29:37 +02:00
|
|
|
* the kind of error
|
2011-05-28 20:13:35 +02:00
|
|
|
*/
|
2011-05-27 15:00:28 +02:00
|
|
|
public void setError(SettingsError error);
|
|
|
|
|
2011-05-28 20:13:35 +02:00
|
|
|
/**
|
|
|
|
* Enables or disables the start game button
|
|
|
|
*
|
|
|
|
* @param enable
|
2011-05-31 15:29:37 +02:00
|
|
|
* specifies if the button is to be enabled or disabled
|
2011-05-28 20:13:35 +02:00
|
|
|
*/
|
2011-05-27 15:00:28 +02:00
|
|
|
public void enableStartGameButton(boolean enable);
|
|
|
|
|
2011-05-28 20:13:35 +02:00
|
|
|
/**
|
|
|
|
* Enables or disables the add player button
|
|
|
|
*
|
|
|
|
* @param enable
|
2011-05-31 15:29:37 +02:00
|
|
|
* specifies if the button is to be enabled or disabled
|
2011-05-28 20:13:35 +02:00
|
|
|
*/
|
2011-05-27 15:00:28 +02:00
|
|
|
public void enableAddPlayerButton(boolean enable);
|
|
|
|
|
2011-05-28 20:13:35 +02:00
|
|
|
/**
|
|
|
|
* Enables or disables the remove player buttons
|
|
|
|
*
|
|
|
|
* @param enable
|
2011-05-31 15:29:37 +02:00
|
|
|
* specifies if the buttons are to be enabled or disabled
|
2011-05-28 20:13:35 +02:00
|
|
|
*/
|
|
|
|
|
2011-05-27 15:00:28 +02:00
|
|
|
public void enableRemovePlayerButtons(boolean enable);
|
|
|
|
|
2011-05-28 20:13:35 +02:00
|
|
|
/**
|
|
|
|
* Sets the game settings to display
|
|
|
|
*
|
|
|
|
* @param gameSettings
|
2011-05-31 15:29:37 +02:00
|
|
|
* the settings
|
2011-05-28 20:13:35 +02:00
|
|
|
*/
|
2011-05-27 15:00:28 +02:00
|
|
|
public void setGameSettings(GameSettings gameSettings);
|
|
|
|
|
2011-05-30 20:16:48 +02:00
|
|
|
/**
|
|
|
|
* Emitted when the joker number is changed
|
|
|
|
*
|
|
|
|
* @return the event
|
|
|
|
*/
|
|
|
|
public IEvent1<Integer> getChangeJokerNumberEvent();
|
|
|
|
|
2011-05-28 20:13:35 +02:00
|
|
|
/**
|
|
|
|
* Specifies the different kinds of settings errors that can be displayed
|
|
|
|
*/
|
2011-05-27 15:00:28 +02:00
|
|
|
public enum SettingsError {
|
2011-05-28 20:13:35 +02:00
|
|
|
/** Everything is ok */
|
|
|
|
NO_ERROR,
|
|
|
|
/** A player name is used twice */
|
2011-05-30 19:08:33 +02:00
|
|
|
DUPLICATE_PLAYER_NAME_ERROR,
|
2011-05-28 20:13:35 +02:00
|
|
|
/** A player has an empty name */
|
2011-05-30 19:08:33 +02:00
|
|
|
NO_PLAYER_NAME_ERROR,
|
|
|
|
/** More Stones than present would be dealed */
|
|
|
|
NOT_ENOUGH_STONES_ERROR,
|
2011-05-31 03:02:31 +02:00
|
|
|
/** Less than 3 colors are selected */
|
|
|
|
NOT_ENOUGH_COLORS_ERROR,
|
2011-05-30 19:08:33 +02:00
|
|
|
|
|
|
|
// warnings
|
|
|
|
/** threshold higher 100 */
|
|
|
|
TOO_HIGH_THRESHOLD_WARNING,
|
|
|
|
/** Only computer players added */
|
|
|
|
COMPUTER_PLAYERS_ONLY_WARNING
|
2011-05-27 15:00:28 +02:00
|
|
|
}
|
2011-05-26 01:33:17 +02:00
|
|
|
}
|