diff --git a/.idea/workspace.xml b/.idea/workspace.xml index cd073818600ff16ecd032ff184098891b457be37..bba76bb3446b239c997ee19683b5768a2833a7a9 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,35 +3,8 @@ <component name="ChangeListManager"> <list default="true" id="688d774d-cfc7-4b0d-b00c-5ca931aba600" name="Default Changelist" comment=""> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/ApplicationMain$1.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/ApplicationMain$1.class" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/ApplicationMain.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/ApplicationMain.class" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/ChatScreen$1.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/ChatScreen$1.class" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/ChatScreen.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/ChatScreen.class" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/PaintGUI.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/PaintGUI.class" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/StartScreen$1.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/StartScreen$1.class" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/StartScreen$2.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/StartScreen$2.class" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/StartScreen.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/StartScreen.class" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/client/Client.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/client/Client.class" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/client/ClientUpdate$1.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/client/ClientUpdate$1.class" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/client/ClientUpdate.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/client/ClientUpdate.class" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/remote/IClientController$Action.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/remote/IClientController$Action.class" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/remote/IClientController.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/remote/IClientController.class" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/remote/IClientUpdate$Action.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/remote/IClientUpdate$Action.class" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/remote/IClientUpdate.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/remote/IClientUpdate.class" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/server/ClientController$1.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/server/ClientController$1.class" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/server/ClientController.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/server/ClientController.class" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/server/Server.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/server/Server.class" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/src/GUI/ApplicationMain.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/GUI/ApplicationMain.java" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/src/GUI/ChatScreen.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/GUI/ChatScreen.java" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/src/GUI/PaintGUI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/GUI/PaintGUI.java" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/src/GUI/StartScreen.form" beforeDir="false" afterPath="$PROJECT_DIR$/src/GUI/StartScreen.form" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/GUI/StartScreen.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/GUI/StartScreen.java" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/src/client/Client.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/client/Client.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/client/ClientUpdate.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/client/ClientUpdate.java" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/src/remote/IClientController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/remote/IClientController.java" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/src/remote/IClientUpdate.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/remote/IClientUpdate.java" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/src/server/ClientController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/server/ClientController.java" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/src/server/Server.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/server/Server.java" afterDir="false" /> </list> <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> <option name="SHOW_DIALOG" value="false" /> diff --git a/out/production/infinitymonkeys/GUI/StartScreen$3.class b/out/production/infinitymonkeys/GUI/StartScreen$3.class index 0be661b8057c888f890e19e6ae5c15ce9e7041b1..518d641f6a8b5d00f22a2a394329f5868a804048 100644 Binary files a/out/production/infinitymonkeys/GUI/StartScreen$3.class and b/out/production/infinitymonkeys/GUI/StartScreen$3.class differ diff --git a/out/production/infinitymonkeys/GUI/StartScreen.class b/out/production/infinitymonkeys/GUI/StartScreen.class index dbf9f6b974b0d0fde53e901f7cd0980230de39a8..67ffc5eaa6080087efbd693ba23540030533ff35 100644 Binary files a/out/production/infinitymonkeys/GUI/StartScreen.class and b/out/production/infinitymonkeys/GUI/StartScreen.class differ diff --git a/out/production/infinitymonkeys/client/ClientUpdate.class b/out/production/infinitymonkeys/client/ClientUpdate.class index 1554fe715b5103907147acd114f82a60bd60cdcc..546c909d1a2d5ac4faace3164e5479d8faa5159b 100644 Binary files a/out/production/infinitymonkeys/client/ClientUpdate.class and b/out/production/infinitymonkeys/client/ClientUpdate.class differ diff --git a/src/GUI/StartScreen.java b/src/GUI/StartScreen.java index 914b944282084a1fcf8af96b298b90aeae63b0e3..141e03fd5cc87841d41836a44fbd9b71813823d8 100644 --- a/src/GUI/StartScreen.java +++ b/src/GUI/StartScreen.java @@ -137,6 +137,10 @@ public class StartScreen { showKickAllMessage(); setAppTerminated(false); } + if (isKickedOut()){ + showKickOutMessage(); + setKickedOut(false); + } } }); } @@ -167,6 +171,12 @@ public class StartScreen { JOptionPane.ERROR_MESSAGE); } + public void showKickOutMessage() { + JOptionPane.showMessageDialog(null, + "The manager kicked you out the whiteboard", "Kicked out", + JOptionPane.ERROR_MESSAGE); + } + // public class JPanelWithBackground extends JPanel // { // diff --git a/src/client/ClientUpdate.java b/src/client/ClientUpdate.java index 1e5389a054f6e48ff5860df8efd68a5f1f03c990..a45130052bdc3db3fcc0662f42ca4a854fdb92f8 100644 --- a/src/client/ClientUpdate.java +++ b/src/client/ClientUpdate.java @@ -84,10 +84,26 @@ public class ClientUpdate extends UnicastRemoteObject implements IClientUpdate, int answer = -1; switch (action) { case KICKOUT: - client.getChatScreen().getChatDisplayBox().append(toClient + " has been kicked out by the manager.\n"); + if (client.getUserName().equals(toClient)) { + client.getStartScreen().setKickedOut(true); + client.getApplicationMain().exitApplication(); + client.getChatScreen().getChatDisplayBox().append(" You were kicked out by the manager.\n"); + } + else { + client.getChatScreen().getChatDisplayBox().append(toClient + " has been kicked out by the manager.\n"); + } break; case ASSIGNADMIN: - client.getChatScreen().getChatDisplayBox().append(toClient + " is the new manager.\n"); + if (client.getUserName().equals(toClient)) { + JOptionPane.showMessageDialog(null, + "Congratulations! the manager promoted you, now you are the new manager.", + "Promoted", + JOptionPane.INFORMATION_MESSAGE); + client.getChatScreen().getChatDisplayBox().append("You are the new manager.\n"); + } + else { + client.getChatScreen().getChatDisplayBox().append(toClient + " is the new manager.\n"); + } break; case KICKALL: client.getStartScreen().setAppTerminated(true);