From d5c07e75641bc99f34489afd609ade6a8c3cbfdb Mon Sep 17 00:00:00 2001 From: Wouter Smeenk Date: Wed, 15 Sep 2010 23:06:32 +0200 Subject: [PATCH] cleanup --- .../walledin/engine/gui/AbstractScreen.java | 2 +- .../java/walledin/engine/gui/FontType.java | 20 +++++++++++++++++++ .../engine/gui/components/ListView.java | 4 ++-- .../engine/gui/components/Slider.java | 20 +++++++++++++++++++ .../walledin/engine/input/MouseEvent.java | 20 +++++++++++++++++++ .../engine/input/MouseEventListener.java | 20 +++++++++++++++++++ .../walledin/game/PlayerActionManager.java | 2 +- .../walledin/game/gui/MainMenuScreen.java | 1 - .../game/gui/components/ServerList.java | 5 ++--- 9 files changed, 86 insertions(+), 8 deletions(-) diff --git a/src/main/java/walledin/engine/gui/AbstractScreen.java b/src/main/java/walledin/engine/gui/AbstractScreen.java index 2f956cb..475255e 100644 --- a/src/main/java/walledin/engine/gui/AbstractScreen.java +++ b/src/main/java/walledin/engine/gui/AbstractScreen.java @@ -566,7 +566,7 @@ public final void sendKeyDownMessage(final ScreenKeyEvent e) { * * @return True if it has the focus, else false. */ - private final boolean hasFocus() { + private boolean hasFocus() { return getManager().getFocusedScreen() == this; } diff --git a/src/main/java/walledin/engine/gui/FontType.java b/src/main/java/walledin/engine/gui/FontType.java index 52f5d18..bbfc512 100644 --- a/src/main/java/walledin/engine/gui/FontType.java +++ b/src/main/java/walledin/engine/gui/FontType.java @@ -1,3 +1,23 @@ +/* Copyright 2010 Ben Ruijl, Wouter Smeenk + +This file is part of Walled In. + +Walled In is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +Walled In is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Walled In; see the file LICENSE. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + + */ package walledin.engine.gui; public enum FontType { diff --git a/src/main/java/walledin/engine/gui/components/ListView.java b/src/main/java/walledin/engine/gui/components/ListView.java index 82b75b5..a93ec67 100644 --- a/src/main/java/walledin/engine/gui/components/ListView.java +++ b/src/main/java/walledin/engine/gui/components/ListView.java @@ -67,7 +67,7 @@ public String[] getData() { private final int numColumns; private final Button[] columns; private float[] columnWidth; - private float[] accumulatedColumnWidth; + private final float[] accumulatedColumnWidth; private final List> data; private Comparator> lastComparator; private int selected; @@ -194,7 +194,7 @@ public int compare(final RowData o1, final RowData o2) { }; } - protected void onListItemClicked(T item) { + protected void onListItemClicked(final T item) { } @Override diff --git a/src/main/java/walledin/engine/gui/components/Slider.java b/src/main/java/walledin/engine/gui/components/Slider.java index e036144..90d70ce 100644 --- a/src/main/java/walledin/engine/gui/components/Slider.java +++ b/src/main/java/walledin/engine/gui/components/Slider.java @@ -1,3 +1,23 @@ +/* Copyright 2010 Ben Ruijl, Wouter Smeenk + +This file is part of Walled In. + +Walled In is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +Walled In is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Walled In; see the file LICENSE. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + + */ package walledin.engine.gui.components; import java.util.ArrayList; diff --git a/src/main/java/walledin/engine/input/MouseEvent.java b/src/main/java/walledin/engine/input/MouseEvent.java index 6296ba6..d6e76b9 100644 --- a/src/main/java/walledin/engine/input/MouseEvent.java +++ b/src/main/java/walledin/engine/input/MouseEvent.java @@ -1,3 +1,23 @@ +/* Copyright 2010 Ben Ruijl, Wouter Smeenk + +This file is part of Walled In. + +Walled In is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +Walled In is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Walled In; see the file LICENSE. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + + */ package walledin.engine.input; import walledin.engine.math.Vector2i; diff --git a/src/main/java/walledin/engine/input/MouseEventListener.java b/src/main/java/walledin/engine/input/MouseEventListener.java index 260e8ef..af73721 100644 --- a/src/main/java/walledin/engine/input/MouseEventListener.java +++ b/src/main/java/walledin/engine/input/MouseEventListener.java @@ -1,3 +1,23 @@ +/* Copyright 2010 Ben Ruijl, Wouter Smeenk + +This file is part of Walled In. + +Walled In is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +Walled In is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Walled In; see the file LICENSE. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + + */ package walledin.engine.input; public interface MouseEventListener { diff --git a/src/main/java/walledin/game/PlayerActionManager.java b/src/main/java/walledin/game/PlayerActionManager.java index 2943500..b7815bd 100644 --- a/src/main/java/walledin/game/PlayerActionManager.java +++ b/src/main/java/walledin/game/PlayerActionManager.java @@ -32,7 +32,7 @@ import walledin.engine.input.Input; import walledin.util.SettingsManager; -public final class PlayerActionManager { +public final class PlayerActionManager { private static final Logger LOG = Logger .getLogger(PlayerActionManager.class); private static PlayerActionManager ref = null; diff --git a/src/main/java/walledin/game/gui/MainMenuScreen.java b/src/main/java/walledin/game/gui/MainMenuScreen.java index 4ecdf84..d078947 100644 --- a/src/main/java/walledin/game/gui/MainMenuScreen.java +++ b/src/main/java/walledin/game/gui/MainMenuScreen.java @@ -28,7 +28,6 @@ import walledin.engine.gui.ScreenMouseEvent; import walledin.engine.gui.ScreenMouseEventListener; import walledin.engine.gui.components.Button; -import walledin.engine.gui.components.ListView; import walledin.engine.math.Rectangle; import walledin.engine.math.Vector2f; import walledin.game.ClientLogicManager; diff --git a/src/main/java/walledin/game/gui/components/ServerList.java b/src/main/java/walledin/game/gui/components/ServerList.java index e752ac0..4cb2200 100644 --- a/src/main/java/walledin/game/gui/components/ServerList.java +++ b/src/main/java/walledin/game/gui/components/ServerList.java @@ -20,7 +20,6 @@ */ package walledin.game.gui.components; -import java.util.ArrayList; import java.util.List; import walledin.engine.Font; @@ -66,8 +65,8 @@ public void update(final double delta) { /* Start with an empty list. */ resetData(); - for (ServerData serverData : serverList) { - String[] stringData = { serverData.getName(), + for (final ServerData serverData : serverList) { + final String[] stringData = { serverData.getName(), serverData.getPlayers() + "/" + serverData.getMaxPlayers(), serverData.getGameMode().toString() }; addData(new RowData(serverData, stringData));