Javadoc warnings cleanups.

Note: this involves generated code from a samskivert patch I only just sent to mdb,
but he's in a meeting, so that won't show up for a little.


git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@741 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Dave Hoover
2008-09-12 18:04:39 +00:00
parent 02ec2e68a9
commit 8b0488b3c9
22 changed files with 124 additions and 162 deletions
@@ -33,51 +33,42 @@ import com.threerings.presents.client.InvocationService;
public interface LobbyService extends InvocationService public interface LobbyService extends InvocationService
{ {
/** /**
* Used to communicate the results of a {@link #getCategories} * Used to communicate the results of a {@link LobbyService#getCategories} request.
* request.
*/ */
public static interface CategoriesListener extends InvocationListener public static interface CategoriesListener extends InvocationListener
{ {
/** /**
* Supplies the listener with the results of a {@link * Supplies the listener with the results of a {@link LobbyService#getCategories} request.
* #getCategories} request.
*/ */
public void gotCategories (String[] categories); public void gotCategories (String[] categories);
} }
/** /**
* Used to communicate the results of a {@link #getLobbies} * Used to communicate the results of a {@link LobbyService#getLobbies} request.
* request.
*/ */
public static interface LobbiesListener extends InvocationListener public static interface LobbiesListener extends InvocationListener
{ {
/** /**
* Supplies the listener with the results of a {@link * Supplies the listener with the results of a {@link LobbyService#getLobbies} request.
* #getLobbies} request.
*/ */
public void gotLobbies (List<Lobby> lobbies); public void gotLobbies (List<Lobby> lobbies);
} }
/** /**
* Requests the list of lobby cateogories that are available on this * Requests the list of lobby categories that are available on this
* server. * server.
* *
* @param client a connected, operational client instance. * @param client a connected, operational client instance.
* @param listener the listener that will receive and process the * @param listener the listener that will receive and process the response.
* response.
*/ */
public void getCategories (Client client, CategoriesListener listener); public void getCategories (Client client, CategoriesListener listener);
/** /**
* Requests information on all active lobbies that match the specified * Requests information on all active lobbies that match the specified category.
* category.
* *
* @param client a connected, operational client instance. * @param client a connected, operational client instance.
* @param category the category of game for which a list of lobbies is * @param category the category of game for which a list of lobbies is desired.
* desired. * @param listener the listener that will receive and process the response.
* @param listener the listener that will receive and process the
* response.
*/ */
public void getLobbies (Client client, String category, public void getLobbies (Client client, String category, LobbiesListener listener);
LobbiesListener listener);
} }
@@ -21,6 +21,8 @@
package com.threerings.parlor.card.data; package com.threerings.parlor.card.data;
import java.util.ArrayList;
import com.threerings.util.ActionScript; import com.threerings.util.ActionScript;
import com.threerings.util.StreamableArrayList; import com.threerings.util.StreamableArrayList;
@@ -35,22 +37,22 @@ public class Hand extends StreamableArrayList<Card>
@ActionScript(name="addAllCards") @ActionScript(name="addAllCards")
public void addAll (Card[] cards) public void addAll (Card[] cards)
{ {
for (int i = 0; i < cards.length; i++) { for (Card card : cards) {
add(cards[i]); add(card);
} }
} }
/** /**
* Removes all of the specified cards from this hand. * Removes all of the specified cards from this hand.
*/ */
@ActionScript(name="removeAllCards") @ActionScript(name="removeAllCards")
public void removeAll (Card[] cards) public void removeAll (Card[] cards)
{ {
for (int i = 0; i < cards.length; i++) { for (Card card : cards) {
remove(cards[i]); remove(card);
} }
} }
/** /**
* Checks whether this hand contains all of the specified cards. * Checks whether this hand contains all of the specified cards.
*/ */
@@ -64,7 +66,7 @@ public class Hand extends StreamableArrayList<Card>
} }
return true; return true;
} }
/** /**
* Counts the members of a particular suit within this hand. * Counts the members of a particular suit within this hand.
* *
@@ -84,7 +86,7 @@ public class Hand extends StreamableArrayList<Card>
/** /**
* Converts this list of cards into an array. This only necessary if you * Converts this list of cards into an array. This only necessary if you
* need the cards in array form, use {@link #get} if you simply need to get * need the cards in array form, use {@link ArrayList#get} if you simply need to get
* a card from the hand. * a card from the hand.
*/ */
public Card[] getCards () public Card[] getCards ()
@@ -37,12 +37,12 @@ import com.threerings.parlor.game.data.GameConfig;
public interface ParlorService extends InvocationService public interface ParlorService extends InvocationService
{ {
/** /**
* Used to communicate responses to {@link #invite} requests. * Used to communicate responses to {@link ParlorService#invite} requests.
*/ */
public static interface InviteListener extends InvocationListener public static interface InviteListener extends InvocationListener
{ {
/** /**
* Called in response to a successful {@link #invite} request. * Called in response to a successful {@link ParlorService#invite} request.
*/ */
public void inviteReceived (int inviteId); public void inviteReceived (int inviteId);
} }
@@ -38,7 +38,7 @@ import com.threerings.parlor.game.data.GameConfig;
* *
* <p> Clients that use the game configurator will want to instantiate one * <p> Clients that use the game configurator will want to instantiate one
* based on the class returned from the {@link GameConfig} and then * based on the class returned from the {@link GameConfig} and then
* initialize it with a call to {@link #init}. * initialize it with a call to {@link GameConfigurator#init}.
*/ */
public abstract class SwingGameConfigurator extends GameConfigurator public abstract class SwingGameConfigurator extends GameConfigurator
{ {
@@ -38,12 +38,14 @@ import com.threerings.parlor.game.client.GameConfigurator;
* *
* <p> The game config object is also the mechanism used to instantiate the appropriate game * <p> The game config object is also the mechanism used to instantiate the appropriate game
* manager and controller. Every game must have an associated game config derived class that * manager and controller. Every game must have an associated game config derived class that
* overrides {@link #createController} and {@link #getManagerClassName}, returning the appropriate * overrides {@link PlaceConfig#createController} and {@link PlaceConfig#getManagerClassName},
* game controller and manager class for that game. Thus the entire chain of events that causes a * returning the appropriate game controller and manager class for that game. Thus the entire chain
* particular game to be created is the construction of the appropriate game config instance which * of events that causes a particular game to be created is the construction of the appropriate
* is provided to the server as part of an invitation or via some other matchmaking mechanism. * game config instance which is provided to the server as part of an invitation or via some other
* matchmaking mechanism.
*/ */
public abstract class GameConfig extends PlaceConfig implements Cloneable public abstract class GameConfig extends PlaceConfig
implements Cloneable
{ {
/** Matchmaking type constant: a game that is started with a list of players, and those are the /** Matchmaking type constant: a game that is started with a list of players, and those are the
* only players that may play. */ * only players that may play. */
@@ -67,7 +67,8 @@ public class GameManager extends PlaceManager
{ {
/** /**
* An interface for identifying users. A larger system using the Parlor game services can * An interface for identifying users. A larger system using the Parlor game services can
* enable user identification by passing a UserIdentifier to {@link #setUserIdentifier}. * enable user identification by passing a UserIdentifier to
* {@link GameManager#setUserIdentifier}.
*/ */
public interface UserIdentifier public interface UserIdentifier
{ {
@@ -690,7 +691,7 @@ public class GameManager extends PlaceManager
DObject player = _omgr.getObject(playerId); DObject player = _omgr.getObject(playerId);
return (player instanceof BodyObject) ? (BodyObject) player : null; return (player instanceof BodyObject) ? (BodyObject) player : null;
} }
/** /**
* Returns true if this game requires a no-show timer. The default implementation returns true * Returns true if this game requires a no-show timer. The default implementation returns true
@@ -26,7 +26,6 @@ import com.samskivert.jdbc.depot.PersistentRecord;
import com.samskivert.jdbc.depot.annotation.Column; import com.samskivert.jdbc.depot.annotation.Column;
import com.samskivert.jdbc.depot.annotation.Id; import com.samskivert.jdbc.depot.annotation.Id;
import com.samskivert.jdbc.depot.expression.ColumnExp; import com.samskivert.jdbc.depot.expression.ColumnExp;
import com.threerings.parlor.rating.util.Percentiler; import com.threerings.parlor.rating.util.Percentiler;
/** /**
@@ -63,7 +62,7 @@ public class PercentileRecord extends PersistentRecord
// AUTO-GENERATED: METHODS START // AUTO-GENERATED: METHODS START
/** /**
* Create and return a primary {@link Key} to identify a {@link #PercentileRecord} * Create and return a primary {@link Key} to identify a {@link PercentileRecord}
* with the supplied key values. * with the supplied key values.
*/ */
public static Key<PercentileRecord> getKey (int gameId) public static Key<PercentileRecord> getKey (int gameId)
@@ -125,7 +125,7 @@ public class RatingRecord extends PersistentRecord
// AUTO-GENERATED: METHODS START // AUTO-GENERATED: METHODS START
/** /**
* Create and return a primary {@link Key} to identify a {@link #RatingRecord} * Create and return a primary {@link Key} to identify a {@link RatingRecord}
* with the supplied key values. * with the supplied key values.
*/ */
public static Key<RatingRecord> getKey (int gameId, int playerId) public static Key<RatingRecord> getKey (int gameId, int playerId)
@@ -21,15 +21,14 @@
package com.threerings.parlor.turn.client; package com.threerings.parlor.turn.client;
import com.threerings.crowd.client.PlaceController;
import com.threerings.util.Name; import com.threerings.util.Name;
import com.threerings.parlor.game.client.GameController;
/** /**
* Games that wish to make use of the turn game services should have their * Games that wish to make use of the turn game services should have their
* controller implement this interface and create an instance of {@link * controller implement this interface and create an instance of {@link
* TurnGameControllerDelegate} which should be passed to {@link * TurnGameControllerDelegate} which should be passed to {@link
* GameController#addDelegate}. * PlaceController#addDelegate}.
*/ */
public interface TurnGameController public interface TurnGameController
{ {
@@ -21,24 +21,22 @@
package com.threerings.parlor.turn.server; package com.threerings.parlor.turn.server;
import com.samskivert.util.RandomUtil; import static com.threerings.parlor.Log.log;
import com.threerings.util.Name;
import com.samskivert.util.RandomUtil;
import com.threerings.crowd.data.PlaceConfig; import com.threerings.crowd.data.PlaceConfig;
import com.threerings.crowd.data.PlaceObject; import com.threerings.crowd.data.PlaceObject;
import com.threerings.crowd.server.PlaceManager;
import com.threerings.parlor.game.server.GameManager; import com.threerings.parlor.game.server.GameManager;
import com.threerings.parlor.game.server.GameManagerDelegate; import com.threerings.parlor.game.server.GameManagerDelegate;
import com.threerings.parlor.turn.data.TurnGameObject; import com.threerings.parlor.turn.data.TurnGameObject;
import com.threerings.util.Name;
import static com.threerings.parlor.Log.log;
/** /**
* Performs the server-side turn-based game processing for a turn based game. Game managers which * Performs the server-side turn-based game processing for a turn based game. Game managers which
* wish to make use of the turn services must implement {@link TurnGameManager} and either create * wish to make use of the turn services must implement {@link TurnGameManager} and either create
* an instance of this class, or an instance of a derivation which customizes the behavior, either * an instance of this class, or an instance of a derivation which customizes the behavior, either
* of which would be passed to {@link GameManager#addDelegate} to be activated. * of which would be passed to {@link PlaceManager#addDelegate} to be activated.
*/ */
public class TurnGameManagerDelegate extends GameManagerDelegate public class TurnGameManagerDelegate extends GameManagerDelegate
{ {
@@ -267,8 +267,7 @@ public abstract class PuzzleBoardView extends VirtualMediaPanel
* @param x the x-position at which the score is to be placed. * @param x the x-position at which the score is to be placed.
* @param y the y-position at which the score is to be placed. * @param y the y-position at which the score is to be placed.
*/ */
public ScoreAnimation createScoreAnimation ( public ScoreAnimation createScoreAnimation (String score, Color color, Font font, int x, int y)
String score, Color color, Font font, int x, int y)
{ {
return createScoreAnimation( return createScoreAnimation(
ScoreAnimation.createLabel(score, color, font, (Component)this), x, y); ScoreAnimation.createLabel(score, color, font, (Component)this), x, y);
@@ -277,7 +276,7 @@ public abstract class PuzzleBoardView extends VirtualMediaPanel
/** /**
* Creates a score animation, allowing derived classes to use custom * Creates a score animation, allowing derived classes to use custom
* animations that are customized following a call to * animations that are customized following a call to
* {@link #createScoreAnimation}. * {@link #createScoreAnimation(String,Color,Font,int,int)}.
*/ */
protected ScoreAnimation createScoreAnimation (Label label, int x, int y) protected ScoreAnimation createScoreAnimation (Label label, int x, int y)
{ {
@@ -188,8 +188,7 @@ public abstract class PuzzleController extends GameController
// and check if we should be suspending the action during this pause // and check if we should be suspending the action during this pause
if (supportsActionPause()) { if (supportsActionPause()) {
// clear the action if we're pausing, resume it if we're // clear the action if we're pausing, resume it if we're unpausing
// unpausing
if (chatting) { if (chatting) {
clearAction(); clearAction();
} else { } else {
@@ -228,16 +227,14 @@ public abstract class PuzzleController extends GameController
@Override @Override
public void apply (PlaceControllerDelegate delegate) { public void apply (PlaceControllerDelegate delegate) {
canChatNow[0] = canChatNow[0] =
((PuzzleControllerDelegate)delegate).canStartChatting() && ((PuzzleControllerDelegate)delegate).canStartChatting() && canChatNow[0];
canChatNow[0];
} }
}); });
return canChatNow[0]; return canChatNow[0];
} }
/** /**
* Returns true if the puzzle has been defocused because the player * Returns true if the puzzle has been defocused because the player is doing some chatting.
* is doing some chatting.
*/ */
public boolean isChatting () public boolean isChatting ()
{ {
@@ -274,7 +271,7 @@ public abstract class PuzzleController extends GameController
{ {
super.mayLeavePlace(plobj); super.mayLeavePlace(plobj);
// flush any pending progress events // flush any pending progress events
sendProgressUpdate(); sendProgressUpdate();
} }
@@ -309,7 +306,7 @@ public abstract class PuzzleController extends GameController
/** /**
* Indicates whether the action should start immediately as a result * Indicates whether the action should start immediately as a result
* of {@link #gameDidStart} being called. If a puzzle wishes to do * of {@link GameController#gameDidStart} being called. If a puzzle wishes to do
* some beginning of the game fun stuff, like display a tutorial * some beginning of the game fun stuff, like display a tutorial
* screen, they can veto the action start and then start it themselves * screen, they can veto the action start and then start it themselves
* later. * later.
@@ -51,8 +51,7 @@ import com.threerings.puzzle.drop.data.DropPieceCodes;
import static com.threerings.puzzle.Log.log; import static com.threerings.puzzle.Log.log;
/** /**
* The drop board view displays a drop puzzle game in progress for a * The drop board view displays a drop puzzle game in progress for a single player.
* single player.
*/ */
public abstract class DropBoardView extends PuzzleBoardView public abstract class DropBoardView extends PuzzleBoardView
implements DropPieceCodes implements DropPieceCodes
@@ -21,28 +21,25 @@
package com.threerings.puzzle.drop.client; package com.threerings.puzzle.drop.client;
import static com.threerings.puzzle.Log.log;
import java.awt.Component; import java.awt.Component;
import java.awt.Point; import java.awt.Point;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import com.samskivert.util.IntListUtil; import com.samskivert.util.IntListUtil;
import com.threerings.crowd.client.PlaceController;
import com.threerings.crowd.data.PlaceConfig;
import com.threerings.crowd.util.CrowdContext;
import com.threerings.media.FrameParticipant; import com.threerings.media.FrameParticipant;
import com.threerings.media.animation.Animation; import com.threerings.media.animation.Animation;
import com.threerings.media.animation.AnimationAdapter; import com.threerings.media.animation.AnimationAdapter;
import com.threerings.crowd.data.PlaceConfig;
import com.threerings.crowd.util.CrowdContext;
import com.threerings.puzzle.util.PuzzleContext;
import com.threerings.puzzle.client.PuzzleController; import com.threerings.puzzle.client.PuzzleController;
import com.threerings.puzzle.client.PuzzleControllerDelegate; import com.threerings.puzzle.client.PuzzleControllerDelegate;
import com.threerings.puzzle.client.PuzzlePanel; import com.threerings.puzzle.client.PuzzlePanel;
import com.threerings.puzzle.data.Board; import com.threerings.puzzle.data.Board;
import com.threerings.puzzle.data.BoardSummary; import com.threerings.puzzle.data.BoardSummary;
import com.threerings.puzzle.drop.data.DropBoard; import com.threerings.puzzle.drop.data.DropBoard;
import com.threerings.puzzle.drop.data.DropCodes; import com.threerings.puzzle.drop.data.DropCodes;
import com.threerings.puzzle.drop.data.DropConfig; import com.threerings.puzzle.drop.data.DropConfig;
@@ -50,30 +47,25 @@ import com.threerings.puzzle.drop.data.DropLogic;
import com.threerings.puzzle.drop.data.DropPieceCodes; import com.threerings.puzzle.drop.data.DropPieceCodes;
import com.threerings.puzzle.drop.util.PieceDropLogic; import com.threerings.puzzle.drop.util.PieceDropLogic;
import com.threerings.puzzle.drop.util.PieceDropper; import com.threerings.puzzle.drop.util.PieceDropper;
import com.threerings.puzzle.util.PuzzleContext;
import static com.threerings.puzzle.Log.log;
/** /**
* Games that wish to make use of the drop puzzle services will need to * Games that wish to make use of the drop puzzle services will need to
* create an extension of this delegate class, customizing it for their * create an extension of this delegate class, customizing it for their
* particular game and then adding it via {@link * particular game and then adding it via {@link PlaceController#addDelegate}.
* PuzzleController#addDelegate}.
* *
* <p> It handles logical actions for a puzzle game that generally * <p> It handles logical actions for a puzzle game that generally
* consists of a two-dimensional board containing pieces, with new pieces * consists of a two-dimensional board containing pieces, with new pieces
* either falling into the board as a "drop block", or rising into the * either falling into the board as a "drop block", or rising into the
* bottom of the board in new piece rows. * bottom of the board in new piece rows.
* *
* <p> Derived classes must implement {@link #getPieceVelocity} and {@link * <p> Derived classes must implement {@link #getPieceVelocity} and {@link #evolveBoard}.
* #evolveBoard}.
* *
* <p> Block-dropping puzzles will likely want to override {@link * <p> Block-dropping puzzles will likely want to override {@link #createNextBlock},
* #createNextBlock}, {@link #blockDidLand}, and {@link * {@link #blockDidLand}, and {@link #getPieceDropLogic}.
* #getPieceDropLogic}.
* *
* <p> Board-rising puzzles will likely want to override {@link * <p> Board-rising puzzles will likely want to override {@link #getRiseVelocity},
* #getRiseVelocity}, {@link #getRiseDistance}, {@link * {@link #getRiseDistance}, {@link #getPieceDropLogic}, and {@link #boardDidRise}.
* #getPieceDropLogic}, and {@link #boardDidRise}.
*/ */
public abstract class DropControllerDelegate extends PuzzleControllerDelegate public abstract class DropControllerDelegate extends PuzzleControllerDelegate
implements DropCodes, DropPieceCodes, FrameParticipant implements DropCodes, DropPieceCodes, FrameParticipant
@@ -877,7 +869,7 @@ public abstract class DropControllerDelegate extends PuzzleControllerDelegate
} }
/** /**
* Returns the piece dropper used to drop any pieces that need dropping in the board. * Returns the piece dropper used to drop any pieces that need dropping in the board.
*/ */
protected PieceDropper getPieceDropper (PieceDropLogic logic) protected PieceDropper getPieceDropper (PieceDropLogic logic)
{ {
@@ -24,11 +24,12 @@ package com.threerings.puzzle.drop.client;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.Rectangle; import java.awt.Rectangle;
import com.threerings.media.AbstractMedia;
import com.threerings.media.AbstractMediaManager;
import com.threerings.media.animation.Animation; import com.threerings.media.animation.Animation;
import com.threerings.media.sprite.PathObserver; import com.threerings.media.sprite.PathObserver;
import com.threerings.media.sprite.Sprite; import com.threerings.media.sprite.Sprite;
import com.threerings.media.util.Path; import com.threerings.media.util.Path;
import com.threerings.puzzle.drop.data.DropBoard; import com.threerings.puzzle.drop.data.DropBoard;
/** /**
@@ -39,8 +40,8 @@ public abstract class PieceGroupAnimation extends Animation
implements PathObserver implements PathObserver
{ {
/** /**
* Creates a piece group animation which must be initialized with a * Creates a piece group animation which must be initialized with a subsequent call to
* subsequent call to {@link #init}. * {@link AbstractMedia#init(AbstractMediaManager)}.
*/ */
public PieceGroupAnimation (DropBoardView view, DropBoard board) public PieceGroupAnimation (DropBoardView view, DropBoard board)
{ {
@@ -21,22 +21,21 @@
package com.threerings.puzzle.drop.server; package com.threerings.puzzle.drop.server;
import static com.threerings.puzzle.Log.log;
import com.threerings.crowd.data.PlaceConfig; import com.threerings.crowd.data.PlaceConfig;
import com.threerings.crowd.data.PlaceObject; import com.threerings.crowd.data.PlaceObject;
import com.threerings.crowd.server.PlaceManager;
import com.threerings.puzzle.data.Board; import com.threerings.puzzle.data.Board;
import com.threerings.puzzle.data.PuzzleCodes; import com.threerings.puzzle.data.PuzzleCodes;
import com.threerings.puzzle.server.PuzzleManager;
import com.threerings.puzzle.server.PuzzleManagerDelegate;
import com.threerings.puzzle.drop.data.DropBoard; import com.threerings.puzzle.drop.data.DropBoard;
import com.threerings.puzzle.drop.data.DropCodes; import com.threerings.puzzle.drop.data.DropCodes;
import com.threerings.puzzle.drop.data.DropConfig; import com.threerings.puzzle.drop.data.DropConfig;
import com.threerings.puzzle.drop.data.DropLogic; import com.threerings.puzzle.drop.data.DropLogic;
import com.threerings.puzzle.drop.util.PieceDropLogic; import com.threerings.puzzle.drop.util.PieceDropLogic;
import com.threerings.puzzle.drop.util.PieceDropper; import com.threerings.puzzle.drop.util.PieceDropper;
import com.threerings.puzzle.server.PuzzleManager;
import static com.threerings.puzzle.Log.log; import com.threerings.puzzle.server.PuzzleManagerDelegate;
/** /**
* Provides the necessary support for a puzzle game that involves a * Provides the necessary support for a puzzle game that involves a
@@ -52,7 +51,7 @@ import static com.threerings.puzzle.Log.log;
* <p> A puzzle game using these services will then need to extend this * <p> A puzzle game using these services will then need to extend this
* delegate, implementing the necessary methods to customize it for the * delegate, implementing the necessary methods to customize it for the
* particulars of their game and then register it with their game manager * particulars of their game and then register it with their game manager
* via {@link PuzzleManager#addDelegate}. * via {@link PlaceManager#addDelegate}.
* *
* <p> It also keeps track of, for each player, board level information, * <p> It also keeps track of, for each player, board level information,
* and player game status. Miscellaneous utility routines are provided * and player game status. Miscellaneous utility routines are provided
@@ -146,7 +145,7 @@ public abstract class DropManagerDelegate extends PuzzleManagerDelegate
} }
/** /**
* Returns the piece dropper used to drop any pieces that need dropping in the board. * Returns the piece dropper used to drop any pieces that need dropping in the board.
*/ */
protected PieceDropper getPieceDropper (PieceDropLogic logic) protected PieceDropper getPieceDropper (PieceDropLogic logic)
{ {
@@ -63,17 +63,15 @@ import com.threerings.stage.util.StageSceneUtil;
import static com.threerings.stage.Log.log; import static com.threerings.stage.Log.log;
/** /**
* Defines extensions to the basic Stage scene manager specific to * Defines extensions to the basic Stage scene manager specific to displaying isometric "stage"
* displaying isometric "stage" scenes (these may be indoor, outdoor or * scenes (these may be indoor, outdoor or aboard a vessel).
* aboard a vessel).
*/ */
public class StageSceneManager extends SpotSceneManager public class StageSceneManager extends SpotSceneManager
implements StageSceneProvider implements StageSceneProvider
{ {
/** /**
* Returns a traversal predicate for use with {@link * Returns a traversal predicate for use with {@link StageSceneUtil#findStandingSpot} that
* StageSceneUtil#findStandingSpot} that validates whether a player can * validates whether a player can stand in the searched spots.
* stand in the searched spots.
*/ */
public AStarPathUtil.TraversalPred getCanStandPred () public AStarPathUtil.TraversalPred getCanStandPred ()
{ {
@@ -89,21 +87,19 @@ public class StageSceneManager extends SpotSceneManager
} }
/** /**
* Adds the supplied object to this scene. A persistent update is * Adds the supplied object to this scene. A persistent update is generated and broadcast to
* generated and broadcast to all scene occupants. The update is * all scene occupants. The update is stored in the repository for communication to future
* stored in the repository for communication to future occupants of * occupants of the scene and then entire complex process of changing our virtual game world is
* the scene and then entire complex process of changing our virtual * effected at the simple call of this single method.
* game world is effected at the simple call of this single method.
* *
* @param killOverlap if true, overlapping object will be removed, and * @param killOverlap if true, overlapping object will be removed, and the allowOverlap
* the allowOverlap argument will be ignored. * argument will be ignored.
* @param allowOverlap if true, overlapping objects will be allowed * @param allowOverlap if true, overlapping objects will be allowed but one must be *very*
* but one must be *very* careful to ensure that they know what they * careful to ensure that they know what they are doing (i.e. the objects have render priorities
* are doing (ie. the objects have render priorities that correctly * that correctly handle the overlap).
* handle the overlap).
* *
* @return true if the object was added, false if the add was rejected * @return true if the object was added, false if the add was rejected because the object
* because the object overlaps an existing scene object. * overlaps an existing scene object.
*/ */
public boolean addObject (ObjectInfo info, boolean killOverlap, public boolean addObject (ObjectInfo info, boolean killOverlap,
boolean allowOverlap) boolean allowOverlap)
@@ -192,7 +188,7 @@ public class StageSceneManager extends SpotSceneManager
throws InvocationException throws InvocationException
{ {
InvocationException.requireAccess(caller, StageCodes.MODIFY_SCENE_ACCESS, _sscene); InvocationException.requireAccess(caller, StageCodes.MODIFY_SCENE_ACCESS, _sscene);
// create our scene update which will be stored in the database // create our scene update which will be stored in the database
// and used to efficiently update clients // and used to efficiently update clients
ModifyObjectsUpdate update = new ModifyObjectsUpdate(); ModifyObjectsUpdate update = new ModifyObjectsUpdate();
@@ -200,10 +196,10 @@ public class StageSceneManager extends SpotSceneManager
log.info("Modifying objects '" + update + "."); log.info("Modifying objects '" + update + ".");
recordUpdate(update, true); recordUpdate(update, true);
listener.requestProcessed(); listener.requestProcessed();
} }
@Override // documentation inherited @Override // documentation inherited
protected void gotSceneData () protected void gotSceneData ()
{ {
@@ -373,7 +369,7 @@ public class StageSceneManager extends SpotSceneManager
return true; return true;
} }
/** Helper function for {@link #validateLocation}. */ /** Helper function for {@link #validateLocation(BodyObject,StageLocation,boolean)}. */
protected boolean checkContains (Iterable<? extends Rectangle> rects, int tx, int ty) protected boolean checkContains (Iterable<? extends Rectangle> rects, int tx, int ty)
{ {
for (Rectangle rect : rects) { for (Rectangle rect : rects) {
@@ -463,7 +459,7 @@ public class StageSceneManager extends SpotSceneManager
return new SceneLocation(sloc, body.getOid()); return new SceneLocation(sloc, body.getOid());
} }
/** Helper function for {@link #computeEnteringLocation}. */ /** Helper function for {@link #computeEnteringLocation(BodyObject,Portal,int)}. */
protected boolean checkEntry (MisoSceneMetrics metrics, BodyObject body, protected boolean checkEntry (MisoSceneMetrics metrics, BodyObject body,
int tx, int ty, StageLocation loc) int tx, int ty, StageLocation loc)
{ {
@@ -612,8 +608,7 @@ public class StageSceneManager extends SpotSceneManager
/** Helper function for {@link #canAddBody}. */ /** Helper function for {@link #canAddBody}. */
protected boolean checkPortals (Rectangle rect) protected boolean checkPortals (Rectangle rect)
{ {
for (Iterator<Point> iter = _plocs.iterator(); iter.hasNext(); ) { for (Point ppoint : _plocs) {
Point ppoint = iter.next();
if (rect.contains(ppoint)) { if (rect.contains(ppoint)) {
return true; return true;
} }
@@ -688,8 +683,8 @@ public class StageSceneManager extends SpotSceneManager
// StringUtil.toString(locs) + " for " + cl + "."); // StringUtil.toString(locs) + " for " + cl + ".");
// make sure everyone is in their proper position // make sure everyone is in their proper position
for (Iterator<Integer> iter = clrec.keySet().iterator(); iter.hasNext(); ) { for (Integer integer : clrec.keySet()) {
int tbodyOid = iter.next().intValue(); int tbodyOid = integer.intValue();
// leave the newly added player to last // leave the newly added player to last
if (tbodyOid != bodyOid) { if (tbodyOid != bodyOid) {
positionBody(cl, tbodyOid, locs); positionBody(cl, tbodyOid, locs);
@@ -753,8 +748,8 @@ public class StageSceneManager extends SpotSceneManager
List<SceneLocation> locs = StageSceneUtil.getClusterLocs(cl); List<SceneLocation> locs = StageSceneUtil.getClusterLocs(cl);
// make sure everyone is in their proper position // make sure everyone is in their proper position
for (Iterator<Integer> iter = clrec.keySet().iterator(); iter.hasNext(); ) { for (Integer integer : clrec.keySet()) {
int bodyOid = iter.next().intValue(); int bodyOid = integer.intValue();
// leave the newly added player to last // leave the newly added player to last
if (bodyOid != body.getOid()) { if (bodyOid != body.getOid()) {
positionBody(cl, bodyOid, locs); positionBody(cl, bodyOid, locs);
@@ -845,9 +840,9 @@ public class StageSceneManager extends SpotSceneManager
/** Used by {@link #canAddBody}. */ /** Used by {@link #canAddBody}. */
protected static final int[] Y_OFF = { 0, 0, -1, -1 }; protected static final int[] Y_OFF = { 0, 0, -1, -1 };
/** Used by {@link #computeEnteringLocation}. */ /** Used by {@link #computeEnteringLocation(BodyObject,Portal,int)}. */
protected static final int[] PORTAL_DX = { 0, -1, 0, 1 }; // W N E S protected static final int[] PORTAL_DX = { 0, -1, 0, 1 }; // W N E S
/** Used by {@link #computeEnteringLocation}. */ /** Used by {@link #computeEnteringLocation(BodyObject,Portal,int)}. */
protected static final int[] PORTAL_DY = { 1, 0, -1, 0 }; // W N E S protected static final int[] PORTAL_DY = { 1, 0, -1, 0 }; // W N E S
} }
@@ -21,6 +21,8 @@
package com.threerings.stage.tools.editor; package com.threerings.stage.tools.editor;
import static com.threerings.stage.Log.log;
import java.awt.AlphaComposite; import java.awt.AlphaComposite;
import java.awt.BasicStroke; import java.awt.BasicStroke;
import java.awt.Color; import java.awt.Color;
@@ -31,13 +33,11 @@ import java.awt.Polygon;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.Shape; import java.awt.Shape;
import java.awt.Stroke; import java.awt.Stroke;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.awt.event.KeyListener; import java.awt.event.KeyListener;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.geom.Ellipse2D; import java.awt.geom.Ellipse2D;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
@@ -49,42 +49,34 @@ import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.samskivert.swing.Controller; import com.samskivert.swing.Controller;
import com.samskivert.swing.TGraphics2D; import com.samskivert.swing.TGraphics2D;
import com.samskivert.swing.util.SwingUtil; import com.samskivert.swing.util.SwingUtil;
import com.samskivert.util.RandomUtil; import com.samskivert.util.RandomUtil;
import com.threerings.util.DirectionCodes;
import com.threerings.media.tile.ObjectTile; import com.threerings.media.tile.ObjectTile;
import com.threerings.media.tile.Tile; import com.threerings.media.tile.Tile;
import com.threerings.media.tile.TileUtil; import com.threerings.media.tile.TileUtil;
import com.threerings.miso.client.MisoScenePanel;
import com.threerings.whirled.spot.tools.EditablePortal;
import com.threerings.whirled.spot.data.Portal;
import com.threerings.miso.client.ObjectActionHandler; import com.threerings.miso.client.ObjectActionHandler;
import com.threerings.miso.client.SceneBlock; import com.threerings.miso.client.SceneBlock;
import com.threerings.miso.client.SceneObject; import com.threerings.miso.client.SceneObject;
import com.threerings.miso.data.MisoSceneModel; import com.threerings.miso.data.MisoSceneModel;
import com.threerings.miso.data.ObjectInfo; import com.threerings.miso.data.ObjectInfo;
import com.threerings.miso.util.MisoUtil; import com.threerings.miso.util.MisoUtil;
import com.threerings.stage.client.StageScenePanel; import com.threerings.stage.client.StageScenePanel;
import com.threerings.stage.data.StageLocation; import com.threerings.stage.data.StageLocation;
import com.threerings.stage.data.StageMisoSceneModel; import com.threerings.stage.data.StageMisoSceneModel;
import com.threerings.stage.tools.editor.util.EditorContext; import com.threerings.stage.tools.editor.util.EditorContext;
import com.threerings.stage.tools.editor.util.EditorDialogUtil; import com.threerings.stage.tools.editor.util.EditorDialogUtil;
import com.threerings.stage.tools.editor.util.ExtrasPainter; import com.threerings.stage.tools.editor.util.ExtrasPainter;
import com.threerings.util.DirectionCodes;
import static com.threerings.stage.Log.log; import com.threerings.whirled.spot.data.Portal;
import com.threerings.whirled.spot.tools.EditablePortal;
/** /**
* Displays the scene view and handles UI events on the scene. Various * Displays the scene view and handles UI events on the scene. Various actions may be performed on
* actions may be performed on the scene depending on the selected action * the scene depending on the selected action mode, including placing and deleting tiles or
* mode, including placing and deleting tiles or locations and creating * locations and creating portals.
* portals.
*/ */
public class EditorScenePanel extends StageScenePanel public class EditorScenePanel extends StageScenePanel
implements EditorModelListener, KeyListener, ChangeListener implements EditorModelListener, KeyListener, ChangeListener
@@ -94,8 +86,7 @@ public class EditorScenePanel extends StageScenePanel
*/ */
public EditorScenePanel (EditorContext ctx, JFrame frame, EditorModel model) public EditorScenePanel (EditorContext ctx, JFrame frame, EditorModel model)
{ {
super(ctx, new Controller() { super(ctx, new Controller() { });
});
// keep these around for later // keep these around for later
_ctx = ctx; _ctx = ctx;
@@ -218,8 +209,7 @@ public class EditorScenePanel extends StageScenePanel
} }
/** /**
* Handle placing the currently selected tile at the given screen * Handle placing the currently selected tile at the given screen coordinates in the scene.
* coordinates in the scene.
*/ */
protected void placeTile (int x, int y) protected void placeTile (int x, int y)
{ {
@@ -598,8 +588,7 @@ public class EditorScenePanel extends StageScenePanel
} }
/** /**
* Set a region of tiles to a random selection from the supplied * Set a region of tiles to a random selection from the supplied tileset.
* tileset.
*/ */
public void setBaseTiles (Rectangle r, int setId, int tileCount) public void setBaseTiles (Rectangle r, int setId, int tileCount)
{ {
@@ -688,7 +677,7 @@ public class EditorScenePanel extends StageScenePanel
/** /**
* Sets the tile that is currently being placed. It will not be * Sets the tile that is currently being placed. It will not be
* rendered until after a call to {@link #updateTileCoords} on the * rendered until after a call to {@link MisoScenePanel#updateTileCoords} on the
* placing tile (which happens automatically when the mouse moves). * placing tile (which happens automatically when the mouse moves).
*/ */
public void setPlacingTile (Tile tile) public void setPlacingTile (Tile tile)
@@ -698,8 +687,7 @@ public class EditorScenePanel extends StageScenePanel
// if this is an object tile, create a temporary scene object we // if this is an object tile, create a temporary scene object we
// can use to perform calculations with the object while placing // can use to perform calculations with the object while placing
if (_ptile instanceof ObjectTile) { if (_ptile instanceof ObjectTile) {
_pscobj = new SceneObject(this, new ObjectInfo(0, _ppos.x, _ppos.y), _pscobj = new SceneObject(this, new ObjectInfo(0, _ppos.x, _ppos.y), (ObjectTile)tile);
(ObjectTile)tile);
} else { } else {
_pscobj = null; _pscobj = null;
} }
@@ -117,7 +117,7 @@ public class StatRecord extends PersistentRecord
// AUTO-GENERATED: METHODS START // AUTO-GENERATED: METHODS START
/** /**
* Create and return a primary {@link Key} to identify a {@link #StatRecord} * Create and return a primary {@link Key} to identify a {@link StatRecord}
* with the supplied key values. * with the supplied key values.
*/ */
public static Key<StatRecord> getKey (int playerId, int statCode) public static Key<StatRecord> getKey (int playerId, int statCode)
@@ -92,7 +92,7 @@ public class StringCodeRecord extends PersistentRecord
// AUTO-GENERATED: METHODS START // AUTO-GENERATED: METHODS START
/** /**
* Create and return a primary {@link Key} to identify a {@link #StringCodeRecord} * Create and return a primary {@link Key} to identify a {@link StringCodeRecord}
* with the supplied key values. * with the supplied key values.
*/ */
public static Key<StringCodeRecord> getKey (int statCode, String value) public static Key<StringCodeRecord> getKey (int statCode, String value)
@@ -36,7 +36,7 @@ import com.threerings.whirled.data.SceneUpdate;
public interface SceneService extends InvocationService public interface SceneService extends InvocationService
{ {
/** /**
* Used to communicate the response to a {@link #moveTo} request. * Used to communicate the response to a {@link SceneService#moveTo} request.
*/ */
public static interface SceneMoveListener extends InvocationListener public static interface SceneMoveListener extends InvocationListener
{ {
@@ -35,24 +35,24 @@ import com.threerings.whirled.zone.data.ZoneSummary;
*/ */
public interface ZoneService extends InvocationService public interface ZoneService extends InvocationService
{ {
/** Used to deliver responses to {@link #moveTo} requests. */ /** Used to deliver responses to {@link ZoneService#moveTo} requests. */
public static interface ZoneMoveListener extends InvocationListener public static interface ZoneMoveListener extends InvocationListener
{ {
/** /**
* Called in response to a successful {@link #moveTo} request. * Called in response to a successful {@link ZoneService#moveTo} request.
*/ */
public void moveSucceeded (int placeId, PlaceConfig config, ZoneSummary summary); public void moveSucceeded (int placeId, PlaceConfig config, ZoneSummary summary);
/** /**
* Called in response to a successful {@link #moveTo} request when our cached scene was out * Called in response to a successful {@link ZoneService#moveTo} request when our cached
* of date and the server determined that we needed some updates. * scene was out of date and the server determined that we needed some updates.
*/ */
public void moveSucceededWithUpdates ( public void moveSucceededWithUpdates (
int placeId, PlaceConfig config, ZoneSummary summary, SceneUpdate[] updates); int placeId, PlaceConfig config, ZoneSummary summary, SceneUpdate[] updates);
/** /**
* Called in response to a successful {@link #moveTo} request when our cached scene was out * Called in response to a successful {@link ZoneService#moveTo} request when our cached
* of date and the server determined that we needed an updated copy. * scene was out of date and the server determined that we needed an updated copy.
*/ */
public void moveSucceededWithScene ( public void moveSucceededWithScene (
int placeId, PlaceConfig config, ZoneSummary summary, SceneModel model); int placeId, PlaceConfig config, ZoneSummary summary, SceneModel model);