diff --git a/src/java/com/threerings/micasa/client/ChatPanel.java b/src/java/com/threerings/micasa/client/ChatPanel.java index 15603b85..717c9bb8 100644 --- a/src/java/com/threerings/micasa/client/ChatPanel.java +++ b/src/java/com/threerings/micasa/client/ChatPanel.java @@ -119,6 +119,7 @@ public class ChatPanel extends JPanel // listen to ancestor events to request focus when added addAncestorListener(new AncestorAdapter() { + @Override public void ancestorAdded (AncestorEvent e) { if (_focus) { _entry.requestFocusInWindow(); @@ -308,7 +309,7 @@ public class ChatPanel extends JPanel // nothing doing } - // documentation inherited + @Override public Dimension getPreferredSize () { Dimension size = super.getPreferredSize(); diff --git a/src/java/com/threerings/micasa/client/ClientController.java b/src/java/com/threerings/micasa/client/ClientController.java index f4ced19f..2413f75d 100644 --- a/src/java/com/threerings/micasa/client/ClientController.java +++ b/src/java/com/threerings/micasa/client/ClientController.java @@ -58,7 +58,7 @@ public class ClientController extends Controller _frame.setPanel(_logonPanel); } - // documentation inherited + @Override public boolean handleAction (ActionEvent action) { String cmd = action.getActionCommand(); diff --git a/src/java/com/threerings/micasa/client/LogonPanel.java b/src/java/com/threerings/micasa/client/LogonPanel.java index fe8b07c5..30a9dd42 100644 --- a/src/java/com/threerings/micasa/client/LogonPanel.java +++ b/src/java/com/threerings/micasa/client/LogonPanel.java @@ -65,6 +65,7 @@ public class LogonPanel extends JPanel JPanel box = new JPanel( new VGroupLayout(VGroupLayout.NONE, VGroupLayout.STRETCH, 5, VGroupLayout.CENTER)) { + @Override public Dimension getPreferredSize () { Dimension psize = super.getPreferredSize(); psize.width = Math.max(psize.width, 300); @@ -118,6 +119,7 @@ public class LogonPanel extends JPanel box.add(new JLabel(_msgs.get("m.status"))); _status = new JTextArea() { + @Override public Dimension getPreferredScrollableViewportSize () { return new Dimension(10, 100); diff --git a/src/java/com/threerings/micasa/client/MiCasaApplet.java b/src/java/com/threerings/micasa/client/MiCasaApplet.java index d2b2ce8b..99731711 100644 --- a/src/java/com/threerings/micasa/client/MiCasaApplet.java +++ b/src/java/com/threerings/micasa/client/MiCasaApplet.java @@ -42,6 +42,7 @@ public class MiCasaApplet extends Applet /** * Create the client instance and set things up. */ + @Override public void init () { try { @@ -67,6 +68,7 @@ public class MiCasaApplet extends Applet // we want to hide the client frame when we logoff client.addClientObserver(new ClientAdapter() { + @Override public void clientDidLogoff (Client c) { _frame.setVisible(false); @@ -91,6 +93,7 @@ public class MiCasaApplet extends Applet /** * Display the client frame and really get things going. */ + @Override public void start () { if (_client != null) { @@ -106,6 +109,7 @@ public class MiCasaApplet extends Applet /** * Log off and shut on down. */ + @Override public void stop () { if (_client != null) { diff --git a/src/java/com/threerings/micasa/client/MiCasaClient.java b/src/java/com/threerings/micasa/client/MiCasaClient.java index d61163cb..2c4882fa 100644 --- a/src/java/com/threerings/micasa/client/MiCasaClient.java +++ b/src/java/com/threerings/micasa/client/MiCasaClient.java @@ -74,6 +74,7 @@ public class MiCasaClient // log off when they close the window _frame.addWindowListener(new WindowAdapter() { + @Override public void windowClosing (WindowEvent evt) { // if we're logged on, log off if (_client.isLoggedOn()) { diff --git a/src/java/com/threerings/micasa/lobby/LobbyConfig.java b/src/java/com/threerings/micasa/lobby/LobbyConfig.java index cf718ca0..3912886e 100644 --- a/src/java/com/threerings/micasa/lobby/LobbyConfig.java +++ b/src/java/com/threerings/micasa/lobby/LobbyConfig.java @@ -34,13 +34,13 @@ import com.threerings.parlor.game.data.GameConfig; public class LobbyConfig extends PlaceConfig { - // documentation inherited + @Override public PlaceController createController () { return new LobbyController(); } - // documentation inherited + @Override public String getManagerClassName () { return "com.threerings.micasa.lobby.LobbyManager"; @@ -79,7 +79,7 @@ public class LobbyConfig extends PlaceConfig _gameConfigClass = getConfigValue(config, "game_config"); } - // documentation inherited + @Override protected void toString (StringBuilder buf) { super.toString(buf); diff --git a/src/java/com/threerings/micasa/lobby/LobbyController.java b/src/java/com/threerings/micasa/lobby/LobbyController.java index 0fa417d3..4c612cd9 100644 --- a/src/java/com/threerings/micasa/lobby/LobbyController.java +++ b/src/java/com/threerings/micasa/lobby/LobbyController.java @@ -39,6 +39,7 @@ import static com.threerings.micasa.Log.log; public class LobbyController extends PlaceController implements InvitationHandler, InvitationResponseObserver { + @Override public void init (CrowdContext ctx, PlaceConfig config) { // cast our context reference @@ -51,12 +52,13 @@ public class LobbyController extends PlaceController _ctx.getParlorDirector().setInvitationHandler(this); } + @Override protected PlaceView createPlaceView (CrowdContext ctx) { return new LobbyPanel(_ctx, _config); } - // documentation inherited + @Override public void willEnterPlace (PlaceObject plobj) { super.willEnterPlace(plobj); diff --git a/src/java/com/threerings/micasa/lobby/LobbyDispatcher.java b/src/java/com/threerings/micasa/lobby/LobbyDispatcher.java index bde19330..ba392ebb 100644 --- a/src/java/com/threerings/micasa/lobby/LobbyDispatcher.java +++ b/src/java/com/threerings/micasa/lobby/LobbyDispatcher.java @@ -22,7 +22,6 @@ package com.threerings.micasa.lobby; import com.threerings.presents.data.ClientObject; -import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationException; diff --git a/src/java/com/threerings/micasa/lobby/LobbyMarshaller.java b/src/java/com/threerings/micasa/lobby/LobbyMarshaller.java index 735b251a..a3283340 100644 --- a/src/java/com/threerings/micasa/lobby/LobbyMarshaller.java +++ b/src/java/com/threerings/micasa/lobby/LobbyMarshaller.java @@ -24,7 +24,6 @@ package com.threerings.micasa.lobby; import com.threerings.presents.client.Client; import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.dobj.InvocationResponseEvent; -import com.threerings.presents.net.Transport; import java.util.List; /** diff --git a/src/java/com/threerings/micasa/lobby/LobbyProvider.java b/src/java/com/threerings/micasa/lobby/LobbyProvider.java index 25cef2cb..32c5da25 100644 --- a/src/java/com/threerings/micasa/lobby/LobbyProvider.java +++ b/src/java/com/threerings/micasa/lobby/LobbyProvider.java @@ -33,12 +33,12 @@ public interface LobbyProvider extends InvocationProvider /** * Handles a {@link LobbyService#getCategories} request. */ - public void getCategories (ClientObject caller, LobbyService.CategoriesListener arg1) + void getCategories (ClientObject caller, LobbyService.CategoriesListener arg1) throws InvocationException; /** * Handles a {@link LobbyService#getLobbies} request. */ - public void getLobbies (ClientObject caller, String arg1, LobbyService.LobbiesListener arg2) + void getLobbies (ClientObject caller, String arg1, LobbyService.LobbiesListener arg2) throws InvocationException; } diff --git a/src/java/com/threerings/micasa/lobby/LobbySelector.java b/src/java/com/threerings/micasa/lobby/LobbySelector.java index dfd640ba..da424386 100644 --- a/src/java/com/threerings/micasa/lobby/LobbySelector.java +++ b/src/java/com/threerings/micasa/lobby/LobbySelector.java @@ -68,6 +68,7 @@ public class LobbySelector extends JPanel _loblist.setCellRenderer(new LobbyCellRenderer()); // add a mouse listener that tells us about double clicks MouseListener ml = new MouseAdapter() { + @Override public void mouseClicked (MouseEvent e) { if (e.getClickCount() == 2) { int index = _loblist.locationToIndex(e.getPoint()); @@ -80,7 +81,7 @@ public class LobbySelector extends JPanel add(_loblist, BorderLayout.CENTER); } - // documentation inherited + @Override public void addNotify () { super.addNotify(); @@ -193,6 +194,7 @@ public class LobbySelector extends JPanel protected static class LobbyCellRenderer extends DefaultListCellRenderer { + @Override public Component getListCellRendererComponent( JList list, Object value, diff --git a/src/java/com/threerings/micasa/lobby/table/TableListView.java b/src/java/com/threerings/micasa/lobby/table/TableListView.java index 063fd17e..7ac22277 100644 --- a/src/java/com/threerings/micasa/lobby/table/TableListView.java +++ b/src/java/com/threerings/micasa/lobby/table/TableListView.java @@ -21,7 +21,6 @@ package com.threerings.micasa.lobby.table; -import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Iterator; diff --git a/src/java/com/threerings/micasa/lobby/table/TableLobbyConfig.java b/src/java/com/threerings/micasa/lobby/table/TableLobbyConfig.java index 1b5e7442..f158dea8 100644 --- a/src/java/com/threerings/micasa/lobby/table/TableLobbyConfig.java +++ b/src/java/com/threerings/micasa/lobby/table/TableLobbyConfig.java @@ -31,13 +31,13 @@ import com.threerings.micasa.util.MiCasaContext; */ public class TableLobbyConfig extends LobbyConfig { - // documentation inherited + @Override public String getManagerClassName () { return "com.threerings.micasa.lobby.table.TableLobbyManager"; } - // documentation inherited + @Override public JComponent createMatchMakingView (MiCasaContext ctx) { return new TableListView(ctx, this); diff --git a/src/java/com/threerings/micasa/lobby/table/TableLobbyManager.java b/src/java/com/threerings/micasa/lobby/table/TableLobbyManager.java index 72625263..4fe8c8a8 100644 --- a/src/java/com/threerings/micasa/lobby/table/TableLobbyManager.java +++ b/src/java/com/threerings/micasa/lobby/table/TableLobbyManager.java @@ -30,7 +30,7 @@ import com.threerings.micasa.lobby.LobbyManager; */ public class TableLobbyManager extends LobbyManager { - // documentation inherited + @Override protected void didStartup () { super.didStartup(); @@ -38,7 +38,7 @@ public class TableLobbyManager extends LobbyManager _tmgr = new TableManager(_omgr, _invmgr, _registry, getPlaceObject()); } - // documentation inherited + @Override protected void didShutdown () { super.didShutdown(); @@ -46,7 +46,7 @@ public class TableLobbyManager extends LobbyManager _tmgr.shutdown(); } - // documentation inherited + @Override protected PlaceObject createPlaceObject () { return new TableLobbyObject(); diff --git a/src/java/com/threerings/micasa/simulator/client/SimpleClient.java b/src/java/com/threerings/micasa/simulator/client/SimpleClient.java index c26db5d8..5e1df539 100644 --- a/src/java/com/threerings/micasa/simulator/client/SimpleClient.java +++ b/src/java/com/threerings/micasa/simulator/client/SimpleClient.java @@ -72,6 +72,7 @@ public class SimpleClient // log off when they close the window _frame.getFrame().addWindowListener(new WindowAdapter() { + @Override public void windowClosing (WindowEvent evt) { // if we're logged on, log off if (_client.isLoggedOn()) { diff --git a/src/java/com/threerings/micasa/simulator/client/SimulatorApp.java b/src/java/com/threerings/micasa/simulator/client/SimulatorApp.java index d3ed4c65..5b951f01 100644 --- a/src/java/com/threerings/micasa/simulator/client/SimulatorApp.java +++ b/src/java/com/threerings/micasa/simulator/client/SimulatorApp.java @@ -125,10 +125,12 @@ public class SimulatorApp // we want to exit when we logged off or failed to log on client.addClientObserver(new ClientAdapter() { + @Override public void clientFailedToLogon (Client c, Exception cause) { log.info("Client failed to logon: " + cause); System.exit(0); } + @Override public void clientDidLogoff (Client c) { System.exit(0); } @@ -156,6 +158,7 @@ public class SimulatorApp // in normal circumstances they are entirely different processes; // so we just wait half a second which does the job new Interval() { + @Override public void expired () { _client.getParlorContext().getClient().logon(); } @@ -210,6 +213,7 @@ public class SimulatorApp _server = server; } + @Override public void run () { _server.run(); diff --git a/src/java/com/threerings/micasa/simulator/client/SimulatorController.java b/src/java/com/threerings/micasa/simulator/client/SimulatorController.java index 8c815aa3..cea41c88 100644 --- a/src/java/com/threerings/micasa/simulator/client/SimulatorController.java +++ b/src/java/com/threerings/micasa/simulator/client/SimulatorController.java @@ -63,7 +63,7 @@ public class SimulatorController extends Controller _ctx.getClient().addClientObserver(this); } - // documentation inherited + @Override public boolean handleAction (ActionEvent action) { String cmd = action.getActionCommand(); diff --git a/src/java/com/threerings/micasa/simulator/data/SimulatorInfo.java b/src/java/com/threerings/micasa/simulator/data/SimulatorInfo.java index 811dc473..1f4b62d7 100644 --- a/src/java/com/threerings/micasa/simulator/data/SimulatorInfo.java +++ b/src/java/com/threerings/micasa/simulator/data/SimulatorInfo.java @@ -32,6 +32,7 @@ public class SimulatorInfo /** The number of players in the game. */ public int playerCount; + @Override public String toString () { return "[gameConfigClass=" + gameConfigClass + diff --git a/src/java/com/threerings/micasa/simulator/data/SimulatorMarshaller.java b/src/java/com/threerings/micasa/simulator/data/SimulatorMarshaller.java index b829a43f..b9a7e715 100644 --- a/src/java/com/threerings/micasa/simulator/data/SimulatorMarshaller.java +++ b/src/java/com/threerings/micasa/simulator/data/SimulatorMarshaller.java @@ -25,7 +25,6 @@ import com.threerings.micasa.simulator.client.SimulatorService; import com.threerings.parlor.game.data.GameConfig; import com.threerings.presents.client.Client; import com.threerings.presents.data.InvocationMarshaller; -import com.threerings.presents.net.Transport; /** * Provides the implementation of the {@link SimulatorService} interface diff --git a/src/java/com/threerings/micasa/simulator/server/SimulatorDispatcher.java b/src/java/com/threerings/micasa/simulator/server/SimulatorDispatcher.java index 2efd2931..cbaf072b 100644 --- a/src/java/com/threerings/micasa/simulator/server/SimulatorDispatcher.java +++ b/src/java/com/threerings/micasa/simulator/server/SimulatorDispatcher.java @@ -24,7 +24,6 @@ package com.threerings.micasa.simulator.server; import com.threerings.micasa.simulator.data.SimulatorMarshaller; import com.threerings.parlor.game.data.GameConfig; import com.threerings.presents.data.ClientObject; -import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationException; diff --git a/src/java/com/threerings/micasa/simulator/server/SimulatorManager.java b/src/java/com/threerings/micasa/simulator/server/SimulatorManager.java index 6e8d63f8..22fd6d59 100644 --- a/src/java/com/threerings/micasa/simulator/server/SimulatorManager.java +++ b/src/java/com/threerings/micasa/simulator/server/SimulatorManager.java @@ -35,9 +35,7 @@ import com.threerings.presents.server.ClientResolutionListener; import com.threerings.presents.server.InvocationManager; import com.threerings.crowd.data.BodyObject; -import com.threerings.crowd.data.PlaceObject; import com.threerings.crowd.server.LocationManager; -import com.threerings.crowd.server.PlaceManager; import com.threerings.crowd.server.PlaceRegistry; import com.threerings.parlor.game.data.GameAI; diff --git a/src/java/com/threerings/parlor/card/client/CardGameController.java b/src/java/com/threerings/parlor/card/client/CardGameController.java index efeff325..8676e585 100644 --- a/src/java/com/threerings/parlor/card/client/CardGameController.java +++ b/src/java/com/threerings/parlor/card/client/CardGameController.java @@ -40,7 +40,7 @@ import static com.threerings.parlor.card.Log.log; public abstract class CardGameController extends GameController implements TurnGameController, CardCodes, CardGameReceiver { - // Documentation inherited. + @Override public void willEnterPlace (PlaceObject plobj) { if (_ctx.getClient().getClientObject().receivers.containsKey( @@ -56,7 +56,7 @@ public abstract class CardGameController extends GameController super.willEnterPlace(plobj); } - // Documentation inherited. + @Override public void didLeavePlace (PlaceObject plobj) { super.didLeavePlace(plobj); diff --git a/src/java/com/threerings/parlor/card/client/CardPanel.java b/src/java/com/threerings/parlor/card/client/CardPanel.java index 972fdd8b..e8a61f26 100644 --- a/src/java/com/threerings/parlor/card/client/CardPanel.java +++ b/src/java/com/threerings/parlor/card/client/CardPanel.java @@ -45,15 +45,10 @@ import com.threerings.media.sprite.Sprite; import com.threerings.media.util.LinePath; import com.threerings.media.util.Path; import com.threerings.media.util.PathSequence; -import com.threerings.media.util.Pathable; - import com.threerings.parlor.card.data.Card; import com.threerings.parlor.card.data.CardCodes; -import com.threerings.parlor.card.data.Deck; import com.threerings.parlor.card.data.Hand; -import static com.threerings.parlor.card.Log.log; - /** * Extends VirtualMediaPanel to provide services specific to rendering and manipulating playing * cards. @@ -842,7 +837,7 @@ public abstract class CardPanel extends VirtualMediaPanel } } - // documentation inherited + @Override protected void paintBehind (Graphics2D gfx, Rectangle dirtyRect) { gfx.setColor(DEFAULT_BACKGROUND); @@ -854,6 +849,7 @@ public abstract class CardPanel extends VirtualMediaPanel protected class HandSpriteObserver extends PathAdapter implements CardSpriteObserver { + @Override public void pathCompleted (Sprite sprite, Path path, long when) { updateActiveCardSprite(); @@ -897,6 +893,7 @@ public abstract class CardPanel extends VirtualMediaPanel /** Listens for mouse interactions with cards. */ protected class CardListener extends MouseInputAdapter { + @Override public void mousePressed (MouseEvent me) { if (_activeCardSprite != null && @@ -907,6 +904,7 @@ public abstract class CardPanel extends VirtualMediaPanel } } + @Override public void mouseReleased (MouseEvent me) { if (_activeCardSprite != null && @@ -918,6 +916,7 @@ public abstract class CardPanel extends VirtualMediaPanel } } + @Override public void mouseClicked (MouseEvent me) { if (_activeCardSprite != null && @@ -928,6 +927,7 @@ public abstract class CardPanel extends VirtualMediaPanel } } + @Override public void mouseMoved (MouseEvent me) { _mouseEvent = me; @@ -935,6 +935,7 @@ public abstract class CardPanel extends VirtualMediaPanel updateActiveCardSprite(); } + @Override public void mouseDragged (MouseEvent me) { _mouseEvent = me; @@ -953,11 +954,13 @@ public abstract class CardPanel extends VirtualMediaPanel } } + @Override public void mouseEntered (MouseEvent me) { _mouseEvent = me; } + @Override public void mouseExited (MouseEvent me) { _mouseEvent = me; @@ -1106,6 +1109,7 @@ public abstract class CardPanel extends VirtualMediaPanel /** A path observer that removes the sprite at the end of its path. */ protected PathAdapter _pathEndRemover = new PathAdapter() { + @Override public void pathCompleted (Sprite sprite, Path path, long when) { removeSprite(sprite); } diff --git a/src/java/com/threerings/parlor/card/client/CardSprite.java b/src/java/com/threerings/parlor/card/client/CardSprite.java index 68506d7d..6a69a155 100644 --- a/src/java/com/threerings/parlor/card/client/CardSprite.java +++ b/src/java/com/threerings/parlor/card/client/CardSprite.java @@ -24,11 +24,7 @@ package com.threerings.parlor.card.client; import java.awt.Graphics2D; import java.awt.geom.AffineTransform; -import com.threerings.media.AbstractMedia; -import com.threerings.media.image.Mirage; import com.threerings.media.sprite.FadableImageSprite; -import com.threerings.media.util.Path; - import com.threerings.parlor.card.data.Card; /** @@ -144,7 +140,7 @@ public class CardSprite extends FadableImageSprite _scaleFactor = 1.0; } - // Documentation inherited. + @Override public void tick (long tickStamp) { super.tick(tickStamp); @@ -183,7 +179,7 @@ public class CardSprite extends FadableImageSprite } - // Documentation inherited. + @Override public void paint (Graphics2D gfx) { if (_scaleFactor <= 0) { diff --git a/src/java/com/threerings/parlor/card/client/MicroCardSprite.java b/src/java/com/threerings/parlor/card/client/MicroCardSprite.java index a4db5167..d9419750 100644 --- a/src/java/com/threerings/parlor/card/client/MicroCardSprite.java +++ b/src/java/com/threerings/parlor/card/client/MicroCardSprite.java @@ -49,9 +49,7 @@ public class MicroCardSprite extends CardSprite super(panel, card, facingUp); } - /** - * Updates the mirage according to the current state. - */ + @Override protected void updateMirage () { setMirage((_card != null && _facingUp ) ? diff --git a/src/java/com/threerings/parlor/card/data/Card.java b/src/java/com/threerings/parlor/card/data/Card.java index dd323ac1..a4196dc9 100644 --- a/src/java/com/threerings/parlor/card/data/Card.java +++ b/src/java/com/threerings/parlor/card/data/Card.java @@ -21,10 +21,6 @@ package com.threerings.parlor.card.data; -import java.io.IOException; - -import com.threerings.io.ObjectInputStream; -import com.threerings.io.ObjectOutputStream; import com.threerings.util.ActionScript; import com.threerings.presents.dobj.DSet; @@ -144,22 +140,13 @@ public class Card implements DSet.Entry, Comparable, CardCodes return _key; } - /** - * Returns a hash code for this card. - * - * @return this card's hash code - */ + @Override public int hashCode () { return _value; } - /** - * Checks this card for equality with another. - * - * @param other the other card to compare - * @return true if the cards are equal, false otherwise - */ + @Override public boolean equals (Object other) { if (other instanceof Card) { @@ -193,11 +180,7 @@ public class Card implements DSet.Entry, Comparable, CardCodes } } - /** - * Returns a string representation of this card. - * - * @return a description of this card - */ + @Override public String toString () { int number = getNumber(); diff --git a/src/java/com/threerings/parlor/card/server/CardGameManager.java b/src/java/com/threerings/parlor/card/server/CardGameManager.java index bfcf05b4..34434aec 100644 --- a/src/java/com/threerings/parlor/card/server/CardGameManager.java +++ b/src/java/com/threerings/parlor/card/server/CardGameManager.java @@ -21,7 +21,6 @@ package com.threerings.parlor.card.server; -import com.threerings.crowd.data.BodyObject; import com.threerings.crowd.data.OccupantInfo; import com.threerings.crowd.server.OccupantOp; @@ -34,12 +33,7 @@ import com.threerings.parlor.game.data.GameObject; import com.threerings.parlor.game.server.GameManager; import com.threerings.parlor.turn.server.TurnGameManager; -import com.threerings.presents.client.InvocationService.ConfirmListener; import com.threerings.presents.data.ClientObject; -import com.threerings.presents.dobj.MessageEvent; -import com.threerings.presents.server.InvocationException; - -import static com.threerings.parlor.card.Log.log; /** * A manager class for card games. Handles common functions like dealing @@ -48,7 +42,7 @@ import static com.threerings.parlor.card.Log.log; public class CardGameManager extends GameManager implements TurnGameManager, CardCodes { - // Documentation inherited. + @Override protected void didStartup () { super.didStartup(); @@ -67,7 +61,7 @@ public class CardGameManager extends GameManager public void turnDidEnd () {} - @Override // documentation inherited + @Override protected void gameDidEnd () { // Copy off our player oids so we have them handy to see if somebody was a player for diff --git a/src/java/com/threerings/parlor/card/server/CardGameSender.java b/src/java/com/threerings/parlor/card/server/CardGameSender.java index aac79f92..7e4c55b5 100644 --- a/src/java/com/threerings/parlor/card/server/CardGameSender.java +++ b/src/java/com/threerings/parlor/card/server/CardGameSender.java @@ -26,7 +26,6 @@ import com.threerings.parlor.card.client.CardGameReceiver; import com.threerings.parlor.card.data.Card; import com.threerings.parlor.card.data.Hand; import com.threerings.presents.data.ClientObject; -import com.threerings.presents.net.Transport; import com.threerings.presents.server.InvocationSender; /** diff --git a/src/java/com/threerings/parlor/card/trick/data/TrickCardGameMarshaller.java b/src/java/com/threerings/parlor/card/trick/data/TrickCardGameMarshaller.java index 11ddff94..be4454a1 100644 --- a/src/java/com/threerings/parlor/card/trick/data/TrickCardGameMarshaller.java +++ b/src/java/com/threerings/parlor/card/trick/data/TrickCardGameMarshaller.java @@ -25,7 +25,6 @@ import com.threerings.parlor.card.data.Card; import com.threerings.parlor.card.trick.client.TrickCardGameService; import com.threerings.presents.client.Client; import com.threerings.presents.data.InvocationMarshaller; -import com.threerings.presents.net.Transport; /** * Provides the implementation of the {@link TrickCardGameService} interface diff --git a/src/java/com/threerings/parlor/card/trick/server/TrickCardGameDispatcher.java b/src/java/com/threerings/parlor/card/trick/server/TrickCardGameDispatcher.java index 9a66417c..a016c2ca 100644 --- a/src/java/com/threerings/parlor/card/trick/server/TrickCardGameDispatcher.java +++ b/src/java/com/threerings/parlor/card/trick/server/TrickCardGameDispatcher.java @@ -24,7 +24,6 @@ package com.threerings.parlor.card.trick.server; import com.threerings.parlor.card.data.Card; import com.threerings.parlor.card.trick.data.TrickCardGameMarshaller; import com.threerings.presents.data.ClientObject; -import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationException; diff --git a/src/java/com/threerings/parlor/card/trick/server/TrickCardGameManagerDelegate.java b/src/java/com/threerings/parlor/card/trick/server/TrickCardGameManagerDelegate.java index 50dc3a05..838b33d0 100644 --- a/src/java/com/threerings/parlor/card/trick/server/TrickCardGameManagerDelegate.java +++ b/src/java/com/threerings/parlor/card/trick/server/TrickCardGameManagerDelegate.java @@ -67,14 +67,14 @@ public class TrickCardGameManagerDelegate extends TurnGameManagerDelegate { } - @Override // from PlaceManagerDelegate + @Override public void didInit (PlaceConfig config) { super.didInit(config); _cgmgr = (CardGameManager)_plmgr; } - @Override // from PlaceManagerDelegate + @Override public void didStartup (PlaceObject plobj) { super.didStartup(plobj); @@ -86,7 +86,7 @@ public class TrickCardGameManagerDelegate extends TurnGameManagerDelegate _invmgr.registerDispatcher(new TrickCardGameDispatcher(this))); } - @Override // from PlaceManagerDelegate + @Override public void didShutdown () { super.didShutdown(); @@ -94,7 +94,7 @@ public class TrickCardGameManagerDelegate extends TurnGameManagerDelegate _invmgr.clearDispatcher(_trickCardGame.getTrickCardGameService()); } - @Override // from GameManagerDelegate + @Override public void gameWillStart () { super.gameWillStart(); @@ -111,6 +111,7 @@ public class TrickCardGameManagerDelegate extends TurnGameManagerDelegate /** * Called when the game has started. Default implementation starts the first hand. */ + @Override public void gameDidStart () { super.gameDidStart(); @@ -119,7 +120,7 @@ public class TrickCardGameManagerDelegate extends TurnGameManagerDelegate startHand(); } - @Override // from GameManagerDelegate + @Override public void gameDidEnd () { super.gameDidEnd(); @@ -137,7 +138,7 @@ public class TrickCardGameManagerDelegate extends TurnGameManagerDelegate _trickCardGame.setRematchRequests(new int[_cardGame.getPlayerCount()]); } - @Override // from TurnGameManagerDelegate + @Override public void startTurn () { super.startTurn(); @@ -147,7 +148,7 @@ public class TrickCardGameManagerDelegate extends TurnGameManagerDelegate _turnTimeoutInterval.schedule(_trickCardGame.getTurnDuration()); } - @Override // from TurnGameManagerDelegate + @Override public void endTurn () { // cancel the timeout interval @@ -376,7 +377,7 @@ public class TrickCardGameManagerDelegate extends TurnGameManagerDelegate return _trickCardGame.getCardsPlayed().length == _cardGame.getPlayerCount(); } - @Override // from TurnGameManagerDelegate + @Override protected void setFirstTurnHolder () { if (_trickCardGame.getTrickState() == TrickCardGameObject.PLAYING_TRICK) { @@ -387,7 +388,7 @@ public class TrickCardGameManagerDelegate extends TurnGameManagerDelegate } } - @Override // from TurnGameManagerDelegate + @Override protected void setNextTurnHolder () { if (_trickCardGame.getTrickState() == TrickCardGameObject.PLAYING_TRICK && @@ -571,6 +572,7 @@ public class TrickCardGameManagerDelegate extends TurnGameManagerDelegate /** The all-purpose turn timeout interval. */ protected Interval _turnTimeoutInterval = new Interval(_omgr) { + @Override public void expired () { _turnTimedOut = true; turnTimedOut(); @@ -579,6 +581,7 @@ public class TrickCardGameManagerDelegate extends TurnGameManagerDelegate /** Calls {@link #endTrick} upon expiration. */ protected Interval _endTrickInterval = new Interval(_omgr) { + @Override public void expired () { endTrick(); } diff --git a/src/java/com/threerings/parlor/card/trick/server/TrickCardGameProvider.java b/src/java/com/threerings/parlor/card/trick/server/TrickCardGameProvider.java index 6113647f..cee895fa 100644 --- a/src/java/com/threerings/parlor/card/trick/server/TrickCardGameProvider.java +++ b/src/java/com/threerings/parlor/card/trick/server/TrickCardGameProvider.java @@ -33,15 +33,15 @@ public interface TrickCardGameProvider extends InvocationProvider /** * Handles a {@link TrickCardGameService#playCard} request. */ - public void playCard (ClientObject caller, Card arg1, int arg2); + void playCard (ClientObject caller, Card arg1, int arg2); /** * Handles a {@link TrickCardGameService#requestRematch} request. */ - public void requestRematch (ClientObject caller); + void requestRematch (ClientObject caller); /** * Handles a {@link TrickCardGameService#sendCardsToPlayer} request. */ - public void sendCardsToPlayer (ClientObject caller, int arg1, Card[] arg2); + void sendCardsToPlayer (ClientObject caller, int arg1, Card[] arg2); } diff --git a/src/java/com/threerings/parlor/client/DefaultSwingTableConfigurator.java b/src/java/com/threerings/parlor/client/DefaultSwingTableConfigurator.java index c5402ce8..1c079e1c 100644 --- a/src/java/com/threerings/parlor/client/DefaultSwingTableConfigurator.java +++ b/src/java/com/threerings/parlor/client/DefaultSwingTableConfigurator.java @@ -23,16 +23,8 @@ package com.threerings.parlor.client; import javax.swing.JCheckBox; import javax.swing.JLabel; -import javax.swing.JPanel; - import com.samskivert.swing.SimpleSlider; -import com.samskivert.swing.VGroupLayout; - -import com.threerings.parlor.data.TableConfig; -import com.threerings.parlor.util.ParlorContext; - import com.threerings.parlor.game.client.SwingGameConfigurator; -import com.threerings.parlor.game.data.GameConfig; /** * Provides a default implementation of a TableConfigurator for @@ -83,7 +75,7 @@ public class DefaultSwingTableConfigurator extends TableConfigurator } } - // documentation inherited + @Override protected void createConfigInterface () { super.createConfigInterface(); @@ -101,13 +93,13 @@ public class DefaultSwingTableConfigurator extends TableConfigurator } } - // documentation inherited + @Override public boolean isEmpty () { return (_playerSlider == null) && (_privateCheck == null); } - // documentation inherited + @Override protected void flushTableConfig() { super.flushTableConfig(); diff --git a/src/java/com/threerings/parlor/client/Invitation.java b/src/java/com/threerings/parlor/client/Invitation.java index ae6bce66..4272d813 100644 --- a/src/java/com/threerings/parlor/client/Invitation.java +++ b/src/java/com/threerings/parlor/client/Invitation.java @@ -186,7 +186,7 @@ public class Invitation } } - /** Returns a string representation of this invitation record. */ + @Override public String toString () { return "[inviteId=" + inviteId + ", opponent=" + opponent + diff --git a/src/java/com/threerings/parlor/client/ParlorDirector.java b/src/java/com/threerings/parlor/client/ParlorDirector.java index 5bc99b50..5f3431fb 100644 --- a/src/java/com/threerings/parlor/client/ParlorDirector.java +++ b/src/java/com/threerings/parlor/client/ParlorDirector.java @@ -122,7 +122,7 @@ public class ParlorDirector extends BasicDirector _pservice.startSolitaire(_ctx.getClient(), config, listener); } - // documentation inherited + @Override public void clientDidLogoff (Client client) { super.clientDidLogoff(client); @@ -188,13 +188,13 @@ public class ParlorDirector extends BasicDirector // TBD } - @Override // from BasicDirector + @Override protected void registerServices (Client client) { client.addServiceGroup(PARLOR_GROUP); } - @Override // from BasicDirector + @Override protected void fetchServices (Client client) { // get a handle on our parlor services diff --git a/src/java/com/threerings/parlor/client/TableDirector.java b/src/java/com/threerings/parlor/client/TableDirector.java index d3945056..df77149c 100644 --- a/src/java/com/threerings/parlor/client/TableDirector.java +++ b/src/java/com/threerings/parlor/client/TableDirector.java @@ -219,7 +219,7 @@ public class TableDirector extends BasicDirector _tlobj.getTableService().startTableNow(_ctx.getClient(), tableId, this); } - // documentation inherited + @Override public void clientDidLogoff (Client client) { super.clientDidLogoff(client); diff --git a/src/java/com/threerings/parlor/data/Parameter.java b/src/java/com/threerings/parlor/data/Parameter.java index 826439d3..837ac750 100644 --- a/src/java/com/threerings/parlor/data/Parameter.java +++ b/src/java/com/threerings/parlor/data/Parameter.java @@ -29,7 +29,7 @@ public abstract class Parameter implements Streamable /** Returns the default value of this parameter. */ public abstract Object getDefaultValue (); - /** Generates a string representation of this instance. */ + @Override public String toString () { return StringUtil.fieldsToString(this); diff --git a/src/java/com/threerings/parlor/data/ParlorMarshaller.java b/src/java/com/threerings/parlor/data/ParlorMarshaller.java index e32c2b18..3db5da8f 100644 --- a/src/java/com/threerings/parlor/data/ParlorMarshaller.java +++ b/src/java/com/threerings/parlor/data/ParlorMarshaller.java @@ -27,7 +27,6 @@ import com.threerings.presents.client.Client; import com.threerings.presents.client.InvocationService; import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.dobj.InvocationResponseEvent; -import com.threerings.presents.net.Transport; import com.threerings.util.Name; /** diff --git a/src/java/com/threerings/parlor/data/Table.java b/src/java/com/threerings/parlor/data/Table.java index 924e2d2f..4f8ab894 100644 --- a/src/java/com/threerings/parlor/data/Table.java +++ b/src/java/com/threerings/parlor/data/Table.java @@ -385,21 +385,19 @@ public class Table return tableId; } - // documentation inherited + @Override public boolean equals (Object other) { return (other instanceof Table) && (tableId == ((Table) other).tableId); } - // documentation inherited + @Override public int hashCode () { return tableId; } - /** - * Generates a string representation of this table instance. - */ + @Override public String toString () { StringBuilder buf = new StringBuilder(); diff --git a/src/java/com/threerings/parlor/data/TableMarshaller.java b/src/java/com/threerings/parlor/data/TableMarshaller.java index 3d751d4f..a2cc3cce 100644 --- a/src/java/com/threerings/parlor/data/TableMarshaller.java +++ b/src/java/com/threerings/parlor/data/TableMarshaller.java @@ -26,7 +26,6 @@ import com.threerings.parlor.game.data.GameConfig; import com.threerings.presents.client.Client; import com.threerings.presents.client.InvocationService; import com.threerings.presents.data.InvocationMarshaller; -import com.threerings.presents.net.Transport; /** * Provides the implementation of the {@link TableService} interface diff --git a/src/java/com/threerings/parlor/game/client/GameController.java b/src/java/com/threerings/parlor/game/client/GameController.java index 85da607e..f4e14436 100644 --- a/src/java/com/threerings/parlor/game/client/GameController.java +++ b/src/java/com/threerings/parlor/game/client/GameController.java @@ -61,6 +61,7 @@ public abstract class GameController extends PlaceController * @param config the configuration of the game we are intended to * control. */ + @Override public void init (CrowdContext ctx, PlaceConfig config) { // cast our references before we call super.init() so that when super.init() calls @@ -75,6 +76,7 @@ public abstract class GameController extends PlaceController * Adds this controller as a listener to the game object (thus derived classes need not do so) * and lets the game manager know that we are now ready to go. */ + @Override public void willEnterPlace (PlaceObject plobj) { super.willEnterPlace(plobj); @@ -109,6 +111,7 @@ public abstract class GameController extends PlaceController /** * Removes our listener registration from the game object and cleans house. */ + @Override public void didLeavePlace (PlaceObject plobj) { super.didLeavePlace(plobj); @@ -174,6 +177,7 @@ public abstract class GameController extends PlaceController * Handles basic game controller action events. Derived classes should be sure to call * super.handleAction for events they don't specifically handle. */ + @Override public boolean handleAction (ActionEvent action) { return super.handleAction(action); @@ -249,6 +253,7 @@ public abstract class GameController extends PlaceController // let our delegates do their business applyToDelegates(new DelegateOp(GameControllerDelegate.class) { + @Override public void apply (PlaceControllerDelegate delegate) { ((GameControllerDelegate)delegate).gameDidStart(); } @@ -263,6 +268,7 @@ public abstract class GameController extends PlaceController { // let our delegates do their business applyToDelegates(new DelegateOp(GameControllerDelegate.class) { + @Override public void apply (PlaceControllerDelegate delegate) { ((GameControllerDelegate)delegate).gameDidEnd(); } @@ -276,6 +282,7 @@ public abstract class GameController extends PlaceController { // let our delegates do their business applyToDelegates(new DelegateOp(GameControllerDelegate.class) { + @Override public void apply (PlaceControllerDelegate delegate) { ((GameControllerDelegate)delegate).gameWasCancelled(); } @@ -290,6 +297,7 @@ public abstract class GameController extends PlaceController { // let our delegates do their business applyToDelegates(new DelegateOp(GameControllerDelegate.class) { + @Override public void apply (PlaceControllerDelegate delegate) { ((GameControllerDelegate)delegate).gameWillReset(); } diff --git a/src/java/com/threerings/parlor/game/client/SwingGameConfigurator.java b/src/java/com/threerings/parlor/game/client/SwingGameConfigurator.java index e45170f8..041d428c 100644 --- a/src/java/com/threerings/parlor/game/client/SwingGameConfigurator.java +++ b/src/java/com/threerings/parlor/game/client/SwingGameConfigurator.java @@ -28,10 +28,7 @@ import java.awt.Insets; import javax.swing.JComponent; import javax.swing.JPanel; -import com.samskivert.swing.VGroupLayout; - import com.threerings.parlor.game.data.GameConfig; -import com.threerings.parlor.util.ParlorContext; /** * Provides the base from which interfaces can be built to configure games diff --git a/src/java/com/threerings/parlor/game/data/GameConfig.java b/src/java/com/threerings/parlor/game/data/GameConfig.java index a8085041..f3797e33 100644 --- a/src/java/com/threerings/parlor/game/data/GameConfig.java +++ b/src/java/com/threerings/parlor/game/data/GameConfig.java @@ -125,6 +125,7 @@ public abstract class GameConfig extends PlaceConfig implements Cloneable * Returns true if this game config object is equal to the supplied object (meaning it is a * game config for the same game and its configuration settings are the same as ours). */ + @Override public boolean equals (Object other) { if (!(other instanceof GameConfig)) { @@ -138,13 +139,14 @@ public abstract class GameConfig extends PlaceConfig implements Cloneable * Computes a hashcode for this game config object that supports our {@link #equals} * implementation. Objects that are equal should have the same hashcode. */ + @Override public int hashCode () { // look ma, it's so sophisticated! return getClass().hashCode() + (rated ? 1 : 0); } - // documentation inherited + @Override public Object clone () { try { diff --git a/src/java/com/threerings/parlor/game/data/GameObject.java b/src/java/com/threerings/parlor/game/data/GameObject.java index 7ea13eea..cd563012 100644 --- a/src/java/com/threerings/parlor/game/data/GameObject.java +++ b/src/java/com/threerings/parlor/game/data/GameObject.java @@ -238,7 +238,7 @@ public class GameObject extends PlaceObject return playerStatus == PLAYER_IN_PLAY; } - // documentation inherited + @Override protected void which (StringBuilder buf) { super.which(buf); diff --git a/src/java/com/threerings/parlor/game/server/GameManager.java b/src/java/com/threerings/parlor/game/server/GameManager.java index ba25ca8f..21f2d774 100644 --- a/src/java/com/threerings/parlor/game/server/GameManager.java +++ b/src/java/com/threerings/parlor/game/server/GameManager.java @@ -23,8 +23,6 @@ package com.threerings.parlor.game.server; import java.util.List; import java.util.Arrays; -import java.util.logging.Level; - import com.google.common.collect.Lists; import com.samskivert.util.ArrayIntSet; @@ -243,6 +241,7 @@ public class GameManager extends PlaceManager // notify our delegates applyToDelegates(new DelegateOp(GameManagerDelegate.class) { + @Override public void apply (PlaceManagerDelegate delegate) { ((GameManagerDelegate)delegate).playerWasReplaced(pidx, oplayer, player); } @@ -285,6 +284,7 @@ public class GameManager extends PlaceManager // let the delegates know that the player's been made an AI applyToDelegates(new DelegateOp(GameManagerDelegate.class) { + @Override public void apply (PlaceManagerDelegate delegate) { ((GameManagerDelegate)delegate).setAI(pidx, ai); } @@ -730,7 +730,7 @@ public class GameManager extends PlaceManager } } - @Override // from PlaceManager + @Override protected void didInit () { super.didInit(); @@ -740,6 +740,7 @@ public class GameManager extends PlaceManager // start up our tick interval _tickInterval = new Interval(_omgr) { + @Override public void expired () { tick(System.currentTimeMillis()); } @@ -754,7 +755,7 @@ public class GameManager extends PlaceManager } } - @Override // from PlaceManager + @Override protected void didStartup () { // obtain a casted reference to our game object @@ -799,6 +800,7 @@ public class GameManager extends PlaceManager // start up a no-show timer if needed if (needsNoShowTimer()) { _noShowInterval = new Interval(_omgr) { + @Override public void expired () { checkForNoShows(); } @@ -807,7 +809,7 @@ public class GameManager extends PlaceManager } } - @Override // from PlaceManager + @Override protected void didShutdown () { super.didShutdown(); @@ -822,7 +824,7 @@ public class GameManager extends PlaceManager } } - @Override // from PlaceManager + @Override protected void bodyLeft (int bodyOid) { // first resign the player from the game @@ -878,7 +880,7 @@ public class GameManager extends PlaceManager } } - @Override // from GameManager + @Override protected void checkShutdownInterval () { // PlaceManager will attempt to set up an idle shutdown interval when it is first created @@ -975,6 +977,7 @@ public class GameManager extends PlaceManager // let our delegates do their business applyToDelegates(new DelegateOp(GameManagerDelegate.class) { + @Override public void apply (PlaceManagerDelegate delegate) { ((GameManagerDelegate)delegate).gameWillStart(); } @@ -1035,6 +1038,7 @@ public class GameManager extends PlaceManager // let our delegates do their business applyToDelegates(new DelegateOp(GameManagerDelegate.class) { + @Override public void apply (PlaceManagerDelegate delegate) { ((GameManagerDelegate)delegate).gameDidStart(); } @@ -1071,6 +1075,7 @@ public class GameManager extends PlaceManager { if (_aiTicker == null) { _aiTicker = new Interval(_omgr) { + @Override public void expired () { tickAIs(); } @@ -1108,6 +1113,7 @@ public class GameManager extends PlaceManager protected void tickAI (final int pidx, final GameAI ai) { applyToDelegates(new DelegateOp(GameManagerDelegate.class) { + @Override public void apply (PlaceManagerDelegate delegate) { ((GameManagerDelegate) delegate).tickAI(pidx, ai); } @@ -1174,6 +1180,7 @@ public class GameManager extends PlaceManager { // let our delegates do their business applyToDelegates(new DelegateOp(GameManagerDelegate.class) { + @Override public void apply (PlaceManagerDelegate delegate) { ((GameManagerDelegate)delegate).gameWillEnd(); } @@ -1192,6 +1199,7 @@ public class GameManager extends PlaceManager // let our delegates do their business applyToDelegates(new DelegateOp(GameManagerDelegate.class) { + @Override public void apply (PlaceManagerDelegate delegate) { ((GameManagerDelegate)delegate).gameDidEnd(); } @@ -1268,6 +1276,7 @@ public class GameManager extends PlaceManager // let our delegates do their business applyToDelegates(new DelegateOp(GameManagerDelegate.class) { + @Override public void apply (PlaceManagerDelegate delegate) { ((GameManagerDelegate)delegate).gameWillReset(); } diff --git a/src/java/com/threerings/parlor/game/server/GameWatcher.java b/src/java/com/threerings/parlor/game/server/GameWatcher.java index 73d7a59f..94b2f47f 100644 --- a/src/java/com/threerings/parlor/game/server/GameWatcher.java +++ b/src/java/com/threerings/parlor/game/server/GameWatcher.java @@ -24,7 +24,6 @@ package com.threerings.parlor.game.server; import com.threerings.presents.dobj.AttributeChangeListener; import com.threerings.presents.dobj.AttributeChangedEvent; -import com.threerings.crowd.data.PlaceObject; import com.threerings.crowd.server.PlaceManager; import com.threerings.parlor.game.data.GameObject; diff --git a/src/java/com/threerings/parlor/rating/server/RatingManagerDelegate.java b/src/java/com/threerings/parlor/rating/server/RatingManagerDelegate.java index 6f4820c9..5d1ccfb2 100644 --- a/src/java/com/threerings/parlor/rating/server/RatingManagerDelegate.java +++ b/src/java/com/threerings/parlor/rating/server/RatingManagerDelegate.java @@ -26,15 +26,10 @@ import static com.threerings.parlor.Log.log; import java.util.Collection; import java.util.Collections; import java.util.List; -import java.util.logging.Level; - import com.google.common.collect.Lists; -import com.samskivert.io.PersistenceException; import com.samskivert.jdbc.RepositoryUnit; -import com.samskivert.util.ArrayIntSet; -import com.samskivert.util.ArrayUtil; import com.samskivert.util.IntMap; import com.samskivert.util.IntMaps; import com.samskivert.util.Invoker; @@ -67,7 +62,7 @@ public abstract class RatingManagerDelegate extends GameManagerDelegate _invoker = invoker; } - @Override // from PlaceManagerDelegate + @Override public void didInit (PlaceConfig config) { super.didInit(config); @@ -75,14 +70,14 @@ public abstract class RatingManagerDelegate extends GameManagerDelegate _repo = getRatingRepository(); } - @Override // from PlaceManagerDelegate + @Override public void didStartup (PlaceObject plobj) { super.didStartup(plobj); _gobj = (GameObject) plobj; } - @Override // from PlaceManagerDelegate + @Override public void bodyEntered (int bodyOid) { super.bodyEntered(bodyOid); @@ -97,7 +92,7 @@ public abstract class RatingManagerDelegate extends GameManagerDelegate } } - @Override // from PlaceManagerDelegate + @Override public void bodyLeft (int bodyOid) { super.bodyLeft(bodyOid); @@ -111,7 +106,7 @@ public abstract class RatingManagerDelegate extends GameManagerDelegate } } - @Override // from GameManagerDelegate + @Override public void gameWillStart () { super.gameWillStart(); @@ -144,7 +139,7 @@ public abstract class RatingManagerDelegate extends GameManagerDelegate loadRatings(toLoad); } - @Override // from GameManagerDelegate + @Override public void gameDidEnd () { super.gameDidEnd(); @@ -224,6 +219,7 @@ public abstract class RatingManagerDelegate extends GameManagerDelegate final int gameId = getGameId(); _invoker.postUnit(new RepositoryUnit("loadRatings(" + gameId + ")") { + @Override public void invokePersist () throws Exception { // map the records by player id so that we can correlate with the db results IntMap map = IntMaps.newHashIntMap(); @@ -242,6 +238,7 @@ public abstract class RatingManagerDelegate extends GameManagerDelegate } } + @Override public void handleSuccess () { // stuff our populated records into the _ratings mapping for (Rating rating : ratings) { @@ -259,12 +256,14 @@ public abstract class RatingManagerDelegate extends GameManagerDelegate final int gameId = getGameId(); _invoker.postUnit(new RepositoryUnit("saveRatings(" + gameId + ")") { + @Override public void invokePersist () throws Exception { for (Rating rating : ratings) { _repo.setRating(gameId, rating.playerId, rating.rating, rating.experience); } } + @Override public void handleSuccess () { // let subclasses publish the new ratings if they so desire for (Rating rating : ratings) { @@ -460,7 +459,7 @@ public abstract class RatingManagerDelegate extends GameManagerDelegate } } - @Override // from Object + @Override public String toString () { return StringUtil.fieldsToString(this); diff --git a/src/java/com/threerings/parlor/rating/server/persist/RatingRepository.java b/src/java/com/threerings/parlor/rating/server/persist/RatingRepository.java index 06ca3a59..a45564df 100644 --- a/src/java/com/threerings/parlor/rating/server/persist/RatingRepository.java +++ b/src/java/com/threerings/parlor/rating/server/persist/RatingRepository.java @@ -32,12 +32,9 @@ import com.google.inject.Singleton; import com.google.inject.Inject; import com.samskivert.io.PersistenceException; -import com.samskivert.util.HashIntMap; -import com.samskivert.util.IntMap; import com.samskivert.util.IntSet; import com.samskivert.jdbc.depot.DepotRepository; -import com.samskivert.jdbc.depot.EntityMigration; import com.samskivert.jdbc.depot.PersistenceContext; import com.samskivert.jdbc.depot.PersistentRecord; import com.samskivert.jdbc.depot.clause.Limit; @@ -182,7 +179,7 @@ public class RatingRepository extends DepotRepository store(record); } - @Override // from DepotRepository + @Override protected void getManagedRecords (Set> classes) { classes.add(RatingRecord.class); diff --git a/src/java/com/threerings/parlor/rating/util/Percentiler.java b/src/java/com/threerings/parlor/rating/util/Percentiler.java index 35336106..c86aada7 100644 --- a/src/java/com/threerings/parlor/rating/util/Percentiler.java +++ b/src/java/com/threerings/parlor/rating/util/Percentiler.java @@ -281,9 +281,7 @@ public class Percentiler return data; } - /** - * Generates a string representation of this instance. - */ + @Override public String toString () { StringBuilder buf = new StringBuilder(); diff --git a/src/java/com/threerings/parlor/server/ParlorDispatcher.java b/src/java/com/threerings/parlor/server/ParlorDispatcher.java index b609f3ec..61b9b007 100644 --- a/src/java/com/threerings/parlor/server/ParlorDispatcher.java +++ b/src/java/com/threerings/parlor/server/ParlorDispatcher.java @@ -26,7 +26,6 @@ import com.threerings.parlor.data.ParlorMarshaller; import com.threerings.parlor.game.data.GameConfig; import com.threerings.presents.client.InvocationService; import com.threerings.presents.data.ClientObject; -import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationException; import com.threerings.util.Name; diff --git a/src/java/com/threerings/parlor/server/ParlorManager.java b/src/java/com/threerings/parlor/server/ParlorManager.java index b56f36d9..c8db3870 100644 --- a/src/java/com/threerings/parlor/server/ParlorManager.java +++ b/src/java/com/threerings/parlor/server/ParlorManager.java @@ -33,12 +33,10 @@ import com.threerings.presents.server.InvocationManager; import com.threerings.crowd.data.BodyObject; import com.threerings.crowd.server.BodyLocator; -import com.threerings.crowd.server.CrowdServer; import com.threerings.crowd.server.PlaceRegistry; import com.threerings.parlor.client.ParlorService; import com.threerings.parlor.data.ParlorCodes; -import com.threerings.parlor.data.TableConfig; import com.threerings.parlor.game.data.GameConfig; import static com.threerings.parlor.Log.log; diff --git a/src/java/com/threerings/parlor/server/ParlorProvider.java b/src/java/com/threerings/parlor/server/ParlorProvider.java index a03e46e1..972a27dd 100644 --- a/src/java/com/threerings/parlor/server/ParlorProvider.java +++ b/src/java/com/threerings/parlor/server/ParlorProvider.java @@ -37,24 +37,24 @@ public interface ParlorProvider extends InvocationProvider /** * Handles a {@link ParlorService#cancel} request. */ - public void cancel (ClientObject caller, int arg1, InvocationService.InvocationListener arg2) + void cancel (ClientObject caller, int arg1, InvocationService.InvocationListener arg2) throws InvocationException; /** * Handles a {@link ParlorService#invite} request. */ - public void invite (ClientObject caller, Name arg1, GameConfig arg2, ParlorService.InviteListener arg3) + void invite (ClientObject caller, Name arg1, GameConfig arg2, ParlorService.InviteListener arg3) throws InvocationException; /** * Handles a {@link ParlorService#respond} request. */ - public void respond (ClientObject caller, int arg1, int arg2, Object arg3, InvocationService.InvocationListener arg4) + void respond (ClientObject caller, int arg1, int arg2, Object arg3, InvocationService.InvocationListener arg4) throws InvocationException; /** * Handles a {@link ParlorService#startSolitaire} request. */ - public void startSolitaire (ClientObject caller, GameConfig arg1, InvocationService.ConfirmListener arg2) + void startSolitaire (ClientObject caller, GameConfig arg1, InvocationService.ConfirmListener arg2) throws InvocationException; } diff --git a/src/java/com/threerings/parlor/server/ParlorSender.java b/src/java/com/threerings/parlor/server/ParlorSender.java index f8fe5d9e..013f3010 100644 --- a/src/java/com/threerings/parlor/server/ParlorSender.java +++ b/src/java/com/threerings/parlor/server/ParlorSender.java @@ -25,7 +25,6 @@ import com.threerings.parlor.client.ParlorDecoder; import com.threerings.parlor.client.ParlorReceiver; import com.threerings.parlor.game.data.GameConfig; import com.threerings.presents.data.ClientObject; -import com.threerings.presents.net.Transport; import com.threerings.presents.server.InvocationSender; import com.threerings.util.Name; diff --git a/src/java/com/threerings/parlor/server/TableDispatcher.java b/src/java/com/threerings/parlor/server/TableDispatcher.java index a2a2050b..4067c78c 100644 --- a/src/java/com/threerings/parlor/server/TableDispatcher.java +++ b/src/java/com/threerings/parlor/server/TableDispatcher.java @@ -26,7 +26,6 @@ import com.threerings.parlor.data.TableMarshaller; import com.threerings.parlor.game.data.GameConfig; import com.threerings.presents.client.InvocationService; import com.threerings.presents.data.ClientObject; -import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationException; diff --git a/src/java/com/threerings/parlor/server/TableManager.java b/src/java/com/threerings/parlor/server/TableManager.java index 8c896d4c..f131b829 100644 --- a/src/java/com/threerings/parlor/server/TableManager.java +++ b/src/java/com/threerings/parlor/server/TableManager.java @@ -21,15 +21,8 @@ package com.threerings.parlor.server; -import java.util.HashMap; -import java.util.Iterator; - -import com.google.inject.Inject; import com.samskivert.util.IntMap; import com.samskivert.util.IntMaps; -import com.samskivert.util.StringUtil; -import com.threerings.util.Name; - import com.threerings.presents.data.ClientObject; import com.threerings.presents.dobj.AttributeChangeListener; import com.threerings.presents.dobj.AttributeChangedEvent; @@ -55,7 +48,6 @@ import com.threerings.parlor.data.ParlorCodes; import com.threerings.parlor.data.Table; import com.threerings.parlor.data.TableConfig; import com.threerings.parlor.data.TableLobbyObject; -import com.threerings.parlor.data.TableMarshaller; import com.threerings.parlor.game.data.GameConfig; import com.threerings.parlor.game.data.GameObject; import com.threerings.parlor.game.server.GameManager; diff --git a/src/java/com/threerings/parlor/server/TableProvider.java b/src/java/com/threerings/parlor/server/TableProvider.java index 156f727f..a3b6d42d 100644 --- a/src/java/com/threerings/parlor/server/TableProvider.java +++ b/src/java/com/threerings/parlor/server/TableProvider.java @@ -36,24 +36,24 @@ public interface TableProvider extends InvocationProvider /** * Handles a {@link TableService#createTable} request. */ - public void createTable (ClientObject caller, TableConfig arg1, GameConfig arg2, InvocationService.ResultListener arg3) + void createTable (ClientObject caller, TableConfig arg1, GameConfig arg2, InvocationService.ResultListener arg3) throws InvocationException; /** * Handles a {@link TableService#joinTable} request. */ - public void joinTable (ClientObject caller, int arg1, int arg2, InvocationService.InvocationListener arg3) + void joinTable (ClientObject caller, int arg1, int arg2, InvocationService.InvocationListener arg3) throws InvocationException; /** * Handles a {@link TableService#leaveTable} request. */ - public void leaveTable (ClientObject caller, int arg1, InvocationService.InvocationListener arg2) + void leaveTable (ClientObject caller, int arg1, InvocationService.InvocationListener arg2) throws InvocationException; /** * Handles a {@link TableService#startTableNow} request. */ - public void startTableNow (ClientObject caller, int arg1, InvocationService.InvocationListener arg2) + void startTableNow (ClientObject caller, int arg1, InvocationService.InvocationListener arg2) throws InvocationException; } diff --git a/src/java/com/threerings/parlor/tourney/client/TourneyService.java b/src/java/com/threerings/parlor/tourney/client/TourneyService.java index 8c102529..09ea0a91 100644 --- a/src/java/com/threerings/parlor/tourney/client/TourneyService.java +++ b/src/java/com/threerings/parlor/tourney/client/TourneyService.java @@ -23,8 +23,6 @@ package com.threerings.parlor.tourney.client; import com.threerings.presents.client.Client; import com.threerings.presents.client.InvocationService; -import com.threerings.presents.client.InvocationService.ConfirmListener; -import com.threerings.presents.client.InvocationService.InvocationListener; /** * Provides tourney management services for the particular tourney this diff --git a/src/java/com/threerings/parlor/tourney/data/Participant.java b/src/java/com/threerings/parlor/tourney/data/Participant.java index 41e957fd..8d524a52 100644 --- a/src/java/com/threerings/parlor/tourney/data/Participant.java +++ b/src/java/com/threerings/parlor/tourney/data/Participant.java @@ -49,7 +49,7 @@ public class Participant extends SimpleStreamableObject return username.compareTo(op.username); } - // documentation inherited from interface Comparable + @Override public boolean equals (Object other) { if (other instanceof Participant) { @@ -58,7 +58,7 @@ public class Participant extends SimpleStreamableObject return false; } - // documentation inherited + @Override public String toString () { return username.toString(); diff --git a/src/java/com/threerings/parlor/tourney/data/TourneyConfig.java b/src/java/com/threerings/parlor/tourney/data/TourneyConfig.java index 37bb7102..099b5b26 100644 --- a/src/java/com/threerings/parlor/tourney/data/TourneyConfig.java +++ b/src/java/com/threerings/parlor/tourney/data/TourneyConfig.java @@ -22,7 +22,6 @@ package com.threerings.parlor.tourney.data; import com.threerings.io.SimpleStreamableObject; -import com.threerings.presents.dobj.DSet; import com.threerings.util.Name; /** diff --git a/src/java/com/threerings/parlor/tourney/data/TourneyMarshaller.java b/src/java/com/threerings/parlor/tourney/data/TourneyMarshaller.java index 5fd8cfb8..b4148272 100644 --- a/src/java/com/threerings/parlor/tourney/data/TourneyMarshaller.java +++ b/src/java/com/threerings/parlor/tourney/data/TourneyMarshaller.java @@ -25,7 +25,6 @@ import com.threerings.parlor.tourney.client.TourneyService; import com.threerings.presents.client.Client; import com.threerings.presents.client.InvocationService; import com.threerings.presents.data.InvocationMarshaller; -import com.threerings.presents.net.Transport; /** * Provides the implementation of the {@link TourneyService} interface diff --git a/src/java/com/threerings/parlor/tourney/data/TourniesMarshaller.java b/src/java/com/threerings/parlor/tourney/data/TourniesMarshaller.java index 1ca15cde..d5f7a942 100644 --- a/src/java/com/threerings/parlor/tourney/data/TourniesMarshaller.java +++ b/src/java/com/threerings/parlor/tourney/data/TourniesMarshaller.java @@ -25,7 +25,6 @@ import com.threerings.parlor.tourney.client.TourniesService; import com.threerings.presents.client.Client; import com.threerings.presents.client.InvocationService; import com.threerings.presents.data.InvocationMarshaller; -import com.threerings.presents.net.Transport; /** * Provides the implementation of the {@link TourniesService} interface diff --git a/src/java/com/threerings/parlor/tourney/server/TourneyDispatcher.java b/src/java/com/threerings/parlor/tourney/server/TourneyDispatcher.java index 7c304467..87a3c8e4 100644 --- a/src/java/com/threerings/parlor/tourney/server/TourneyDispatcher.java +++ b/src/java/com/threerings/parlor/tourney/server/TourneyDispatcher.java @@ -24,7 +24,6 @@ package com.threerings.parlor.tourney.server; import com.threerings.parlor.tourney.data.TourneyMarshaller; import com.threerings.presents.client.InvocationService; import com.threerings.presents.data.ClientObject; -import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationException; diff --git a/src/java/com/threerings/parlor/tourney/server/TourneyManager.java b/src/java/com/threerings/parlor/tourney/server/TourneyManager.java index a3a0bf46..29c6194a 100644 --- a/src/java/com/threerings/parlor/tourney/server/TourneyManager.java +++ b/src/java/com/threerings/parlor/tourney/server/TourneyManager.java @@ -25,8 +25,6 @@ import com.google.inject.Inject; import com.samskivert.util.Interval; import com.samskivert.util.ResultListener; -import com.threerings.util.Name; - import com.threerings.crowd.data.BodyObject; import com.threerings.crowd.server.BodyLocator; @@ -262,6 +260,7 @@ public abstract class TourneyManager // destroy the object in a couple of minutes new Interval(_omgr) { + @Override public void expired () { _omgr.destroyObject(_trobj.getOid()); } diff --git a/src/java/com/threerings/parlor/tourney/server/TourneyProvider.java b/src/java/com/threerings/parlor/tourney/server/TourneyProvider.java index 485d4632..f25340ac 100644 --- a/src/java/com/threerings/parlor/tourney/server/TourneyProvider.java +++ b/src/java/com/threerings/parlor/tourney/server/TourneyProvider.java @@ -34,18 +34,18 @@ public interface TourneyProvider extends InvocationProvider /** * Handles a {@link TourneyService#cancel} request. */ - public void cancel (ClientObject caller, InvocationService.ConfirmListener arg1) + void cancel (ClientObject caller, InvocationService.ConfirmListener arg1) throws InvocationException; /** * Handles a {@link TourneyService#join} request. */ - public void join (ClientObject caller, InvocationService.ConfirmListener arg1) + void join (ClientObject caller, InvocationService.ConfirmListener arg1) throws InvocationException; /** * Handles a {@link TourneyService#leave} request. */ - public void leave (ClientObject caller, InvocationService.ConfirmListener arg1) + void leave (ClientObject caller, InvocationService.ConfirmListener arg1) throws InvocationException; } diff --git a/src/java/com/threerings/parlor/tourney/server/TourniesDispatcher.java b/src/java/com/threerings/parlor/tourney/server/TourniesDispatcher.java index a716aa14..df49971b 100644 --- a/src/java/com/threerings/parlor/tourney/server/TourniesDispatcher.java +++ b/src/java/com/threerings/parlor/tourney/server/TourniesDispatcher.java @@ -25,7 +25,6 @@ import com.threerings.parlor.tourney.data.TourneyConfig; import com.threerings.parlor.tourney.data.TourniesMarshaller; import com.threerings.presents.client.InvocationService; import com.threerings.presents.data.ClientObject; -import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationException; diff --git a/src/java/com/threerings/parlor/tourney/server/TourniesManager.java b/src/java/com/threerings/parlor/tourney/server/TourniesManager.java index 1394aa7d..a3548cc0 100644 --- a/src/java/com/threerings/parlor/tourney/server/TourniesManager.java +++ b/src/java/com/threerings/parlor/tourney/server/TourniesManager.java @@ -22,7 +22,6 @@ package com.threerings.parlor.tourney.server; import java.util.ArrayList; -import java.util.List; import java.util.Map; import com.google.common.collect.Maps; @@ -31,18 +30,13 @@ import com.google.inject.Injector; import com.google.inject.Singleton; import com.samskivert.io.PersistenceException; -import com.samskivert.jdbc.ConnectionProvider; import com.samskivert.util.Interval; -import com.samskivert.util.RunQueue; - import com.threerings.presents.client.InvocationService; import com.threerings.presents.data.ClientObject; import com.threerings.presents.dobj.RootDObjectManager; import com.threerings.presents.server.InvocationException; -import com.threerings.presents.server.PresentsServer; import com.threerings.presents.server.ShutdownManager; -import com.threerings.parlor.tourney.data.Prize; import com.threerings.parlor.tourney.data.TourneyConfig; import com.threerings.parlor.tourney.server.persist.TourneyRepository; @@ -63,6 +57,7 @@ public abstract class TourniesManager _injector = injector; _interval = new Interval(_omgr) { + @Override public void expired () { updateTournies(); } diff --git a/src/java/com/threerings/parlor/tourney/server/TourniesProvider.java b/src/java/com/threerings/parlor/tourney/server/TourniesProvider.java index 7414913a..622fc385 100644 --- a/src/java/com/threerings/parlor/tourney/server/TourniesProvider.java +++ b/src/java/com/threerings/parlor/tourney/server/TourniesProvider.java @@ -35,6 +35,6 @@ public interface TourniesProvider extends InvocationProvider /** * Handles a {@link TourniesService#createTourney} request. */ - public void createTourney (ClientObject caller, TourneyConfig arg1, InvocationService.ResultListener arg2) + void createTourney (ClientObject caller, TourneyConfig arg1, InvocationService.ResultListener arg2) throws InvocationException; } diff --git a/src/java/com/threerings/parlor/turn/client/TurnGameControllerDelegate.java b/src/java/com/threerings/parlor/turn/client/TurnGameControllerDelegate.java index 2bc30aa9..9400b982 100644 --- a/src/java/com/threerings/parlor/turn/client/TurnGameControllerDelegate.java +++ b/src/java/com/threerings/parlor/turn/client/TurnGameControllerDelegate.java @@ -84,13 +84,13 @@ public class TurnGameControllerDelegate extends GameControllerDelegate return _gameObj.getPlayerIndex(_turnGame.getTurnHolder()); } - // documentation inherited + @Override public void init (CrowdContext ctx, PlaceConfig config) { _ctx = ctx; } - // documentation inherited + @Override public void willEnterPlace (PlaceObject plobj) { // get a casted reference to the object @@ -102,7 +102,7 @@ public class TurnGameControllerDelegate extends GameControllerDelegate plobj.addListener(this); } - // documentation inherited + @Override public void didLeavePlace (PlaceObject plobj) { // remove our listenership diff --git a/src/java/com/threerings/parlor/turn/server/TurnGameManagerDelegate.java b/src/java/com/threerings/parlor/turn/server/TurnGameManagerDelegate.java index 1c8dd17b..ca04b00a 100644 --- a/src/java/com/threerings/parlor/turn/server/TurnGameManagerDelegate.java +++ b/src/java/com/threerings/parlor/turn/server/TurnGameManagerDelegate.java @@ -147,20 +147,20 @@ public class TurnGameManagerDelegate extends GameManagerDelegate } } - @Override // from PlaceManagerDelegate + @Override public void didInit (PlaceConfig config) { super.didInit(config); _tgmgr = (TurnGameManager)_plmgr; } - @Override // from PlaceManagerDelegate + @Override public void didStartup (PlaceObject plobj) { _turnGame = (TurnGameObject)plobj; } - // documentation inherited + @Override public void playerWasReplaced (int pidx, Name oplayer, Name nplayer) { // we need to update the turn holder if the current turn holder was the player that was @@ -178,6 +178,7 @@ public class TurnGameManagerDelegate extends GameManagerDelegate * This should be called from {@link GameManager#gameDidStart} to let the turn delegate perform * start of game processing. */ + @Override public void gameDidStart () { // figure out who will be first diff --git a/src/java/com/threerings/parlor/util/RobotPlayer.java b/src/java/com/threerings/parlor/util/RobotPlayer.java index 12ab32c1..8ba62e40 100644 --- a/src/java/com/threerings/parlor/util/RobotPlayer.java +++ b/src/java/com/threerings/parlor/util/RobotPlayer.java @@ -95,7 +95,7 @@ public class RobotPlayer extends Interval return _active; } - // documentation inherited + @Override public void expired () { // post a random key press command diff --git a/src/java/com/threerings/puzzle/client/PlayerStatusView.java b/src/java/com/threerings/puzzle/client/PlayerStatusView.java index 6d1f24d4..4d75a4b0 100644 --- a/src/java/com/threerings/puzzle/client/PlayerStatusView.java +++ b/src/java/com/threerings/puzzle/client/PlayerStatusView.java @@ -97,7 +97,7 @@ public class PlayerStatusView extends JPanel } } - /** Returns a string representation of this instance. */ + @Override public String toString () { return "[user=" + _username + ", pidx=" + _pidx + diff --git a/src/java/com/threerings/puzzle/client/PuzzleAnimationWaiter.java b/src/java/com/threerings/puzzle/client/PuzzleAnimationWaiter.java index 47bd632d..13f10fc9 100644 --- a/src/java/com/threerings/puzzle/client/PuzzleAnimationWaiter.java +++ b/src/java/com/threerings/puzzle/client/PuzzleAnimationWaiter.java @@ -49,7 +49,7 @@ public abstract class PuzzleAnimationWaiter extends AnimationWaiter return (_puzobj.isInPlay() && (_sessionId == _puzobj.sessionId)); } - // documentation inherited + @Override protected final void allAnimationsFinished () { allAnimationsFinished(puzzleStillValid()); diff --git a/src/java/com/threerings/puzzle/client/PuzzleBoardView.java b/src/java/com/threerings/puzzle/client/PuzzleBoardView.java index 4a2625cc..628add74 100644 --- a/src/java/com/threerings/puzzle/client/PuzzleBoardView.java +++ b/src/java/com/threerings/puzzle/client/PuzzleBoardView.java @@ -27,13 +27,9 @@ import java.awt.Dimension; import java.awt.Font; import java.awt.Graphics2D; import java.awt.Rectangle; -import java.awt.geom.AffineTransform; import java.util.ArrayList; -import javax.swing.UIManager; - import com.samskivert.swing.Label; -import com.samskivert.swing.util.SwingUtil; import com.samskivert.util.StringUtil; import com.threerings.media.VirtualMediaPanel; @@ -110,6 +106,7 @@ public abstract class PuzzleBoardView extends VirtualMediaPanel * If paused, a label will be displayed with the component's font, * which may be set with setFont(). */ + @Override public void setPaused (boolean paused) { if (paused) { @@ -146,7 +143,7 @@ public abstract class PuzzleBoardView extends VirtualMediaPanel anim.addAnimationObserver(_actionAnimObs); } - // documentation inherited + @Override public void abortAnimation (Animation anim) { super.abortAnimation(anim); @@ -187,9 +184,7 @@ public abstract class PuzzleBoardView extends VirtualMediaPanel _actionSprites.add(sprite); } - /** - * Removes the given sprite from the board. - */ + @Override public void removeSprite (Sprite sprite) { super.removeSprite(sprite); @@ -205,14 +200,14 @@ public abstract class PuzzleBoardView extends VirtualMediaPanel } } - // documentation inherited + @Override public void clearSprites () { super.clearSprites(); _actionSprites.clear(); } - // documentation inherited + @Override public void clearAnimations () { super.clearAnimations(); @@ -250,6 +245,7 @@ public abstract class PuzzleBoardView extends VirtualMediaPanel public void dumpActors () { StringUtil.Formatter fmt = new StringUtil.Formatter() { + @Override public String toString (Object obj) { return StringUtil.shortClassName(obj); } @@ -302,7 +298,7 @@ public abstract class PuzzleBoardView extends VirtualMediaPanel _avoidArranger.positionAvoidAnimation(anim, _vbounds); } - // documentation inherited + @Override public void paintBehind (Graphics2D gfx, Rectangle dirty) { super.paintBehind(gfx, dirty); @@ -320,7 +316,7 @@ public abstract class PuzzleBoardView extends VirtualMediaPanel gfx.fill(dirty); } - // documentation inherited + @Override public void paintBetween (Graphics2D gfx, Rectangle dirty) { super.paintBetween(gfx, dirty); @@ -328,7 +324,7 @@ public abstract class PuzzleBoardView extends VirtualMediaPanel renderBoard(gfx, dirty); } - // documentation inherited + @Override protected void paintInFront (Graphics2D gfx, Rectangle dirty) { super.paintInFront(gfx, dirty); @@ -404,6 +400,7 @@ public abstract class PuzzleBoardView extends VirtualMediaPanel /** Listens to our action animations and clears them when they're done. */ protected AnimationAdapter _actionAnimObs = new AnimationAdapter() { + @Override public void animationCompleted (Animation anim, long when) { animationFinished(anim); } diff --git a/src/java/com/threerings/puzzle/client/PuzzleController.java b/src/java/com/threerings/puzzle/client/PuzzleController.java index 959f80e5..3cec798a 100644 --- a/src/java/com/threerings/puzzle/client/PuzzleController.java +++ b/src/java/com/threerings/puzzle/client/PuzzleController.java @@ -36,8 +36,6 @@ import com.samskivert.swing.util.MouseHijacker; import com.samskivert.util.CollectionUtil; import com.samskivert.util.ObserverList; -import com.samskivert.util.StringUtil; - import com.threerings.media.FrameParticipant; import com.threerings.presents.dobj.AttributeChangeListener; @@ -88,7 +86,7 @@ public abstract class PuzzleController extends GameController public int actionCleared (); } - // documentation inherited + @Override protected void didInit () { super.didInit(); @@ -125,7 +123,7 @@ public abstract class PuzzleController extends GameController return _pidx; } - // documentation inherited + @Override public void setGameOver (boolean gameOver) { super.setGameOver(gameOver); @@ -182,6 +180,7 @@ public abstract class PuzzleController extends GameController // dispatch the change to our delegates applyToDelegates(new DelegateOp(PuzzleControllerDelegate.class) { + @Override public void apply (PlaceControllerDelegate delegate) { ((PuzzleControllerDelegate)delegate).setChatting(_chatting); } @@ -226,6 +225,7 @@ public abstract class PuzzleController extends GameController // check with the delegates final boolean[] canChatNow = new boolean[] { true }; applyToDelegates(new DelegateOp(PuzzleControllerDelegate.class) { + @Override public void apply (PlaceControllerDelegate delegate) { canChatNow[0] = ((PuzzleControllerDelegate)delegate).canStartChatting() && @@ -244,7 +244,7 @@ public abstract class PuzzleController extends GameController return _chatting; } - // documentation inherited + @Override public void willEnterPlace (PlaceObject plobj) { super.willEnterPlace(plobj); @@ -269,7 +269,7 @@ public abstract class PuzzleController extends GameController } } - // documentation inherited + @Override public void mayLeavePlace (PlaceObject plobj) { super.mayLeavePlace(plobj); @@ -278,7 +278,7 @@ public abstract class PuzzleController extends GameController sendProgressUpdate(); } - // documentation inherited + @Override public void didLeavePlace (PlaceObject plobj) { super.didLeavePlace(plobj); @@ -319,7 +319,7 @@ public abstract class PuzzleController extends GameController return true; } - // documentation inherited + @Override public void attributeChanged (AttributeChangedEvent event) { String name = event.getName(); @@ -370,7 +370,7 @@ public abstract class PuzzleController extends GameController } } - // documentation inherited + @Override protected void gameWillReset () { super.gameWillReset(); @@ -449,6 +449,7 @@ public abstract class PuzzleController extends GameController // let our delegates do their business applyToDelegates(new DelegateOp(PuzzleControllerDelegate.class) { + @Override public void apply (PlaceControllerDelegate delegate) { ((PuzzleControllerDelegate)delegate).startAction(); } @@ -559,6 +560,7 @@ public abstract class PuzzleController extends GameController // let our delegates do their business applyToDelegates(new DelegateOp(PuzzleControllerDelegate.class) { + @Override public void apply (PlaceControllerDelegate delegate) { canClear[0] = canClear[0] && ((PuzzleControllerDelegate)delegate).canClearAction(); @@ -601,6 +603,7 @@ public abstract class PuzzleController extends GameController // let our delegates do their business applyToDelegates(new DelegateOp(PuzzleControllerDelegate.class) { + @Override public void apply (PlaceControllerDelegate delegate) { ((PuzzleControllerDelegate)delegate).clearAction(); } @@ -648,7 +651,7 @@ public abstract class PuzzleController extends GameController { } - // documentation inherited + @Override public boolean handleAction (ActionEvent action) { String cmd = action.getActionCommand(); @@ -695,6 +698,7 @@ public abstract class PuzzleController extends GameController // let our delegates do their business applyToDelegates(new DelegateOp(PuzzleControllerDelegate.class) { + @Override public void apply (PlaceControllerDelegate delegate) { ((PuzzleControllerDelegate)delegate).setBoard(_pboard); } @@ -796,6 +800,7 @@ public abstract class PuzzleController extends GameController { // dispatch this to our delegates applyToDelegates(new DelegateOp(PuzzleControllerDelegate.class) { + @Override public void apply (PlaceControllerDelegate delegate) { ((PuzzleControllerDelegate)delegate).playerKnockedOut(pidx); } @@ -816,6 +821,7 @@ public abstract class PuzzleController extends GameController panel.getBoardView().addMouseListener(_clicker); } + @Override public Component release () { _panel.removeMouseListener(_clicker); @@ -824,6 +830,7 @@ public abstract class PuzzleController extends GameController } protected MouseAdapter _clicker = new MouseAdapter() { + @Override public void mousePressed (MouseEvent event) { setChatting(false); // this will call release } @@ -938,6 +945,7 @@ public abstract class PuzzleController extends GameController /** A key listener that currently just toggles pause in the puzzle. */ protected KeyListener _globalKeyListener = new KeyAdapter() { + @Override public void keyReleased (KeyEvent e) { int keycode = e.getKeyCode(); diff --git a/src/java/com/threerings/puzzle/client/PuzzleControllerDelegate.java b/src/java/com/threerings/puzzle/client/PuzzleControllerDelegate.java index 6958b2e7..affe6b0e 100644 --- a/src/java/com/threerings/puzzle/client/PuzzleControllerDelegate.java +++ b/src/java/com/threerings/puzzle/client/PuzzleControllerDelegate.java @@ -50,7 +50,7 @@ public class PuzzleControllerDelegate extends GameControllerDelegate _ctrl = ctrl; } - // documentation inherited + @Override public void willEnterPlace (PlaceObject plobj) { super.willEnterPlace(plobj); @@ -59,7 +59,7 @@ public class PuzzleControllerDelegate extends GameControllerDelegate _puzobj = (PuzzleObject)plobj; } - // documentation inherited + @Override public void didLeavePlace (PlaceObject plobj) { super.didLeavePlace(plobj); diff --git a/src/java/com/threerings/puzzle/client/PuzzlePanel.java b/src/java/com/threerings/puzzle/client/PuzzlePanel.java index 21a26fd6..9c69a953 100644 --- a/src/java/com/threerings/puzzle/client/PuzzlePanel.java +++ b/src/java/com/threerings/puzzle/client/PuzzlePanel.java @@ -77,7 +77,7 @@ public abstract class PuzzlePanel extends JPanel add(_bpanel, BorderLayout.CENTER); } - // documentation inherited + @Override public void addNotify () { super.addNotify(); @@ -87,7 +87,7 @@ public abstract class PuzzlePanel extends JPanel setPuzzleGrabsKeys(false); } - // documentation inherited + @Override public void removeNotify () { super.removeNotify(); diff --git a/src/java/com/threerings/puzzle/data/Board.java b/src/java/com/threerings/puzzle/data/Board.java index 24f546f5..cae1e7c1 100644 --- a/src/java/com/threerings/puzzle/data/Board.java +++ b/src/java/com/threerings/puzzle/data/Board.java @@ -47,7 +47,7 @@ public abstract class Board */ public abstract boolean equals (Board other); - // documentation inherited + @Override public Object clone () { try { @@ -96,13 +96,13 @@ public abstract class Board setSeed(seed); } - // documentation inherited + @Override public synchronized void setSeed (long seed) { _seed = (seed ^ multiplier) & mask; } - // documentation inherited + @Override synchronized protected int next (int bits) { long nextseed = (_seed * multiplier + addend) & mask; @@ -110,7 +110,7 @@ public abstract class Board return (int)(nextseed >>> (48 - bits)); } - // documentation inherited + @Override public void nextBytes (byte[] bytes) { unimplemented(); @@ -122,7 +122,7 @@ public abstract class Board // nextBoolean() // nextFloat() - // documentation inherited + @Override public int nextInt (int n) { if (n <= 0) { @@ -141,14 +141,14 @@ public abstract class Board return val; } - // documentation inherited + @Override public double nextDouble () { long l = ((long)(next(26)) << 27) + next(27); return l / (double)(1L << 53); } - // documentation inherited + @Override public synchronized double nextGaussian () { if (_haveNextNextGaussian) { @@ -169,7 +169,7 @@ public abstract class Board } } - // documentation inherited + @Override public Object clone () { try { diff --git a/src/java/com/threerings/puzzle/data/PuzzleGameMarshaller.java b/src/java/com/threerings/puzzle/data/PuzzleGameMarshaller.java index 0cb6dfed..5e6bb84f 100644 --- a/src/java/com/threerings/puzzle/data/PuzzleGameMarshaller.java +++ b/src/java/com/threerings/puzzle/data/PuzzleGameMarshaller.java @@ -23,7 +23,6 @@ package com.threerings.puzzle.data; import com.threerings.presents.client.Client; import com.threerings.presents.data.InvocationMarshaller; -import com.threerings.presents.net.Transport; import com.threerings.puzzle.client.PuzzleGameService; /** diff --git a/src/java/com/threerings/puzzle/drop/client/DropBlockSprite.java b/src/java/com/threerings/puzzle/drop/client/DropBlockSprite.java index 0d1dbe5f..b22bcfc6 100644 --- a/src/java/com/threerings/puzzle/drop/client/DropBlockSprite.java +++ b/src/java/com/threerings/puzzle/drop/client/DropBlockSprite.java @@ -68,7 +68,7 @@ public class DropBlockSprite extends DropSprite _orient = orient; } - // documentation inherited + @Override protected void init () { super.init(); @@ -124,21 +124,21 @@ public class DropBlockSprite extends DropSprite return _ecol; } - // documentation inherited + @Override public void setColumn (int col) { super.setColumn(col); updateDropInfo(); } - // documentation inherited + @Override public void setRow (int row) { super.setRow(row); updateDropInfo(); } - // documentation inherited + @Override public void setBoardLocation (int row, int col) { super.setBoardLocation(row, col); @@ -149,6 +149,7 @@ public class DropBlockSprite extends DropSprite * Updates the sprite image offset to reflect the direction in which * the external piece is hanging. */ + @Override public void setOrientation (int orient) { super.setOrientation(orient); @@ -168,7 +169,7 @@ public class DropBlockSprite extends DropSprite updateDropInfo(); } - // documentation inherited + @Override public void toString (StringBuilder buf) { super.toString(buf); diff --git a/src/java/com/threerings/puzzle/drop/client/DropBoardView.java b/src/java/com/threerings/puzzle/drop/client/DropBoardView.java index 0a1ffc8f..e583a64f 100644 --- a/src/java/com/threerings/puzzle/drop/client/DropBoardView.java +++ b/src/java/com/threerings/puzzle/drop/client/DropBoardView.java @@ -81,6 +81,7 @@ public abstract class DropBoardView extends PuzzleBoardView /** * Initializes the board with the board dimensions. */ + @Override public void init (GameConfig config) { DropConfig dconfig = (DropConfig)config; @@ -265,6 +266,7 @@ public abstract class DropBoardView extends PuzzleBoardView Point end = new Point(); getPiecePosition(tx, ty, end); piece.addSpriteObserver(new PathAdapter() { + @Override public void pathCompleted (Sprite sprite, Path path, long when) { sprite.removeSpriteObserver(this); if (_pieces[tpos] != null) { @@ -323,7 +325,7 @@ public abstract class DropBoardView extends PuzzleBoardView public abstract Mirage getPieceImage ( int piece, int col, int row, int orient); - // documentation inherited + @Override public void setBoard (Board board) { // when a new board arrives, we want to remove all drop sprites @@ -525,7 +527,7 @@ public abstract class DropBoardView extends PuzzleBoardView // nothing for now } - // documentation inherited + @Override public void paintBetween (Graphics2D gfx, Rectangle dirtyRect) { gfx.translate(0, -_roff); @@ -534,7 +536,7 @@ public abstract class DropBoardView extends PuzzleBoardView gfx.translate(0, _roff); } - // documentation inherited + @Override public Dimension getPreferredSize () { int wid = _bwid * _pwid; diff --git a/src/java/com/threerings/puzzle/drop/client/DropControllerDelegate.java b/src/java/com/threerings/puzzle/drop/client/DropControllerDelegate.java index 99fc5998..1337f452 100644 --- a/src/java/com/threerings/puzzle/drop/client/DropControllerDelegate.java +++ b/src/java/com/threerings/puzzle/drop/client/DropControllerDelegate.java @@ -26,8 +26,6 @@ import java.awt.Point; import java.awt.Rectangle; import java.awt.event.ActionEvent; -import java.util.List; - import com.samskivert.util.IntListUtil; import com.threerings.media.FrameParticipant; @@ -51,7 +49,6 @@ import com.threerings.puzzle.drop.data.DropConfig; import com.threerings.puzzle.drop.data.DropLogic; import com.threerings.puzzle.drop.data.DropPieceCodes; import com.threerings.puzzle.drop.util.PieceDropLogic; -import com.threerings.puzzle.drop.util.PieceDropper.PieceDropInfo; import com.threerings.puzzle.drop.util.PieceDropper; import static com.threerings.puzzle.Log.log; @@ -124,7 +121,7 @@ public abstract class DropControllerDelegate extends PuzzleControllerDelegate } } - // documentation inherited + @Override public void init (CrowdContext ctx, PlaceConfig config) { super.init(ctx, config); @@ -169,6 +166,7 @@ public abstract class DropControllerDelegate extends PuzzleControllerDelegate /** * Starts up the action; tries evolving the board to get things going. */ + @Override protected void startAction () { super.startAction(); @@ -207,7 +205,7 @@ public abstract class DropControllerDelegate extends PuzzleControllerDelegate unstabilizeBoard(); } - // documentation inherited + @Override protected boolean canClearAction () { if (!_stable) { @@ -221,6 +219,7 @@ public abstract class DropControllerDelegate extends PuzzleControllerDelegate * sprites, any pieces rising in the board, and resets the animation * timestamps. */ + @Override protected void clearAction () { super.clearAction(); @@ -246,7 +245,7 @@ public abstract class DropControllerDelegate extends PuzzleControllerDelegate _ctx.getFrameManager().removeFrameParticipant(this); } - // documentation inherited + @Override public void gameDidEnd () { super.gameDidEnd(); @@ -259,7 +258,7 @@ public abstract class DropControllerDelegate extends PuzzleControllerDelegate // _dview.setRisingPieces(null); } - // documentation inherited + @Override public boolean handleAction (ActionEvent action) { // handle any block-related movement actions @@ -281,7 +280,7 @@ public abstract class DropControllerDelegate extends PuzzleControllerDelegate return true; } - // documentation inherited + @Override public void setBoard (Board board) { super.setBoard(board); @@ -1183,6 +1182,7 @@ public abstract class DropControllerDelegate extends PuzzleControllerDelegate /** Used to evolve the board following the completion of animations. */ protected AnimationAdapter _evolveObserver = new AnimationAdapter() { + @Override public void animationCompleted (Animation anim, long when) { animationDidFinish(anim); } diff --git a/src/java/com/threerings/puzzle/drop/client/DropSprite.java b/src/java/com/threerings/puzzle/drop/client/DropSprite.java index a154aebf..0845d08e 100644 --- a/src/java/com/threerings/puzzle/drop/client/DropSprite.java +++ b/src/java/com/threerings/puzzle/drop/client/DropSprite.java @@ -32,8 +32,6 @@ import com.threerings.util.DirectionUtil; import com.threerings.media.image.Mirage; import com.threerings.media.sprite.Sprite; -import static com.threerings.puzzle.Log.log; - /** * The drop sprite is a sprite that displays one or more pieces falling * toward the bottom of the board. @@ -79,7 +77,7 @@ public class DropSprite extends Sprite setRenderOrder(renderOrder); } - // documentation inherited + @Override protected void init () { super.init(); @@ -304,7 +302,7 @@ public class DropSprite extends Sprite setLocation(_ox, _srcPos.y+1); } - // documentation inherited + @Override public boolean inside (Shape shape) { return shape.contains(_bounds); @@ -336,7 +334,7 @@ public class DropSprite extends Sprite return pctdone; } - // documentation inherited + @Override public void paint (Graphics2D gfx) { // get the column and row increment based on the sprite's orientation @@ -370,7 +368,7 @@ public class DropSprite extends Sprite image.paint(gfx, x, y); } - // documentation inherited + @Override public void tick (long timestamp) { super.tick(timestamp); @@ -440,7 +438,7 @@ public class DropSprite extends Sprite // Log.info("Moved to row " + _row); } - // documentation inherited + @Override public void fastForward (long timeDelta) { if (_rowstamp > 0) { @@ -448,7 +446,7 @@ public class DropSprite extends Sprite } } - // documentation inherited + @Override public void toString (StringBuilder buf) { super.toString(buf); @@ -470,7 +468,7 @@ public class DropSprite extends Sprite setLocation(_srcPos.x, _srcPos.y); } - // documentation inherited + @Override public void setOrientation (int orient) { invalidate(); diff --git a/src/java/com/threerings/puzzle/drop/client/NextBlockView.java b/src/java/com/threerings/puzzle/drop/client/NextBlockView.java index 24889a27..5e16daca 100644 --- a/src/java/com/threerings/puzzle/drop/client/NextBlockView.java +++ b/src/java/com/threerings/puzzle/drop/client/NextBlockView.java @@ -61,7 +61,7 @@ public class NextBlockView extends JComponent repaint(); } - // documentation inherited + @Override public void paintComponent (Graphics g) { super.paintComponent(g); @@ -85,7 +85,7 @@ public class NextBlockView extends JComponent } } - // documentation inherited + @Override public Dimension getPreferredSize () { int wid = (_orient == VERTICAL) ? _pwid : (2 * _pwid); diff --git a/src/java/com/threerings/puzzle/drop/client/PieceGroupAnimation.java b/src/java/com/threerings/puzzle/drop/client/PieceGroupAnimation.java index 8137bf64..e8777aa4 100644 --- a/src/java/com/threerings/puzzle/drop/client/PieceGroupAnimation.java +++ b/src/java/com/threerings/puzzle/drop/client/PieceGroupAnimation.java @@ -25,13 +25,11 @@ import java.awt.Graphics2D; import java.awt.Rectangle; import com.threerings.media.animation.Animation; -import com.threerings.media.sprite.ImageSprite; import com.threerings.media.sprite.PathObserver; import com.threerings.media.sprite.Sprite; import com.threerings.media.util.Path; import com.threerings.puzzle.drop.data.DropBoard; -import com.threerings.puzzle.drop.data.DropPieceCodes; /** * Animates all the pieces on a puzzle board doing some sort of global @@ -51,13 +49,13 @@ public abstract class PieceGroupAnimation extends Animation _board = board; } - // documentation inherited + @Override public void tick (long tickStamp) { // nothing doing } - // documentation inherited + @Override public void paint (Graphics2D gfx) { // nothing doing @@ -75,7 +73,7 @@ public abstract class PieceGroupAnimation extends Animation _finished = (--_penders == 0); } - // documentation inherited + @Override protected void willStart (long tickStamp) { super.willStart(tickStamp); diff --git a/src/java/com/threerings/puzzle/drop/data/DropBoard.java b/src/java/com/threerings/puzzle/drop/data/DropBoard.java index afdee51e..473115e4 100644 --- a/src/java/com/threerings/puzzle/drop/data/DropBoard.java +++ b/src/java/com/threerings/puzzle/drop/data/DropBoard.java @@ -27,8 +27,6 @@ import java.util.Arrays; import org.apache.commons.lang.StringUtils; -import com.threerings.util.DirectionUtil; - import com.threerings.puzzle.data.Board; import com.threerings.puzzle.drop.client.DropControllerDelegate; import com.threerings.puzzle.drop.util.DropBoardUtil; @@ -534,13 +532,13 @@ public class DropBoard extends Board op.execute(this, col, row); } - // documentation inherited from interface + @Override public void dump () { dumpAndCompare(null); } - // documentation inherited from interface + @Override public void dumpAndCompare (Board other) { if (other != null && !(other instanceof DropBoard)) { @@ -571,7 +569,7 @@ public class DropBoard extends Board } } - /** Returns a string representation of this instance. */ + @Override public String toString () { StringBuilder buf = new StringBuilder(); @@ -580,7 +578,7 @@ public class DropBoard extends Board return buf.append("]").toString(); } - // documentation inherited from interface + @Override public boolean equals (Board other) { // make sure we're comparing the same class type @@ -694,7 +692,7 @@ public class DropBoard extends Board _board = board; } - // documentation inherited + @Override public Object clone () { DropBoard board = (DropBoard)super.clone(); diff --git a/src/java/com/threerings/puzzle/drop/data/DropBoardSummary.java b/src/java/com/threerings/puzzle/drop/data/DropBoardSummary.java index 3fdeedbe..1a64411d 100644 --- a/src/java/com/threerings/puzzle/drop/data/DropBoardSummary.java +++ b/src/java/com/threerings/puzzle/drop/data/DropBoardSummary.java @@ -66,7 +66,7 @@ public class DropBoardSummary extends BoardSummary return idx; } - // documentation inherited + @Override public void setBoard (Board board) { _dboard = (DropBoard)board; @@ -76,7 +76,7 @@ public class DropBoardSummary extends BoardSummary super.setBoard(board); } - // documentation inherited + @Override public void summarize () { // update the board column levels diff --git a/src/java/com/threerings/puzzle/drop/data/SegmentInfo.java b/src/java/com/threerings/puzzle/drop/data/SegmentInfo.java index 6b402dc2..c2f8a873 100644 --- a/src/java/com/threerings/puzzle/drop/data/SegmentInfo.java +++ b/src/java/com/threerings/puzzle/drop/data/SegmentInfo.java @@ -50,9 +50,7 @@ public class SegmentInfo this.len = len; } - /** - * Returns a string representation of this instance. - */ + @Override public String toString () { return StringUtil.fieldsToString(this); diff --git a/src/java/com/threerings/puzzle/drop/server/DropManagerDelegate.java b/src/java/com/threerings/puzzle/drop/server/DropManagerDelegate.java index 077f79d7..90b225f9 100644 --- a/src/java/com/threerings/puzzle/drop/server/DropManagerDelegate.java +++ b/src/java/com/threerings/puzzle/drop/server/DropManagerDelegate.java @@ -89,7 +89,7 @@ public abstract class DropManagerDelegate extends PuzzleManagerDelegate } } - // documentation inherited + @Override public void didInit (PlaceConfig config) { _dconfig = (DropConfig)config; @@ -101,7 +101,7 @@ public abstract class DropManagerDelegate extends PuzzleManagerDelegate super.didInit(config); } - // documentation inherited + @Override public void didStartup (PlaceObject plobj) { super.didStartup(plobj); @@ -116,7 +116,7 @@ public abstract class DropManagerDelegate extends PuzzleManagerDelegate } } - // documentation inherited + @Override public void gameWillStart () { super.gameWillStart(); diff --git a/src/java/com/threerings/puzzle/drop/util/PieceDropper.java b/src/java/com/threerings/puzzle/drop/util/PieceDropper.java index 10478c60..1618b7f6 100644 --- a/src/java/com/threerings/puzzle/drop/util/PieceDropper.java +++ b/src/java/com/threerings/puzzle/drop/util/PieceDropper.java @@ -21,10 +21,6 @@ package com.threerings.puzzle.drop.util; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - import com.samskivert.util.StringUtil; import com.threerings.puzzle.drop.data.DropBoard; @@ -65,7 +61,7 @@ public class PieceDropper this.dist = dist; } - /** Returns a string representation of this instance. */ + @Override public String toString () { return StringUtil.fieldsToString(this); diff --git a/src/java/com/threerings/puzzle/server/PuzzleGameDispatcher.java b/src/java/com/threerings/puzzle/server/PuzzleGameDispatcher.java index 5ad3d424..943098c4 100644 --- a/src/java/com/threerings/puzzle/server/PuzzleGameDispatcher.java +++ b/src/java/com/threerings/puzzle/server/PuzzleGameDispatcher.java @@ -22,7 +22,6 @@ package com.threerings.puzzle.server; import com.threerings.presents.data.ClientObject; -import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationException; import com.threerings.puzzle.data.Board; diff --git a/src/java/com/threerings/puzzle/server/PuzzleGameProvider.java b/src/java/com/threerings/puzzle/server/PuzzleGameProvider.java index 674ab65e..191bc7bc 100644 --- a/src/java/com/threerings/puzzle/server/PuzzleGameProvider.java +++ b/src/java/com/threerings/puzzle/server/PuzzleGameProvider.java @@ -33,10 +33,10 @@ public interface PuzzleGameProvider extends InvocationProvider /** * Handles a {@link PuzzleGameService#updateProgress} request. */ - public void updateProgress (ClientObject caller, int arg1, int[] arg2); + void updateProgress (ClientObject caller, int arg1, int[] arg2); /** * Handles a {@link PuzzleGameService#updateProgressSync} request. */ - public void updateProgressSync (ClientObject caller, int arg1, int[] arg2, Board[] arg3); + void updateProgressSync (ClientObject caller, int arg1, int[] arg2, Board[] arg3); } diff --git a/src/java/com/threerings/puzzle/server/PuzzleManager.java b/src/java/com/threerings/puzzle/server/PuzzleManager.java index c7b74bcb..ff03932d 100644 --- a/src/java/com/threerings/puzzle/server/PuzzleManager.java +++ b/src/java/com/threerings/puzzle/server/PuzzleManager.java @@ -28,18 +28,8 @@ import com.samskivert.util.Interval; import com.samskivert.util.RandomUtil; import com.threerings.presents.data.ClientObject; -import com.threerings.presents.dobj.DObject; -import com.threerings.presents.dobj.OidList; - -import com.threerings.crowd.data.BodyObject; -import com.threerings.crowd.data.PlaceObject; - -import com.threerings.parlor.game.data.GameObject; import com.threerings.parlor.game.server.GameManager; -import com.threerings.util.MessageBundle; -import com.threerings.util.Name; - import com.threerings.puzzle.data.Board; import com.threerings.puzzle.data.BoardSummary; import com.threerings.puzzle.data.PuzzleCodes; @@ -127,7 +117,7 @@ public abstract class PuzzleManager extends GameManager } } - // documentation inherited + @Override protected void playerGameDidEnd (int pidx) { super.playerGameDidEnd(pidx); @@ -158,7 +148,7 @@ public abstract class PuzzleManager extends GameManager return false; } - // documentation inherited + @Override protected void didStartup () { super.didStartup(); @@ -170,7 +160,7 @@ public abstract class PuzzleManager extends GameManager _puzobj.setPuzzleGameService(_invmgr.registerDispatcher(new PuzzleGameDispatcher(this))); } - // documentation inherited + @Override protected void gameWillStart () { int size = getPlayerSlots(); @@ -205,6 +195,7 @@ public abstract class PuzzleManager extends GameManager if (_statusInterval == null && statusInterval > 0) { // register the status update interval to address subsequent periodic updates _statusInterval = new Interval(_omgr) { + @Override public void expired () { sendStatusUpdate(); } @@ -236,7 +227,7 @@ public abstract class PuzzleManager extends GameManager return DEFAULT_DIFFICULTY; } - // documentation inherited + @Override protected void gameDidStart () { super.gameDidStart(); @@ -332,7 +323,7 @@ public abstract class PuzzleManager extends GameManager return (_puzobj.isOccupiedPlayer(pidx)); } - // documentation inherited + @Override protected void gameDidEnd () { if (_statusInterval != null) { @@ -347,7 +338,7 @@ public abstract class PuzzleManager extends GameManager super.gameDidEnd(); } - // documentation inherited + @Override protected void didShutdown () { super.didShutdown(); @@ -452,6 +443,7 @@ public abstract class PuzzleManager extends GameManager * Overrides the game manager implementation to mark all active players as winners. Derived * classes may wish to override this method in order to customize the winning conditions. */ + @Override protected void assignWinners (boolean[] winners) { for (int ii = 0; ii < winners.length; ii++) { @@ -520,7 +512,7 @@ public abstract class PuzzleManager extends GameManager applyProgressEvents(pidx, events, states); } - // documentation inherited + @Override protected void tick (long tickStamp) { super.tick(tickStamp); diff --git a/src/java/com/threerings/puzzle/util/PointSet.java b/src/java/com/threerings/puzzle/util/PointSet.java index bf6360a8..e3c30f63 100644 --- a/src/java/com/threerings/puzzle/util/PointSet.java +++ b/src/java/com/threerings/puzzle/util/PointSet.java @@ -163,9 +163,7 @@ public class PointSet return _count; } - /** - * Returns a string representation of the point set. - */ + @Override public String toString () { StringBuilder buf = new StringBuilder(); diff --git a/src/java/com/threerings/puzzle/util/PuzzleGameUtil.java b/src/java/com/threerings/puzzle/util/PuzzleGameUtil.java index 06006f98..f8702f72 100644 --- a/src/java/com/threerings/puzzle/util/PuzzleGameUtil.java +++ b/src/java/com/threerings/puzzle/util/PuzzleGameUtil.java @@ -33,8 +33,7 @@ import com.threerings.puzzle.client.PuzzlePanel; public class PuzzleGameUtil { /** - * Returns a key translator configured with basic puzzle game - * mappings. + * Returns a key translator configured with basic puzzle game mappings. */ public static KeyTranslatorImpl getKeyTranslator () { @@ -42,8 +41,7 @@ public class PuzzleGameUtil if (!PuzzlePanel.isRobotTesting()) { // add the standard pause keys - xlate.addPressCommand( - KeyEvent.VK_P, PuzzleController.TOGGLE_CHATTING); + xlate.addPressCommand(KeyEvent.VK_P, PuzzleController.TOGGLE_CHATTING); } return xlate; diff --git a/src/java/com/threerings/stage/client/StageSceneController.java b/src/java/com/threerings/stage/client/StageSceneController.java index 4ac99cf3..2804b4cc 100644 --- a/src/java/com/threerings/stage/client/StageSceneController.java +++ b/src/java/com/threerings/stage/client/StageSceneController.java @@ -59,13 +59,13 @@ public class StageSceneController extends SpotSceneController log.warning("handleClusterClicked(" + source + ", " + tuple + ")"); } - // documentation inherited + @Override protected PlaceView createPlaceView (CrowdContext ctx) { return new StageScenePanel((StageContext)ctx, this); } - // documentation inherited + @Override protected void sceneUpdated (SceneUpdate update) { super.sceneUpdated(update); diff --git a/src/java/com/threerings/stage/data/DefaultColorUpdate.java b/src/java/com/threerings/stage/data/DefaultColorUpdate.java index 3ee258a8..c2935e14 100644 --- a/src/java/com/threerings/stage/data/DefaultColorUpdate.java +++ b/src/java/com/threerings/stage/data/DefaultColorUpdate.java @@ -46,7 +46,7 @@ public class DefaultColorUpdate extends SceneUpdate this.colorId = colorId; } - // documentation inherited + @Override public void apply (SceneModel model) { super.apply(model); diff --git a/src/java/com/threerings/stage/data/ModifyObjectsUpdate.java b/src/java/com/threerings/stage/data/ModifyObjectsUpdate.java index 84cb3796..7837495c 100644 --- a/src/java/com/threerings/stage/data/ModifyObjectsUpdate.java +++ b/src/java/com/threerings/stage/data/ModifyObjectsUpdate.java @@ -54,7 +54,7 @@ public class ModifyObjectsUpdate extends SceneUpdate this.removed = removed; } - // documentation inherited + @Override public void apply (SceneModel model) { super.apply(model); diff --git a/src/java/com/threerings/stage/data/StageCodes.java b/src/java/com/threerings/stage/data/StageCodes.java index 211ef94a..4d45e79d 100644 --- a/src/java/com/threerings/stage/data/StageCodes.java +++ b/src/java/com/threerings/stage/data/StageCodes.java @@ -26,8 +26,6 @@ import com.threerings.util.MessageBundle; import com.threerings.presents.data.InvocationCodes; import com.threerings.presents.data.Permission; -import com.threerings.crowd.data.BodyObject; - /** * Codes and constants relating to the Stage system. */ diff --git a/src/java/com/threerings/stage/data/StageLocation.java b/src/java/com/threerings/stage/data/StageLocation.java index cc59e8ef..7a0ad216 100644 --- a/src/java/com/threerings/stage/data/StageLocation.java +++ b/src/java/com/threerings/stage/data/StageLocation.java @@ -91,6 +91,7 @@ public class StageLocation extends SimpleStreamableObject /** * Location equality is determined by coordinates. */ + @Override public boolean equals (Object other) { if (other instanceof StageLocation) { @@ -105,14 +106,13 @@ public class StageLocation extends SimpleStreamableObject /** * Computes a reasonable hashcode for location instances. */ + @Override public int hashCode () { return x ^ y; } - /** - * Creates a clone of this instance. - */ + @Override public Object clone () { try { diff --git a/src/java/com/threerings/stage/data/StageScene.java b/src/java/com/threerings/stage/data/StageScene.java index 3e74baaf..5f9cc564 100644 --- a/src/java/com/threerings/stage/data/StageScene.java +++ b/src/java/com/threerings/stage/data/StageScene.java @@ -25,8 +25,6 @@ import java.util.ArrayList; import java.util.Iterator; import com.threerings.miso.data.ObjectInfo; -import com.threerings.miso.util.MisoUtil; - import com.threerings.crowd.data.PlaceConfig; import com.threerings.whirled.data.Scene; @@ -141,7 +139,7 @@ public class StageScene extends SceneImpl return removed; } - // documentation inherited + @Override public void updateReceived (SceneUpdate update) { super.updateReceived(update); @@ -153,7 +151,7 @@ public class StageScene extends SceneImpl readInterestingObjects(); } - // documentation inherited + @Override public Object clone () throws CloneNotSupportedException { diff --git a/src/java/com/threerings/stage/data/StageSceneConfig.java b/src/java/com/threerings/stage/data/StageSceneConfig.java index 3ae7f998..5fe0092d 100644 --- a/src/java/com/threerings/stage/data/StageSceneConfig.java +++ b/src/java/com/threerings/stage/data/StageSceneConfig.java @@ -31,13 +31,13 @@ import com.threerings.stage.client.StageSceneController; */ public class StageSceneConfig extends PlaceConfig { - // documentation inherited + @Override public PlaceController createController () { return new StageSceneController(); } - // documentation inherited + @Override public String getManagerClassName () { return "com.threerings.stage.server.StageSceneManager"; diff --git a/src/java/com/threerings/stage/data/StageSceneMarshaller.java b/src/java/com/threerings/stage/data/StageSceneMarshaller.java index bd02cf2b..e81392e6 100644 --- a/src/java/com/threerings/stage/data/StageSceneMarshaller.java +++ b/src/java/com/threerings/stage/data/StageSceneMarshaller.java @@ -25,7 +25,6 @@ import com.threerings.miso.data.ObjectInfo; import com.threerings.presents.client.Client; import com.threerings.presents.client.InvocationService; import com.threerings.presents.data.InvocationMarshaller; -import com.threerings.presents.net.Transport; import com.threerings.stage.client.StageSceneService; /** diff --git a/src/java/com/threerings/stage/data/StageSceneModel.java b/src/java/com/threerings/stage/data/StageSceneModel.java index cf1eecaa..7ab19147 100644 --- a/src/java/com/threerings/stage/data/StageSceneModel.java +++ b/src/java/com/threerings/stage/data/StageSceneModel.java @@ -21,7 +21,6 @@ package com.threerings.stage.data; -import com.threerings.util.StreamableArrayList; import com.threerings.util.StreamableIntIntMap; import com.threerings.whirled.data.SceneModel; diff --git a/src/java/com/threerings/stage/server/StageSceneDispatcher.java b/src/java/com/threerings/stage/server/StageSceneDispatcher.java index 0a1c249a..41c4ee1f 100644 --- a/src/java/com/threerings/stage/server/StageSceneDispatcher.java +++ b/src/java/com/threerings/stage/server/StageSceneDispatcher.java @@ -24,7 +24,6 @@ package com.threerings.stage.server; import com.threerings.miso.data.ObjectInfo; import com.threerings.presents.client.InvocationService; import com.threerings.presents.data.ClientObject; -import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationException; import com.threerings.stage.data.StageSceneMarshaller; diff --git a/src/java/com/threerings/stage/server/StageSceneProvider.java b/src/java/com/threerings/stage/server/StageSceneProvider.java index 743fbe51..569ffbd1 100644 --- a/src/java/com/threerings/stage/server/StageSceneProvider.java +++ b/src/java/com/threerings/stage/server/StageSceneProvider.java @@ -35,12 +35,12 @@ public interface StageSceneProvider extends InvocationProvider /** * Handles a {@link StageSceneService#addObject} request. */ - public void addObject (ClientObject caller, ObjectInfo arg1, InvocationService.ConfirmListener arg2) + void addObject (ClientObject caller, ObjectInfo arg1, InvocationService.ConfirmListener arg2) throws InvocationException; /** * Handles a {@link StageSceneService#removeObjects} request. */ - public void removeObjects (ClientObject caller, ObjectInfo[] arg1, InvocationService.ConfirmListener arg2) + void removeObjects (ClientObject caller, ObjectInfo[] arg1, InvocationService.ConfirmListener arg2) throws InvocationException; } diff --git a/src/java/com/threerings/stage/tools/editor/DirectionButton.java b/src/java/com/threerings/stage/tools/editor/DirectionButton.java index e57a0b09..e066fa56 100644 --- a/src/java/com/threerings/stage/tools/editor/DirectionButton.java +++ b/src/java/com/threerings/stage/tools/editor/DirectionButton.java @@ -57,6 +57,7 @@ public class DirectionButton extends AbstractButton setModel(new DefaultButtonModel()); addMouseListener(new MouseAdapter() { + @Override public void mousePressed (MouseEvent event) { if (isEnabled()) { @@ -65,6 +66,7 @@ public class DirectionButton extends AbstractButton } } + @Override public void mouseReleased (MouseEvent event) { if ((_armed != -1) && @@ -87,6 +89,7 @@ public class DirectionButton extends AbstractButton * Paint this component and the selected direction, * dimmed if we're inactive. */ + @Override public void paintComponent (Graphics g) { super.paintComponent(g); @@ -151,7 +154,7 @@ public class DirectionButton extends AbstractButton return -1; } - // documentation inherited + @Override public void setSize (Dimension d) { super.setSize(d); @@ -183,7 +186,7 @@ public class DirectionButton extends AbstractButton } } - // documentation inherited + @Override public Dimension getPreferredSize () { return new Dimension(_prefdia, _prefdia); diff --git a/src/java/com/threerings/stage/tools/editor/EditorFrame.java b/src/java/com/threerings/stage/tools/editor/EditorFrame.java index 08a5d8ad..35ba2d26 100644 --- a/src/java/com/threerings/stage/tools/editor/EditorFrame.java +++ b/src/java/com/threerings/stage/tools/editor/EditorFrame.java @@ -70,6 +70,7 @@ public class EditorFrame extends ManagedJFrame _writer = writer; // treat a closing window as a request to quit addWindowListener(new WindowAdapter () { + @Override public void windowClosing (WindowEvent e) { handleQuit(null); } diff --git a/src/java/com/threerings/stage/tools/editor/EditorModel.java b/src/java/com/threerings/stage/tools/editor/EditorModel.java index 57f2bb7d..ffc463ed 100644 --- a/src/java/com/threerings/stage/tools/editor/EditorModel.java +++ b/src/java/com/threerings/stage/tools/editor/EditorModel.java @@ -237,9 +237,7 @@ public class EditorModel return _objectGrip; } - /** - * Returns a string representation of the editor model. - */ + @Override public String toString () { StringBuilder buf = new StringBuilder(); diff --git a/src/java/com/threerings/stage/tools/editor/EditorScenePanel.java b/src/java/com/threerings/stage/tools/editor/EditorScenePanel.java index 2a6e4d73..4eb94f50 100644 --- a/src/java/com/threerings/stage/tools/editor/EditorScenePanel.java +++ b/src/java/com/threerings/stage/tools/editor/EditorScenePanel.java @@ -135,7 +135,7 @@ public class EditorScenePanel extends StageScenePanel _refreshBox = true; } - // documentation inherited + @Override public void setSceneModel (MisoSceneModel model) { super.setSceneModel(model); @@ -154,7 +154,7 @@ public class EditorScenePanel extends StageScenePanel rethink(); } - // documentation inherited + @Override public void setBounds (int x, int y, int width, int height) { super.setBounds(x, y, width, height); diff --git a/src/java/com/threerings/stage/tools/editor/EditorScrollBox.java b/src/java/com/threerings/stage/tools/editor/EditorScrollBox.java index b9d44d48..215d1c51 100644 --- a/src/java/com/threerings/stage/tools/editor/EditorScrollBox.java +++ b/src/java/com/threerings/stage/tools/editor/EditorScrollBox.java @@ -54,6 +54,7 @@ public class EditorScrollBox extends ScrollBox _panel = panel; _panel.setEditorScrollBox(this); _panel.addComponentListener(new ComponentAdapter() { + @Override public void componentResized (ComponentEvent e) { SwingUtil.refresh(EditorScrollBox.this); @@ -122,7 +123,7 @@ public class EditorScrollBox extends ScrollBox _vert.setValue(y); } - // documentation inherited + @Override public Dimension getPreferredSize () { int horz = _horz.getMaximum() - _horz.getMinimum(); @@ -139,7 +140,7 @@ public class EditorScrollBox extends ScrollBox return new Dimension(width, height); } - // documentation inherited + @Override public void setBounds (int x, int y, int w, int h) { super.setBounds(x, y, w, h); @@ -149,7 +150,7 @@ public class EditorScrollBox extends ScrollBox } } - // documentation inherited + @Override protected void paintBackground (Graphics g) { g.drawImage(_miniMap, 0, 0, null); @@ -171,7 +172,7 @@ public class EditorScrollBox extends ScrollBox g.dispose(); } - // documentation inherited + @Override protected boolean isActiveButton (MouseEvent e) { // all buttons are ok. diff --git a/src/java/com/threerings/stage/tools/editor/ObjectEditorDialog.java b/src/java/com/threerings/stage/tools/editor/ObjectEditorDialog.java index 4aa4a24d..ea7e026f 100644 --- a/src/java/com/threerings/stage/tools/editor/ObjectEditorDialog.java +++ b/src/java/com/threerings/stage/tools/editor/ObjectEditorDialog.java @@ -216,6 +216,7 @@ public class ObjectEditorDialog extends EditorDialog return colorId - ((ZationChoice)other).colorId; } + @Override public String toString () { return name; diff --git a/src/java/com/threerings/stage/tools/editor/PortalDialog.java b/src/java/com/threerings/stage/tools/editor/PortalDialog.java index 19cb8164..d44c99fc 100644 --- a/src/java/com/threerings/stage/tools/editor/PortalDialog.java +++ b/src/java/com/threerings/stage/tools/editor/PortalDialog.java @@ -138,7 +138,7 @@ public class PortalDialog extends EditorDialog } } - // documentation inherited + @Override protected void processKeyEvent (KeyEvent e) { switch (e.getKeyCode()) { diff --git a/src/java/com/threerings/stage/tools/editor/PortalTool.java b/src/java/com/threerings/stage/tools/editor/PortalTool.java index 442e8f26..3dad88ac 100644 --- a/src/java/com/threerings/stage/tools/editor/PortalTool.java +++ b/src/java/com/threerings/stage/tools/editor/PortalTool.java @@ -32,7 +32,6 @@ import com.threerings.miso.util.MisoUtil; import com.threerings.util.DirectionCodes; import com.threerings.util.DirectionUtil; -import com.threerings.whirled.spot.data.Location; import com.threerings.whirled.spot.tools.EditablePortal; import com.threerings.stage.data.StageLocation; @@ -72,6 +71,7 @@ public class PortalTool extends MouseInputAdapter /** * When the mouse is dragged we update the current portal. */ + @Override public void mouseDragged (MouseEvent event) { calculateOrientation(event.getX(), event.getY()); @@ -81,6 +81,7 @@ public class PortalTool extends MouseInputAdapter * If button1 is released, we store the new portal, if button3: we * cancel. */ + @Override public void mouseReleased (MouseEvent event) { switch (event.getButton()) { diff --git a/src/java/com/threerings/stage/tools/editor/SceneInfoPanel.java b/src/java/com/threerings/stage/tools/editor/SceneInfoPanel.java index 83279241..7bbc7904 100644 --- a/src/java/com/threerings/stage/tools/editor/SceneInfoPanel.java +++ b/src/java/com/threerings/stage/tools/editor/SceneInfoPanel.java @@ -36,14 +36,11 @@ import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; import javax.swing.event.PopupMenuEvent; import javax.swing.event.PopupMenuListener; import com.samskivert.swing.GroupLayout; import com.samskivert.swing.HGroupLayout; -import com.samskivert.util.CollectionUtil; import com.samskivert.util.Collections; import com.samskivert.util.ComparableArrayList; @@ -93,6 +90,7 @@ public class SceneInfoPanel extends JPanel hbox.add(createLabel("Scene name:", _scenename = new JTextField(10))); _scenename.addActionListener(this); _scenename.addFocusListener(new FocusAdapter() { + @Override public void focusLost (FocusEvent e) { _scenename.postActionEvent(); } diff --git a/src/java/com/threerings/stage/tools/editor/TestTileLoader.java b/src/java/com/threerings/stage/tools/editor/TestTileLoader.java index d0e4afb2..ee67a77f 100644 --- a/src/java/com/threerings/stage/tools/editor/TestTileLoader.java +++ b/src/java/com/threerings/stage/tools/editor/TestTileLoader.java @@ -39,7 +39,6 @@ import com.threerings.media.tile.TileSetIDBroker; import com.threerings.miso.tile.tools.xml.BaseTileSetRuleSet; import com.threerings.media.tile.tools.xml.ObjectTileSetRuleSet; -import com.threerings.media.tile.tools.xml.SwissArmyTileSetRuleSet; import com.threerings.media.tile.tools.xml.XMLTileSetParser; import static com.threerings.stage.Log.log; @@ -184,6 +183,7 @@ public class TestTileLoader implements TileSetIDBroker /** Our image provider. */ protected ImageProvider _improv = new SimpleCachingImageProvider() { + @Override protected BufferedImage loadImage (String path) throws IOException { return ImageIO.read(new File(path)); diff --git a/src/java/com/threerings/stage/tools/editor/TileInfoPanel.java b/src/java/com/threerings/stage/tools/editor/TileInfoPanel.java index f542c0cf..77084f47 100644 --- a/src/java/com/threerings/stage/tools/editor/TileInfoPanel.java +++ b/src/java/com/threerings/stage/tools/editor/TileInfoPanel.java @@ -152,6 +152,7 @@ public class TileInfoPanel extends JSplitPane _quickList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); _quickList.addListSelectionListener(this); _quickList.setCellRenderer(new DefaultListCellRenderer() { + @Override public Component getListCellRendererComponent ( JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) @@ -197,6 +198,7 @@ public class TileInfoPanel extends JSplitPane protected void registerKeyListener (EditorContext ctx) { ctx.getKeyDispatcher().addGlobalKeyListener(new KeyAdapter() { + @Override public void keyTyped (KeyEvent e) { char keychar = e.getKeyChar(); @@ -251,7 +253,7 @@ public class TileInfoPanel extends JSplitPane } } - // documentation inherited + @Override public Dimension getPreferredSize () { return new Dimension(WIDTH, HEIGHT); @@ -598,7 +600,7 @@ public class TileInfoPanel extends JSplitPane return 1; } - // documentation inherited + @Override public String getColumnName (int columnIndex) { return null; @@ -631,7 +633,7 @@ public class TileInfoPanel extends JSplitPane return (_icons[row] = new ImageIcon(img)); } - // documentation inherited + @Override public Class getColumnClass (int c) { // return the object associated with the column to force @@ -673,6 +675,7 @@ public class TileInfoPanel extends JSplitPane return tileSet.getName(); } + @Override public String toString () { return shortname; @@ -684,6 +687,7 @@ public class TileInfoPanel extends JSplitPane ((TileSetRecord) o).fullname()); } + @Override public boolean equals (Object o) { if (o instanceof TileSetRecord) { diff --git a/src/java/com/threerings/stage/tools/viewer/ViewerApp.java b/src/java/com/threerings/stage/tools/viewer/ViewerApp.java index 5a9bf3e1..e2989a58 100644 --- a/src/java/com/threerings/stage/tools/viewer/ViewerApp.java +++ b/src/java/com/threerings/stage/tools/viewer/ViewerApp.java @@ -27,10 +27,8 @@ import java.awt.GraphicsConfiguration; import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; -import java.io.File; import java.io.IOException; -import com.samskivert.swing.RuntimeAdjust; import com.samskivert.swing.util.SwingUtil; import com.threerings.resource.ResourceManager; diff --git a/src/java/com/threerings/stage/tools/viewer/ViewerFrame.java b/src/java/com/threerings/stage/tools/viewer/ViewerFrame.java index 3fb5f653..1ab55529 100644 --- a/src/java/com/threerings/stage/tools/viewer/ViewerFrame.java +++ b/src/java/com/threerings/stage/tools/viewer/ViewerFrame.java @@ -23,7 +23,6 @@ package com.threerings.stage.tools.viewer; import java.awt.BorderLayout; import java.awt.Color; -import java.awt.Component; import java.awt.GraphicsConfiguration; import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; @@ -118,9 +117,11 @@ public class ViewerFrame extends ManagedJFrame String where = System.getProperty("user.dir"); JFileChooser chooser = new JFileChooser(where); chooser.setFileFilter(new FileFilter () { + @Override public boolean accept (File f) { return (f.isDirectory() || f.getName().endsWith(".xml")); } + @Override public String getDescription () { return "XML Files"; } diff --git a/src/java/com/threerings/stage/tools/viewer/ViewerScenePanel.java b/src/java/com/threerings/stage/tools/viewer/ViewerScenePanel.java index 79db8adf..06549c99 100644 --- a/src/java/com/threerings/stage/tools/viewer/ViewerScenePanel.java +++ b/src/java/com/threerings/stage/tools/viewer/ViewerScenePanel.java @@ -21,10 +21,8 @@ package com.threerings.stage.tools.viewer; -import java.awt.Dimension; import java.awt.Graphics; import java.awt.Point; -import java.awt.Rectangle; import java.awt.event.MouseEvent; import com.samskivert.swing.Controller; @@ -36,12 +34,10 @@ import com.threerings.media.util.PerformanceObserver; import com.threerings.cast.CharacterDescriptor; import com.threerings.cast.CharacterManager; import com.threerings.cast.CharacterSprite; -import com.threerings.cast.ComponentRepository; import com.threerings.cast.util.CastUtil; import com.threerings.media.sprite.PathObserver; import com.threerings.media.sprite.Sprite; -import com.threerings.media.sprite.SpriteManager; import com.threerings.media.util.LineSegmentPath; import com.threerings.media.util.Path; @@ -156,7 +152,7 @@ public class ViewerScenePanel extends StageScenePanel } } - // documentation inherited + @Override public void paint (Graphics g) { super.paint(g); @@ -169,7 +165,7 @@ public class ViewerScenePanel extends StageScenePanel log.info(name + " [ticks=" + ticks + "]."); } - /** MouseListener interface methods */ + @Override public void mousePressed (MouseEvent e) { int x = e.getX(), y = e.getY(); diff --git a/src/java/com/threerings/stage/tools/xml/StageMisoSceneRuleSet.java b/src/java/com/threerings/stage/tools/xml/StageMisoSceneRuleSet.java index d8d1b452..22166b2e 100644 --- a/src/java/com/threerings/stage/tools/xml/StageMisoSceneRuleSet.java +++ b/src/java/com/threerings/stage/tools/xml/StageMisoSceneRuleSet.java @@ -32,6 +32,7 @@ import com.threerings.stage.data.StageMisoSceneModel; */ public class StageMisoSceneRuleSet extends SparseMisoSceneRuleSet { + @Override protected SparseMisoSceneModel createMisoSceneModel () { return new StageMisoSceneModel(); diff --git a/src/java/com/threerings/stage/tools/xml/StageSceneParser.java b/src/java/com/threerings/stage/tools/xml/StageSceneParser.java index ed151f94..89bf286d 100644 --- a/src/java/com/threerings/stage/tools/xml/StageSceneParser.java +++ b/src/java/com/threerings/stage/tools/xml/StageSceneParser.java @@ -48,6 +48,7 @@ public class StageSceneParser extends SceneParser // add a rule to parse scene colorizations _digester.addRule("scene/zations/zation", new Rule() { + @Override public void begin (String namespace, String name, Attributes attrs) throws Exception { StageSceneModel yoscene = (StageSceneModel) digester.peek(); @@ -59,6 +60,7 @@ public class StageSceneParser extends SceneParser // add rule sets for our aux scene models registerAuxRuleSet(new SpotSceneRuleSet() { + @Override protected Location createLocation () { return new StageLocation(); } @@ -66,7 +68,7 @@ public class StageSceneParser extends SceneParser registerAuxRuleSet(new StageMisoSceneRuleSet()); } - // documentation inherited from interface + @Override protected SceneRuleSet createSceneRuleSet () { return new StageSceneRuleSet(); diff --git a/src/java/com/threerings/stage/tools/xml/StageSceneRuleSet.java b/src/java/com/threerings/stage/tools/xml/StageSceneRuleSet.java index 30209929..c5ee0b37 100644 --- a/src/java/com/threerings/stage/tools/xml/StageSceneRuleSet.java +++ b/src/java/com/threerings/stage/tools/xml/StageSceneRuleSet.java @@ -31,7 +31,7 @@ import com.threerings.stage.data.StageSceneModel; */ public class StageSceneRuleSet extends SceneRuleSet { - // documentation inherited + @Override protected Class getSceneClass () { return StageSceneModel.class; diff --git a/src/java/com/threerings/stage/tools/xml/StageSceneWriter.java b/src/java/com/threerings/stage/tools/xml/StageSceneWriter.java index 027b12b8..c5856a90 100644 --- a/src/java/com/threerings/stage/tools/xml/StageSceneWriter.java +++ b/src/java/com/threerings/stage/tools/xml/StageSceneWriter.java @@ -51,7 +51,7 @@ public class StageSceneWriter extends SceneWriter new SparseMisoSceneWriter()); } - // documentation inherited + @Override protected void addSceneAttributes (SceneModel scene, AttributesImpl attrs) { super.addSceneAttributes(scene, attrs); @@ -59,7 +59,7 @@ public class StageSceneWriter extends SceneWriter attrs.addAttribute("", "type", "", "", sscene.type); } - // documentation inherited + @Override protected void writeSceneData (SceneModel scene, DataWriter writer) throws SAXException { diff --git a/src/java/com/threerings/stage/util/PlacementConstraints.java b/src/java/com/threerings/stage/util/PlacementConstraints.java index be3211fc..ed5928ad 100644 --- a/src/java/com/threerings/stage/util/PlacementConstraints.java +++ b/src/java/com/threerings/stage/util/PlacementConstraints.java @@ -28,8 +28,6 @@ import java.util.HashMap; import java.util.Iterator; import com.samskivert.util.ListUtil; -import com.samskivert.util.StringUtil; - import com.threerings.util.DirectionCodes; import com.threerings.util.DirectionUtil; import com.threerings.util.MessageBundle; diff --git a/src/java/com/threerings/stage/util/StageContext.java b/src/java/com/threerings/stage/util/StageContext.java index ef1d112f..78db37c4 100644 --- a/src/java/com/threerings/stage/util/StageContext.java +++ b/src/java/com/threerings/stage/util/StageContext.java @@ -30,7 +30,6 @@ import com.threerings.media.FrameManager; import com.threerings.media.image.ColorPository; import com.threerings.media.image.ImageManager; -import com.threerings.cast.CharacterManager; import com.threerings.cast.ComponentRepository; import com.threerings.miso.util.MisoContext; diff --git a/src/java/com/threerings/stats/data/Stat.java b/src/java/com/threerings/stats/data/Stat.java index eedc5c90..3d2d13d2 100644 --- a/src/java/com/threerings/stats/data/Stat.java +++ b/src/java/com/threerings/stats/data/Stat.java @@ -9,8 +9,6 @@ import java.util.zip.CRC32; import com.samskivert.util.HashIntMap; import com.samskivert.util.StringUtil; -import com.threerings.util.MessageBundle; - import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; @@ -170,9 +168,7 @@ public abstract class Stat public abstract void unpersistFrom (ObjectInputStream in, AuxDataSource aux) throws IOException, ClassNotFoundException; - /** - * Generates a string representation of this instance. - */ + @Override public String toString () { StringBuffer buf = new StringBuffer(StringUtil.toUSLowerCase(_type.name())); @@ -193,7 +189,7 @@ public abstract class Stat return _type.name(); } - // documentation inherited from Cloneable + @Override public Object clone () { try { diff --git a/src/java/com/threerings/stats/data/StringMapStat.java b/src/java/com/threerings/stats/data/StringMapStat.java index b52a63a2..cac9654d 100644 --- a/src/java/com/threerings/stats/data/StringMapStat.java +++ b/src/java/com/threerings/stats/data/StringMapStat.java @@ -4,7 +4,6 @@ package com.threerings.stats.data; import com.samskivert.util.ArrayUtil; -import com.samskivert.util.StringUtil; /** * Used to track a statistic comprised of a set of strings that map to numeric counts. @@ -73,7 +72,7 @@ public abstract class StringMapStat extends Stat return false; } - @Override // documentation inherited + @Override public String valueToString () { StringBuffer buf = new StringBuffer("["); diff --git a/src/java/com/threerings/stats/server/persist/StatRepository.java b/src/java/com/threerings/stats/server/persist/StatRepository.java index 8fa5eb5a..ee80881d 100644 --- a/src/java/com/threerings/stats/server/persist/StatRepository.java +++ b/src/java/com/threerings/stats/server/persist/StatRepository.java @@ -120,6 +120,7 @@ public class StatRepository extends DepotRepository public void invalidate (PersistenceContext ctx) { ctx.cacheTraverse( StatRecord.class.getName(), new CacheEvictionFilter() { + @Override public boolean testForEviction (Serializable key, StatRecord record) { return record != null && record.playerId == playerId; } @@ -382,7 +383,7 @@ public class StatRepository extends DepotRepository rmap.put(code, value); } - @Override // from DepotRepository + @Override protected void getManagedRecords (Set> classes) { classes.add(StatRecord.class); diff --git a/src/java/com/threerings/whirled/client/SceneController.java b/src/java/com/threerings/whirled/client/SceneController.java index bb30f8e2..a61878b4 100644 --- a/src/java/com/threerings/whirled/client/SceneController.java +++ b/src/java/com/threerings/whirled/client/SceneController.java @@ -40,21 +40,21 @@ import com.threerings.whirled.util.WhirledContext; */ public abstract class SceneController extends PlaceController { - // documentation inherited + @Override public void init (CrowdContext ctx, PlaceConfig config) { super.init(ctx, config); _wctx = (WhirledContext)ctx; } - // documentation inherited + @Override public void willEnterPlace (PlaceObject plobj) { super.willEnterPlace(plobj); plobj.addListener(_updateListener); } - // documentation inherited + @Override public void didLeavePlace (PlaceObject plobj) { super.didLeavePlace(plobj); diff --git a/src/java/com/threerings/whirled/client/SceneDirector.java b/src/java/com/threerings/whirled/client/SceneDirector.java index ebb9476a..f519d01f 100644 --- a/src/java/com/threerings/whirled/client/SceneDirector.java +++ b/src/java/com/threerings/whirled/client/SceneDirector.java @@ -483,7 +483,7 @@ public class SceneDirector extends BasicDirector } } - // documentation inherited from interface + @Override public void clientDidLogoff (Client client) { super.clientDidLogoff(client); @@ -497,13 +497,13 @@ public class SceneDirector extends BasicDirector _sservice = null; } - // documentation inherited from interface + @Override protected void registerServices (Client client) { client.addServiceGroup(WHIRLED_GROUP); } - // documentation inherited from interface + @Override protected void fetchServices (Client client) { // get a handle on our scene service diff --git a/src/java/com/threerings/whirled/data/DefaultSceneConfig.java b/src/java/com/threerings/whirled/data/DefaultSceneConfig.java index 77df77c3..1632e91c 100644 --- a/src/java/com/threerings/whirled/data/DefaultSceneConfig.java +++ b/src/java/com/threerings/whirled/data/DefaultSceneConfig.java @@ -36,7 +36,7 @@ import com.threerings.whirled.client.SceneController; */ public class DefaultSceneConfig extends PlaceConfig { - // documentation inherited + @Override public String getManagerClassName () { return "com.threerings.whirled.server.SceneManager"; diff --git a/src/java/com/threerings/whirled/data/SceneImpl.java b/src/java/com/threerings/whirled/data/SceneImpl.java index e03338b8..20ec7995 100644 --- a/src/java/com/threerings/whirled/data/SceneImpl.java +++ b/src/java/com/threerings/whirled/data/SceneImpl.java @@ -110,9 +110,7 @@ public class SceneImpl implements Scene return _model; } - /** - * Generates a string representation of this instance. - */ + @Override public String toString () { return "[model=" + _model + ", config=" + _config + "]"; diff --git a/src/java/com/threerings/whirled/data/SceneMarshaller.java b/src/java/com/threerings/whirled/data/SceneMarshaller.java index f56225bf..bdad0c60 100644 --- a/src/java/com/threerings/whirled/data/SceneMarshaller.java +++ b/src/java/com/threerings/whirled/data/SceneMarshaller.java @@ -25,7 +25,6 @@ import com.threerings.crowd.data.PlaceConfig; import com.threerings.presents.client.Client; import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.dobj.InvocationResponseEvent; -import com.threerings.presents.net.Transport; import com.threerings.whirled.client.SceneService; /** diff --git a/src/java/com/threerings/whirled/data/SceneModel.java b/src/java/com/threerings/whirled/data/SceneModel.java index 233d59b0..4ce1709a 100644 --- a/src/java/com/threerings/whirled/data/SceneModel.java +++ b/src/java/com/threerings/whirled/data/SceneModel.java @@ -60,7 +60,7 @@ public class SceneModel extends SimpleStreamableObject auxModels = ArrayUtil.append(auxModels, auxModel); } - // documentation inherited + @Override public Object clone () throws CloneNotSupportedException { diff --git a/src/java/com/threerings/whirled/data/SceneUpdate.java b/src/java/com/threerings/whirled/data/SceneUpdate.java index 097568a1..f748be01 100644 --- a/src/java/com/threerings/whirled/data/SceneUpdate.java +++ b/src/java/com/threerings/whirled/data/SceneUpdate.java @@ -172,9 +172,7 @@ public class SceneUpdate } } - /** - * Generates a string representation of this instance. - */ + @Override public String toString () { StringBuilder buf = new StringBuilder("["); diff --git a/src/java/com/threerings/whirled/server/AbstractSceneMoveHandler.java b/src/java/com/threerings/whirled/server/AbstractSceneMoveHandler.java index 51841023..bc146bce 100644 --- a/src/java/com/threerings/whirled/server/AbstractSceneMoveHandler.java +++ b/src/java/com/threerings/whirled/server/AbstractSceneMoveHandler.java @@ -28,7 +28,6 @@ import com.threerings.presents.server.InvocationException; import com.threerings.crowd.data.BodyObject; import com.threerings.crowd.server.LocationManager; -import com.threerings.whirled.client.SceneService; import com.threerings.whirled.data.SceneCodes; import static com.threerings.whirled.Log.log; diff --git a/src/java/com/threerings/whirled/server/SceneDispatcher.java b/src/java/com/threerings/whirled/server/SceneDispatcher.java index 75d1ac01..e328816c 100644 --- a/src/java/com/threerings/whirled/server/SceneDispatcher.java +++ b/src/java/com/threerings/whirled/server/SceneDispatcher.java @@ -22,7 +22,6 @@ package com.threerings.whirled.server; import com.threerings.presents.data.ClientObject; -import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationException; import com.threerings.whirled.client.SceneService; diff --git a/src/java/com/threerings/whirled/server/SceneManager.java b/src/java/com/threerings/whirled/server/SceneManager.java index f60ee3cc..db699b91 100644 --- a/src/java/com/threerings/whirled/server/SceneManager.java +++ b/src/java/com/threerings/whirled/server/SceneManager.java @@ -35,7 +35,6 @@ import com.threerings.whirled.data.Scene; import com.threerings.whirled.data.SceneCodes; import com.threerings.whirled.data.ScenePlace; import com.threerings.whirled.data.SceneUpdate; -import com.threerings.whirled.server.WhirledServer; import com.threerings.whirled.util.UpdateList; import static com.threerings.whirled.Log.log; @@ -64,7 +63,7 @@ public class SceneManager extends PlaceManager return _updates.getUpdates(fromVersion); } - @Override // from PlaceManager + @Override public Place getLocation () { return new ScenePlace(_plobj.getOid(), _scene.getId()); @@ -115,6 +114,7 @@ public class SceneManager extends PlaceManager * We're fully ready to go, so now we register ourselves with the scene registry which will * make us available to the clients and system at large. */ + @Override protected void didStartup () { super.didStartup(); @@ -128,9 +128,7 @@ public class SceneManager extends PlaceManager }); } - /** - * Called when we have shutdown. - */ + @Override protected void didShutdown () { super.didShutdown(); @@ -161,6 +159,7 @@ public class SceneManager extends PlaceManager // and apply and store it in the repository if (isPersistent()) { _invoker.postUnit(new WriteOnlyUnit("recordUpdate(" + update + ")") { + @Override public void invokePersist () throws Exception { _screg.getSceneRepository().applyAndRecordUpdate(_scene.getSceneModel(), update); } @@ -171,13 +170,13 @@ public class SceneManager extends PlaceManager _plobj.postMessage(SceneCodes.SCENE_UPDATE, new Object[] { update }); } - // documentation inherited + @Override public String where () { return _scene.getName() + " (" + super.where() + ":" + _scene.getId() + ")"; } - // documentation inherited + @Override protected void toString (StringBuilder buf) { super.toString(buf); diff --git a/src/java/com/threerings/whirled/server/SceneMoveHandler.java b/src/java/com/threerings/whirled/server/SceneMoveHandler.java index 2fc34f15..71847b4a 100644 --- a/src/java/com/threerings/whirled/server/SceneMoveHandler.java +++ b/src/java/com/threerings/whirled/server/SceneMoveHandler.java @@ -21,7 +21,6 @@ package com.threerings.whirled.server; -import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.server.InvocationException; import com.threerings.crowd.data.BodyObject; @@ -29,7 +28,6 @@ import com.threerings.crowd.data.PlaceConfig; import com.threerings.crowd.server.LocationManager; import com.threerings.whirled.client.SceneService; -import com.threerings.whirled.data.SceneCodes; import com.threerings.whirled.data.SceneModel; import com.threerings.whirled.data.SceneUpdate; @@ -45,7 +43,7 @@ public class SceneMoveHandler extends AbstractSceneMoveHandler _version = sceneVer; } - @Override // from AbstractSceneMoveHandler + @Override protected void effectSceneMove (SceneManager scmgr) throws InvocationException { diff --git a/src/java/com/threerings/whirled/server/SceneProvider.java b/src/java/com/threerings/whirled/server/SceneProvider.java index d4b77f4c..f6f7e556 100644 --- a/src/java/com/threerings/whirled/server/SceneProvider.java +++ b/src/java/com/threerings/whirled/server/SceneProvider.java @@ -34,6 +34,6 @@ public interface SceneProvider extends InvocationProvider /** * Handles a {@link SceneService#moveTo} request. */ - public void moveTo (ClientObject caller, int arg1, int arg2, SceneService.SceneMoveListener arg3) + void moveTo (ClientObject caller, int arg1, int arg2, SceneService.SceneMoveListener arg3) throws InvocationException; } diff --git a/src/java/com/threerings/whirled/server/SceneRegistry.java b/src/java/com/threerings/whirled/server/SceneRegistry.java index 99341451..48f74b02 100644 --- a/src/java/com/threerings/whirled/server/SceneRegistry.java +++ b/src/java/com/threerings/whirled/server/SceneRegistry.java @@ -34,8 +34,6 @@ import com.samskivert.util.Invoker; import com.threerings.presents.annotation.MainInvoker; import com.threerings.presents.data.ClientObject; -import com.threerings.presents.data.InvocationMarshaller; -import com.threerings.presents.server.InvocationException; import com.threerings.presents.server.InvocationManager; import com.threerings.crowd.data.BodyObject; @@ -48,7 +46,6 @@ import com.threerings.whirled.client.SceneService; import com.threerings.whirled.data.Scene; import com.threerings.whirled.data.SceneCodes; import com.threerings.whirled.data.SceneModel; -import com.threerings.whirled.data.SceneUpdate; import com.threerings.whirled.server.persist.SceneRepository; import com.threerings.whirled.util.NoSuchSceneException; import com.threerings.whirled.util.SceneFactory; @@ -169,13 +166,16 @@ public class SceneRegistry // otherwise we have to load the scene from the repository final int fsceneId = sceneId; _invoker.postUnit(new RepositoryUnit("resolveScene(" + sceneId + ")") { + @Override public void invokePersist () throws Exception { _model = _screp.loadSceneModel(fsceneId); _updates = _screp.loadUpdates(fsceneId); } + @Override public void handleSuccess () { processSuccessfulResolution(_model, _updates); } + @Override public void handleFailure (Exception error) { processFailedResolution(fsceneId, error); } diff --git a/src/java/com/threerings/whirled/server/SceneSender.java b/src/java/com/threerings/whirled/server/SceneSender.java index 9eef544a..95790620 100644 --- a/src/java/com/threerings/whirled/server/SceneSender.java +++ b/src/java/com/threerings/whirled/server/SceneSender.java @@ -22,7 +22,6 @@ package com.threerings.whirled.server; import com.threerings.presents.data.ClientObject; -import com.threerings.presents.net.Transport; import com.threerings.presents.server.InvocationSender; import com.threerings.whirled.client.SceneDecoder; import com.threerings.whirled.client.SceneReceiver; diff --git a/src/java/com/threerings/whirled/server/WhirledServer.java b/src/java/com/threerings/whirled/server/WhirledServer.java index 6001d302..447a5580 100644 --- a/src/java/com/threerings/whirled/server/WhirledServer.java +++ b/src/java/com/threerings/whirled/server/WhirledServer.java @@ -21,7 +21,6 @@ package com.threerings.whirled.server; -import com.google.inject.Inject; import com.google.inject.Injector; import com.threerings.util.Name; @@ -33,11 +32,6 @@ import com.threerings.presents.server.PresentsClient; import com.threerings.crowd.server.CrowdServer; -import com.threerings.whirled.server.persist.SceneRepository; -import com.threerings.whirled.util.SceneFactory; - -import static com.threerings.whirled.Log.log; - /** * The Whirled server extends the {@link CrowdServer} and provides access to managers and the like * that are needed by the Whirled serviecs. @@ -53,7 +47,7 @@ public abstract class WhirledServer extends CrowdServer } } - @Override // from CrowdServer + @Override public void init (Injector injector) throws Exception { diff --git a/src/java/com/threerings/whirled/spot/client/SpotSceneDirector.java b/src/java/com/threerings/whirled/spot/client/SpotSceneDirector.java index 69c12135..b632e806 100644 --- a/src/java/com/threerings/whirled/spot/client/SpotSceneDirector.java +++ b/src/java/com/threerings/whirled/spot/client/SpotSceneDirector.java @@ -77,6 +77,7 @@ public class SpotSceneDirector extends BasicDirector // wire ourselves up to hear about leave place notifications locdir.addLocationObserver(new LocationAdapter() { + @Override public void locationDidChange (PlaceObject place) { // we need to clear some things out when we leave a place handleDeparture(); @@ -347,7 +348,7 @@ public class SpotSceneDirector extends BasicDirector } } - // documentation inherited + @Override public void clientDidLogon (Client client) { super.clientDidLogon(client); @@ -363,7 +364,7 @@ public class SpotSceneDirector extends BasicDirector } } - // documentation inherited + @Override public void clientObjectDidChange (Client client) { super.clientObjectDidChange(client); @@ -374,7 +375,7 @@ public class SpotSceneDirector extends BasicDirector _self = (ClusteredBodyObject) clientObj; } - // documentation inherited + @Override public void clientDidLogoff (Client client) { super.clientDidLogoff(client); @@ -390,7 +391,7 @@ public class SpotSceneDirector extends BasicDirector _self = null; } - // documentation inherited + @Override protected void fetchServices (Client client) { _sservice = client.requireService(SpotService.class); diff --git a/src/java/com/threerings/whirled/spot/data/Cluster.java b/src/java/com/threerings/whirled/spot/data/Cluster.java index f2c1b113..454ffc64 100644 --- a/src/java/com/threerings/whirled/spot/data/Cluster.java +++ b/src/java/com/threerings/whirled/spot/data/Cluster.java @@ -49,7 +49,7 @@ public class Cluster extends Rectangle return _key; } - // documentation inherited + @Override @ActionScript(omit=true) public boolean equals (Object other) { @@ -60,15 +60,13 @@ public class Cluster extends Rectangle } } - // documentation inherited + @Override public int hashCode () { return clusterOid; } - /** - * Generates a string representation of this instance. - */ + @Override public String toString () { return StringUtil.fieldsToString(this); diff --git a/src/java/com/threerings/whirled/spot/data/Portal.java b/src/java/com/threerings/whirled/spot/data/Portal.java index 7e218e45..10f18bf4 100644 --- a/src/java/com/threerings/whirled/spot/data/Portal.java +++ b/src/java/com/threerings/whirled/spot/data/Portal.java @@ -84,9 +84,7 @@ public class Portal extends SimpleStreamableObject ((targetPortalId > 0) || (targetPortalId == -1)); } - /** - * Creates a clone of this instance. - */ + @Override public Object clone () { try { @@ -99,6 +97,7 @@ public class Portal extends SimpleStreamableObject /** * Portal equality is determined by portal id. */ + @Override public boolean equals (Object other) { return (other instanceof Portal) && @@ -108,6 +107,7 @@ public class Portal extends SimpleStreamableObject /** * Computes a reasonable hashcode for portal instances. */ + @Override public int hashCode () { return portalId; diff --git a/src/java/com/threerings/whirled/spot/data/SceneLocation.java b/src/java/com/threerings/whirled/spot/data/SceneLocation.java index 3ab2f097..fa39f254 100644 --- a/src/java/com/threerings/whirled/spot/data/SceneLocation.java +++ b/src/java/com/threerings/whirled/spot/data/SceneLocation.java @@ -63,14 +63,14 @@ public class SceneLocation extends SimpleStreamableObject return _key; } - // documentation inherited + @Override public boolean equals (Object other) { return (other instanceof SceneLocation) && this.loc.equals(((SceneLocation) other).loc); } - // documentation inherited + @Override public int hashCode () { return loc.hashCode(); diff --git a/src/java/com/threerings/whirled/spot/data/SpotMarshaller.java b/src/java/com/threerings/whirled/spot/data/SpotMarshaller.java index 02942afc..9742bdaf 100644 --- a/src/java/com/threerings/whirled/spot/data/SpotMarshaller.java +++ b/src/java/com/threerings/whirled/spot/data/SpotMarshaller.java @@ -24,7 +24,6 @@ package com.threerings.whirled.spot.data; import com.threerings.presents.client.Client; import com.threerings.presents.client.InvocationService; import com.threerings.presents.data.InvocationMarshaller; -import com.threerings.presents.net.Transport; import com.threerings.whirled.client.SceneService; import com.threerings.whirled.data.SceneMarshaller; import com.threerings.whirled.spot.client.SpotService; diff --git a/src/java/com/threerings/whirled/spot/data/SpotSceneModel.java b/src/java/com/threerings/whirled/spot/data/SpotSceneModel.java index 643e111d..6a23ed22 100644 --- a/src/java/com/threerings/whirled/spot/data/SpotSceneModel.java +++ b/src/java/com/threerings/whirled/spot/data/SpotSceneModel.java @@ -65,7 +65,7 @@ public class SpotSceneModel extends SimpleStreamableObject } } - // documentation inherited + @Override public Object clone () throws CloneNotSupportedException { diff --git a/src/java/com/threerings/whirled/spot/server/SpotDispatcher.java b/src/java/com/threerings/whirled/spot/server/SpotDispatcher.java index 88115555..6ddf84c2 100644 --- a/src/java/com/threerings/whirled/spot/server/SpotDispatcher.java +++ b/src/java/com/threerings/whirled/spot/server/SpotDispatcher.java @@ -23,7 +23,6 @@ package com.threerings.whirled.spot.server; import com.threerings.presents.client.InvocationService; import com.threerings.presents.data.ClientObject; -import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationException; import com.threerings.whirled.client.SceneService; diff --git a/src/java/com/threerings/whirled/spot/server/SpotProvider.java b/src/java/com/threerings/whirled/spot/server/SpotProvider.java index b077c929..c8422d48 100644 --- a/src/java/com/threerings/whirled/spot/server/SpotProvider.java +++ b/src/java/com/threerings/whirled/spot/server/SpotProvider.java @@ -36,23 +36,23 @@ public interface SpotProvider extends InvocationProvider /** * Handles a {@link SpotService#changeLocation} request. */ - public void changeLocation (ClientObject caller, int arg1, Location arg2, InvocationService.ConfirmListener arg3) + void changeLocation (ClientObject caller, int arg1, Location arg2, InvocationService.ConfirmListener arg3) throws InvocationException; /** * Handles a {@link SpotService#clusterSpeak} request. */ - public void clusterSpeak (ClientObject caller, String arg1, byte arg2); + void clusterSpeak (ClientObject caller, String arg1, byte arg2); /** * Handles a {@link SpotService#joinCluster} request. */ - public void joinCluster (ClientObject caller, int arg1, InvocationService.ConfirmListener arg2) + void joinCluster (ClientObject caller, int arg1, InvocationService.ConfirmListener arg2) throws InvocationException; /** * Handles a {@link SpotService#traversePortal} request. */ - public void traversePortal (ClientObject caller, int arg1, int arg2, int arg3, SceneService.SceneMoveListener arg4) + void traversePortal (ClientObject caller, int arg1, int arg2, int arg3, SceneService.SceneMoveListener arg4) throws InvocationException; } diff --git a/src/java/com/threerings/whirled/spot/server/SpotSceneManager.java b/src/java/com/threerings/whirled/spot/server/SpotSceneManager.java index 96bf1d33..42259f70 100644 --- a/src/java/com/threerings/whirled/spot/server/SpotSceneManager.java +++ b/src/java/com/threerings/whirled/spot/server/SpotSceneManager.java @@ -111,7 +111,7 @@ public class SpotSceneManager extends SceneManager updateLocation(body, portal.getLocation()); } - // documentation inherited + @Override protected void didStartup () { // get a casted reference to our place object (we need to do this before calling @@ -122,7 +122,7 @@ public class SpotSceneManager extends SceneManager super.didStartup(); } - // documentation inherited + @Override protected void gotSceneData () { super.gotSceneData(); @@ -131,7 +131,7 @@ public class SpotSceneManager extends SceneManager _sscene = (SpotScene)_scene; } - // documentation inherited + @Override protected void bodyLeft (int bodyOid) { super.bodyLeft(bodyOid); @@ -160,7 +160,7 @@ public class SpotSceneManager extends SceneManager } } - // documentation inherited + @Override protected void insertOccupantInfo (OccupantInfo info, BodyObject body) { super.insertOccupantInfo(info, body); @@ -564,6 +564,7 @@ public class SpotSceneManager extends SceneManager return _cluster; } + @Override public String toString () { return "[cluster=" + _cluster + ", size=" + size() + "]"; diff --git a/src/java/com/threerings/whirled/spot/server/SpotSceneRegistry.java b/src/java/com/threerings/whirled/spot/server/SpotSceneRegistry.java index ff54face..f5cf8879 100644 --- a/src/java/com/threerings/whirled/spot/server/SpotSceneRegistry.java +++ b/src/java/com/threerings/whirled/spot/server/SpotSceneRegistry.java @@ -29,17 +29,12 @@ import com.threerings.util.Name; import com.threerings.presents.data.ClientObject; import com.threerings.presents.data.InvocationMarshaller; -import com.threerings.presents.dobj.RootDObjectManager; import com.threerings.presents.server.InvocationException; import com.threerings.presents.server.InvocationManager; -import com.threerings.presents.server.InvocationProvider; - import com.threerings.crowd.chat.data.ChatCodes; import com.threerings.crowd.chat.data.UserMessage; import com.threerings.crowd.chat.server.SpeakUtil; import com.threerings.crowd.data.BodyObject; -import com.threerings.crowd.server.PlaceRegistry; - import com.threerings.whirled.client.SceneService; import com.threerings.whirled.data.SceneCodes; import com.threerings.whirled.data.ScenePlace; diff --git a/src/java/com/threerings/whirled/spot/tools/xml/SpotSceneRuleSet.java b/src/java/com/threerings/whirled/spot/tools/xml/SpotSceneRuleSet.java index 2cb3f1c2..bfc74439 100644 --- a/src/java/com/threerings/whirled/spot/tools/xml/SpotSceneRuleSet.java +++ b/src/java/com/threerings/whirled/spot/tools/xml/SpotSceneRuleSet.java @@ -84,7 +84,7 @@ public abstract class SpotSceneRuleSet implements NestableRuleSet _ruleset = ruleset; } - // documentation inherited + @Override public void begin (String namespace, String name, Attributes attributes) throws Exception { @@ -105,7 +105,7 @@ public abstract class SpotSceneRuleSet implements NestableRuleSet */ protected static class PortalFieldsRule extends Rule { - // documentation inherited + @Override public void begin (String namespace, String name, Attributes attrs) throws Exception { diff --git a/src/java/com/threerings/whirled/zone/client/ZoneDirector.java b/src/java/com/threerings/whirled/zone/client/ZoneDirector.java index d41c380e..db123fb8 100644 --- a/src/java/com/threerings/whirled/zone/client/ZoneDirector.java +++ b/src/java/com/threerings/whirled/zone/client/ZoneDirector.java @@ -148,13 +148,13 @@ public class ZoneDirector extends BasicDirector return true; } - // documentation inherited + @Override protected void fetchServices (Client client) { _zservice = client.requireService(ZoneService.class); } - // documentation inherited + @Override public void clientDidLogoff (Client client) { super.clientDidLogoff(client); diff --git a/src/java/com/threerings/whirled/zone/data/SceneSummary.java b/src/java/com/threerings/whirled/zone/data/SceneSummary.java index 8414003a..3da3c672 100644 --- a/src/java/com/threerings/whirled/zone/data/SceneSummary.java +++ b/src/java/com/threerings/whirled/zone/data/SceneSummary.java @@ -46,9 +46,7 @@ public class SceneSummary implements Streamable /** The directions in which each of the neighbors lay. */ public int[] neighborDirs; - /** - * Generates a string representation of this instance. - */ + @Override public String toString () { return "[sceneId=" + sceneId + ", name=" + name + diff --git a/src/java/com/threerings/whirled/zone/data/ZoneMarshaller.java b/src/java/com/threerings/whirled/zone/data/ZoneMarshaller.java index e3063670..64c97b5e 100644 --- a/src/java/com/threerings/whirled/zone/data/ZoneMarshaller.java +++ b/src/java/com/threerings/whirled/zone/data/ZoneMarshaller.java @@ -25,7 +25,6 @@ import com.threerings.crowd.data.PlaceConfig; import com.threerings.presents.client.Client; import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.dobj.InvocationResponseEvent; -import com.threerings.presents.net.Transport; import com.threerings.whirled.data.SceneModel; import com.threerings.whirled.data.SceneUpdate; import com.threerings.whirled.zone.client.ZoneService; diff --git a/src/java/com/threerings/whirled/zone/data/ZoneSummary.java b/src/java/com/threerings/whirled/zone/data/ZoneSummary.java index 9c04eecd..bd1cc38e 100644 --- a/src/java/com/threerings/whirled/zone/data/ZoneSummary.java +++ b/src/java/com/threerings/whirled/zone/data/ZoneSummary.java @@ -42,9 +42,7 @@ public class ZoneSummary extends SimpleStreamableObject /** The summary information for all of the scenes in the zone. */ public SceneSummary[] scenes; - /** - * Generates a string representation of this instance. - */ + @Override public String toString () { return "[zoneId=" + zoneId + ", name=" + name + diff --git a/src/java/com/threerings/whirled/zone/server/ZoneDispatcher.java b/src/java/com/threerings/whirled/zone/server/ZoneDispatcher.java index 4ed831eb..05b86c9a 100644 --- a/src/java/com/threerings/whirled/zone/server/ZoneDispatcher.java +++ b/src/java/com/threerings/whirled/zone/server/ZoneDispatcher.java @@ -22,7 +22,6 @@ package com.threerings.whirled.zone.server; import com.threerings.presents.data.ClientObject; -import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.server.InvocationDispatcher; import com.threerings.presents.server.InvocationException; import com.threerings.whirled.zone.client.ZoneService; diff --git a/src/java/com/threerings/whirled/zone/server/ZoneMoveHandler.java b/src/java/com/threerings/whirled/zone/server/ZoneMoveHandler.java index d2addc4c..a72f8641 100644 --- a/src/java/com/threerings/whirled/zone/server/ZoneMoveHandler.java +++ b/src/java/com/threerings/whirled/zone/server/ZoneMoveHandler.java @@ -27,12 +27,10 @@ import com.threerings.crowd.data.BodyObject; import com.threerings.crowd.data.PlaceConfig; import com.threerings.crowd.server.LocationManager; -import com.threerings.whirled.client.SceneService; import com.threerings.whirled.data.SceneModel; import com.threerings.whirled.data.SceneUpdate; import com.threerings.whirled.server.AbstractSceneMoveHandler; import com.threerings.whirled.server.SceneManager; -import com.threerings.whirled.server.SceneMoveHandler; import com.threerings.whirled.server.SceneRegistry; import com.threerings.whirled.zone.client.ZoneService; @@ -81,7 +79,7 @@ public class ZoneMoveHandler extends AbstractSceneMoveHandler _listener.requestFailed(ZoneCodes.NO_SUCH_ZONE); } - @Override // from AbstractSceneMoveHandler + @Override protected void effectSceneMove (SceneManager scmgr) throws InvocationException { diff --git a/src/java/com/threerings/whirled/zone/server/ZoneProvider.java b/src/java/com/threerings/whirled/zone/server/ZoneProvider.java index 86f7b202..beabd15d 100644 --- a/src/java/com/threerings/whirled/zone/server/ZoneProvider.java +++ b/src/java/com/threerings/whirled/zone/server/ZoneProvider.java @@ -34,6 +34,6 @@ public interface ZoneProvider extends InvocationProvider /** * Handles a {@link ZoneService#moveTo} request. */ - public void moveTo (ClientObject caller, int arg1, int arg2, int arg3, ZoneService.ZoneMoveListener arg4) + void moveTo (ClientObject caller, int arg1, int arg2, int arg3, ZoneService.ZoneMoveListener arg4) throws InvocationException; } diff --git a/src/java/com/threerings/whirled/zone/server/ZoneSender.java b/src/java/com/threerings/whirled/zone/server/ZoneSender.java index fafbaacb..7cf49f2a 100644 --- a/src/java/com/threerings/whirled/zone/server/ZoneSender.java +++ b/src/java/com/threerings/whirled/zone/server/ZoneSender.java @@ -22,7 +22,6 @@ package com.threerings.whirled.zone.server; import com.threerings.presents.data.ClientObject; -import com.threerings.presents.net.Transport; import com.threerings.presents.server.InvocationSender; import com.threerings.whirled.zone.client.ZoneDecoder; import com.threerings.whirled.zone.client.ZoneReceiver; diff --git a/tests/src/java/com/threerings/parlor/TestClient.java b/tests/src/java/com/threerings/parlor/TestClient.java index 31ebaa14..eff26d99 100644 --- a/tests/src/java/com/threerings/parlor/TestClient.java +++ b/tests/src/java/com/threerings/parlor/TestClient.java @@ -24,14 +24,10 @@ package com.threerings.parlor; import com.threerings.util.Name; import com.threerings.presents.client.*; -import com.threerings.presents.net.*; - -import com.threerings.crowd.client.*; import com.threerings.crowd.data.BodyObject; import com.threerings.crowd.util.CrowdContext; import com.threerings.parlor.client.*; -import com.threerings.parlor.game.client.*; import com.threerings.parlor.game.data.*; import com.threerings.parlor.util.ParlorContext; @@ -51,6 +47,7 @@ public class TestClient extends com.threerings.crowd.client.TestClient _pardtr.setInvitationHandler(this); } + @Override public void clientDidLogon (Client client) { // we intentionally don't call super() @@ -98,6 +95,7 @@ public class TestClient extends com.threerings.crowd.client.TestClient ", config=" + config + "]."); } + @Override protected CrowdContext createContext () { return (_ctx = new ParlorContextImpl()); diff --git a/tests/src/java/com/threerings/parlor/TestConfig.java b/tests/src/java/com/threerings/parlor/TestConfig.java index 26525d67..8b1ecea7 100644 --- a/tests/src/java/com/threerings/parlor/TestConfig.java +++ b/tests/src/java/com/threerings/parlor/TestConfig.java @@ -30,31 +30,37 @@ public class TestConfig extends GameConfig /** The foozle parameter. */ public int foozle; + @Override public int getGameId () { return 0; } + @Override public String getGameIdent () { return "test"; } + @Override public GameConfigurator createConfigurator () { return null; } + @Override public PlaceController createController () { return new TestController(); } + @Override public String getManagerClassName () { return "com.threerings.parlor.test.TestManager"; } + @Override protected void toString (StringBuilder buf) { super.toString(buf); diff --git a/tests/src/java/com/threerings/parlor/TestController.java b/tests/src/java/com/threerings/parlor/TestController.java index 2661fcd4..954a942e 100644 --- a/tests/src/java/com/threerings/parlor/TestController.java +++ b/tests/src/java/com/threerings/parlor/TestController.java @@ -27,6 +27,7 @@ import com.threerings.parlor.game.client.GameController; public class TestController extends GameController { + @Override public PlaceView createPlaceView (CrowdContext ctx) { // nothing doing diff --git a/tests/src/java/com/threerings/parlor/rating/util/PercentilerTest.java b/tests/src/java/com/threerings/parlor/rating/util/PercentilerTest.java index daa2c1da..86a8ac3f 100644 --- a/tests/src/java/com/threerings/parlor/rating/util/PercentilerTest.java +++ b/tests/src/java/com/threerings/parlor/rating/util/PercentilerTest.java @@ -36,6 +36,7 @@ public class PercentilerTest extends TestCase super(PercentilerTest.class.getName()); } + @Override public void runTest () { // create a percentiler diff --git a/tests/src/java/com/threerings/whirled/TestClient.java b/tests/src/java/com/threerings/whirled/TestClient.java index 0ede453d..a2fe7ed4 100644 --- a/tests/src/java/com/threerings/whirled/TestClient.java +++ b/tests/src/java/com/threerings/whirled/TestClient.java @@ -59,6 +59,7 @@ public class TestClient extends com.threerings.crowd.client.TestClient _locdir.addLocationObserver(this); } + @Override public void clientDidLogon (Client client) { // we specifically do not call super() @@ -85,6 +86,7 @@ public class TestClient extends com.threerings.crowd.client.TestClient log.warning("Location change failed [plid=" + placeId + ", reason=" + reason + "]."); } + @Override protected CrowdContext createContext () { return (_ctx = new WhirledContextImpl()); diff --git a/tests/src/java/com/threerings/whirled/TestConfig.java b/tests/src/java/com/threerings/whirled/TestConfig.java index 6a7ecb23..77ba0d2a 100644 --- a/tests/src/java/com/threerings/whirled/TestConfig.java +++ b/tests/src/java/com/threerings/whirled/TestConfig.java @@ -27,11 +27,13 @@ import com.threerings.whirled.server.SceneManager; public class TestConfig extends PlaceConfig { + @Override public PlaceController createController () { return new TestController(); } + @Override public String getManagerClassName () { return SceneManager.class.getName(); diff --git a/tests/src/java/com/threerings/whirled/TestController.java b/tests/src/java/com/threerings/whirled/TestController.java index b1721183..f7e95278 100644 --- a/tests/src/java/com/threerings/whirled/TestController.java +++ b/tests/src/java/com/threerings/whirled/TestController.java @@ -26,6 +26,7 @@ import com.threerings.crowd.util.CrowdContext; public class TestController extends PlaceController { + @Override protected PlaceView createPlaceView (CrowdContext ctx) { // nothing doing diff --git a/tests/src/java/com/threerings/whirled/spot/tools/xml/SpotSceneParserTest.java b/tests/src/java/com/threerings/whirled/spot/tools/xml/SpotSceneParserTest.java index 8cdb133e..d7f361c3 100644 --- a/tests/src/java/com/threerings/whirled/spot/tools/xml/SpotSceneParserTest.java +++ b/tests/src/java/com/threerings/whirled/spot/tools/xml/SpotSceneParserTest.java @@ -39,11 +39,13 @@ public class SpotSceneParserTest extends TestCase super(SpotSceneParserTest.class.getName()); } + @Override public void runTest () { try { SceneParser parser = new SceneParser("scene"); parser.registerAuxRuleSet(new SpotSceneRuleSet() { + @Override protected Location createLocation () { return new StageLocation(); // breaks package, but ok } diff --git a/tests/src/java/com/threerings/whirled/tools/xml/SceneParserTest.java b/tests/src/java/com/threerings/whirled/tools/xml/SceneParserTest.java index a8575f6e..5edaaa52 100644 --- a/tests/src/java/com/threerings/whirled/tools/xml/SceneParserTest.java +++ b/tests/src/java/com/threerings/whirled/tools/xml/SceneParserTest.java @@ -35,6 +35,7 @@ public class SceneParserTest extends TestCase super(SceneParserTest.class.getName()); } + @Override public void runTest () { try {