diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index a6d533214b50764a97b1022d828a6633479a8e19..bd680ec3dd6a54e5a7789c6a688cedf3147ed03e 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -2,17 +2,10 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="688d774d-cfc7-4b0d-b00c-5ca931aba600" name="Default Changelist" comment="">
- <change afterPath="$PROJECT_DIR$/src/GUI/ApplicationMain.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/src/GUI/ChatScreen.form" beforeDir="false" afterPath="$PROJECT_DIR$/src/GUI/ChatScreen.form" 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/client/ChatUpdate.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/client/ChatUpdate.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/DrawingUpdate.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/client/DrawingUpdate.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/User.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/server/User.java" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
@@ -78,7 +71,7 @@
</list>
</option>
</component>
- <component name="RunManager" selected="Application.Server">
+ <component name="RunManager" selected="Application.Client2">
<configuration name="Client 3" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="client.Client" />
<module name="infinitymonkeys" />
@@ -129,7 +122,7 @@
<option name="presentableId" value="Default" />
<updated>1571631720382</updated>
<workItem from="1571631723795" duration="17601000" />
- <workItem from="1571654347656" duration="20302000" />
+ <workItem from="1571654347656" duration="23038000" />
</task>
<task id="LOCAL-00001" summary="Changed the join method to send over a reference of the ClientUpdate Interface">
<created>1571646862883</created>
diff --git a/out/production/infinitymonkeys/GUI/ApplicationMain$1.class b/out/production/infinitymonkeys/GUI/ApplicationMain$1.class
new file mode 100644
index 0000000000000000000000000000000000000000..66ad2b26d091a2656ffe2572cb67dbfe567ca28a
Binary files /dev/null and b/out/production/infinitymonkeys/GUI/ApplicationMain$1.class differ
diff --git a/out/production/infinitymonkeys/GUI/ApplicationMain.class b/out/production/infinitymonkeys/GUI/ApplicationMain.class
new file mode 100644
index 0000000000000000000000000000000000000000..309584808c8eb3ec50ed40cf6d244b112afbda2e
Binary files /dev/null and b/out/production/infinitymonkeys/GUI/ApplicationMain.class differ
diff --git a/out/production/infinitymonkeys/GUI/ChatScreen$1.class b/out/production/infinitymonkeys/GUI/ChatScreen$1.class
index e5351eda8653b944c5b5a1c45e528d33b5f893e6..56cdcbcbf2f86b521207d3d7ef08d179414726d1 100644
Binary files a/out/production/infinitymonkeys/GUI/ChatScreen$1.class and b/out/production/infinitymonkeys/GUI/ChatScreen$1.class differ
diff --git a/out/production/infinitymonkeys/GUI/ChatScreen$2.class b/out/production/infinitymonkeys/GUI/ChatScreen$2.class
deleted file mode 100644
index 85463d202dcded639b7ad7d60bf5bb0d22da1512..0000000000000000000000000000000000000000
Binary files a/out/production/infinitymonkeys/GUI/ChatScreen$2.class and /dev/null differ
diff --git a/out/production/infinitymonkeys/GUI/ChatScreen.class b/out/production/infinitymonkeys/GUI/ChatScreen.class
index 71a58897e8c0cc4cf66f42a9f276ff7ab10ec343..eac97e0cb1bc8d8aceabb2a196762bfc3a48b4d6 100644
Binary files a/out/production/infinitymonkeys/GUI/ChatScreen.class and b/out/production/infinitymonkeys/GUI/ChatScreen.class differ
diff --git a/out/production/infinitymonkeys/GUI/PaintGUI$1.class b/out/production/infinitymonkeys/GUI/PaintGUI$1.class
index cc90a9c6246be3e81b09d9081b834ead1f6cc592..5a07ea2a0857d35e02879ff2acf0c9a200156c0d 100644
Binary files a/out/production/infinitymonkeys/GUI/PaintGUI$1.class and b/out/production/infinitymonkeys/GUI/PaintGUI$1.class differ
diff --git a/out/production/infinitymonkeys/GUI/PaintGUI.class b/out/production/infinitymonkeys/GUI/PaintGUI.class
index 592ac85cd5cd5ffa4ac44a16db9b3f65232a079d..907fcc25e6b8ebdc3902c860e02dcaef93c12376 100644
Binary files a/out/production/infinitymonkeys/GUI/PaintGUI.class and b/out/production/infinitymonkeys/GUI/PaintGUI.class differ
diff --git a/out/production/infinitymonkeys/client/ChatUpdate.class b/out/production/infinitymonkeys/client/ChatUpdate.class
index 67a49f505beee840b3e57a9e85b034dd23bf2d8c..bc8354438e73505c3b27ae6f6e02e6fdfd4c4a2d 100644
Binary files a/out/production/infinitymonkeys/client/ChatUpdate.class and b/out/production/infinitymonkeys/client/ChatUpdate.class differ
diff --git a/out/production/infinitymonkeys/client/Client.class b/out/production/infinitymonkeys/client/Client.class
index 8383d03a66abfaa23c51240fa8b3f0efaf8e1da2..25b422f21b3a3abe635f6566307f45821f70a399 100644
Binary files a/out/production/infinitymonkeys/client/Client.class and b/out/production/infinitymonkeys/client/Client.class differ
diff --git a/out/production/infinitymonkeys/client/DrawingUpdate.class b/out/production/infinitymonkeys/client/DrawingUpdate.class
index a3b8302dd9e3252b1941eb2af93b54760ea2b35b..9f226e2b4bc72085c560ac2dd87bc6b4b9fd53d7 100644
Binary files a/out/production/infinitymonkeys/client/DrawingUpdate.class and b/out/production/infinitymonkeys/client/DrawingUpdate.class differ
diff --git a/out/production/infinitymonkeys/server/User.class b/out/production/infinitymonkeys/server/User.class
index a82ad43f335c18a83de06d206fede36f98e49c41..bb1cfcbe52b605032645164945747218b2160ba8 100644
Binary files a/out/production/infinitymonkeys/server/User.class and b/out/production/infinitymonkeys/server/User.class differ
diff --git a/src/GUI/ApplicationMain.java b/src/GUI/ApplicationMain.java
index 6c35fece617762f9bc54f63078cf3fc41c3c9dfc..c7b86f80b9bdd8c08c9ab1646f435893ef9bd680 100644
--- a/src/GUI/ApplicationMain.java
+++ b/src/GUI/ApplicationMain.java
@@ -9,10 +9,10 @@ import java.awt.event.WindowEvent;
import java.rmi.RemoteException;
public class ApplicationMain extends JPanel {
- Client client;
- ChatScreen chatScreen;
- PaintGUI paintGUI;
- JFrame frame;
+ private Client client;
+ private ChatScreen chatScreen;
+ private PaintGUI paintGUI;
+ private JFrame frame;
public ChatScreen getChatScreen() { return chatScreen; }
diff --git a/src/GUI/ChatScreen.java b/src/GUI/ChatScreen.java
index 5198c750b07018500181af004f9ed402bf4029b6..3503299316d79f75d32f69028489d5ddc71e40db 100644
--- a/src/GUI/ChatScreen.java
+++ b/src/GUI/ChatScreen.java
@@ -14,7 +14,6 @@ public class ChatScreen {
private JButton sendButton;
- // private JPanel drawingPanel;
private JPanel othersPanel;
private JComboBox sendMessageToComboBox;
private JTextArea chatDisplayBox;
@@ -50,40 +49,6 @@ public class ChatScreen {
kickOutButton.addActionListener(actionListener);
promoteToManagerButton.addActionListener(actionListener);
- frame = new JFrame("Application");
- frame.setContentPane(panel2);
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.pack();
- frame.setResizable(false);
- frame.setVisible(true);
-
- SwingUtilities.getRootPane(sendButton).setDefaultButton(sendButton);
-
- frame.addWindowListener(new WindowAdapter()
- {
- @Override
- public void windowClosing(WindowEvent arg0)
- {
- int answer = JOptionPane.showConfirmDialog(null,
- "Are you sure you want to quit the session?",
- "Shut down session", JOptionPane.YES_NO_OPTION);
- System.out.println(answer);
- if (answer == 0)
- {
- System.out.println("Quitting session");
- try
- {
- client.getClientController().quit(client.getUserName());
- }
- catch (RemoteException e)
- {
- e.printStackTrace();
- }
- System.exit(0);
- }
- }
- });
-
}
@@ -91,7 +56,6 @@ public class ChatScreen {
return sendButton;
}
-
public JTextArea getChatDisplayBox() {
return chatDisplayBox;
}
@@ -123,7 +87,6 @@ public class ChatScreen {
System.exit(0);
}
-
ActionListener actionListener = new ActionListener()
{
public void actionPerformed(ActionEvent e)
diff --git a/src/client/Client.java b/src/client/Client.java
index 84f4f187f2288d30022396dffa0610b08a9ea6e1..c8b7f1752cee1559ed12f0219172e016f3733e1b 100644
--- a/src/client/Client.java
+++ b/src/client/Client.java
@@ -27,17 +27,19 @@ public class Client
private DrawingUpdate drawingUpdate;
private StartScreen startScreen;
- private ChatScreen chatScreen;
private PaintGUI paintGUI;
-
- public ApplicationMain getApplicationMain() { return applicationMain; }
-
private ApplicationMain applicationMain;
- public PaintGUI getPaintGUI() { return paintGUI; }
+ public ApplicationMain getApplicationMain() { return applicationMain; }
+
+ public PaintGUI getPaintGUI() {
+ return paintGUI;
+ }
- public ChatScreen getChatScreen() { return chatScreen; }
+ public ChatScreen getChatScreen() {
+ return getApplicationMain().getChatScreen();
+ }
public IChatController getChatController()
{
@@ -66,17 +68,14 @@ public class Client
this.serverAddress = serverAddress;
}
+
public Client(String username) throws RemoteException
{
this.userName = username;
this.clientUpdate = new ClientUpdate(this);
this.chatUpdate = new ChatUpdate(this);
this.drawingUpdate = new DrawingUpdate(this);
-// this.startScreen = new StartScreen(this);
-// this.chatScreen = new ChatScreen(this);
-// this.paintGUI = new PaintGUI(this);
this.applicationMain = new ApplicationMain(this);
-
}
public static void main(String[] args)
@@ -85,9 +84,8 @@ public class Client
{
Client client = new Client(args[0]);
client.connect();
- client.getChatScreen().setManagerToolsVisibility();
-
client.getApplicationMain().createAndShowGUI();
+ client.getChatScreen().setManagerToolsVisibility();
}
catch (Exception e)