Skip to content
Snippets Groups Projects
Commit 90e5225e authored by Pedroza Aguirre Isaac's avatar Pedroza Aguirre Isaac
Browse files

ADD: kickout and new admin pop-up

parent 6832e47e
No related branches found
No related tags found
No related merge requests found
...@@ -3,35 +3,8 @@ ...@@ -3,35 +3,8 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="688d774d-cfc7-4b0d-b00c-5ca931aba600" name="Default Changelist" comment=""> <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$/.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/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/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> </list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
......
No preview for this file type
No preview for this file type
No preview for this file type
...@@ -137,6 +137,10 @@ public class StartScreen { ...@@ -137,6 +137,10 @@ public class StartScreen {
showKickAllMessage(); showKickAllMessage();
setAppTerminated(false); setAppTerminated(false);
} }
if (isKickedOut()){
showKickOutMessage();
setKickedOut(false);
}
} }
}); });
} }
...@@ -167,6 +171,12 @@ public class StartScreen { ...@@ -167,6 +171,12 @@ public class StartScreen {
JOptionPane.ERROR_MESSAGE); 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 // public class JPanelWithBackground extends JPanel
// { // {
// //
......
...@@ -84,10 +84,26 @@ public class ClientUpdate extends UnicastRemoteObject implements IClientUpdate, ...@@ -84,10 +84,26 @@ public class ClientUpdate extends UnicastRemoteObject implements IClientUpdate,
int answer = -1; int answer = -1;
switch (action) { switch (action) {
case KICKOUT: case KICKOUT:
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"); client.getChatScreen().getChatDisplayBox().append(toClient + " has been kicked out by the manager.\n");
}
break; break;
case ASSIGNADMIN: case ASSIGNADMIN:
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"); client.getChatScreen().getChatDisplayBox().append(toClient + " is the new manager.\n");
}
break; break;
case KICKALL: case KICKALL:
client.getStartScreen().setAppTerminated(true); client.getStartScreen().setAppTerminated(true);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment