diff --git a/.idea/misc.xml b/.idea/misc.xml
index a07277e4e9b5232cdf27c177ecf83aa7901b275c..e208459b8afde5f7980720efd6bbb97f7ae24541 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,10 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
-<<<<<<< HEAD
- <component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="12" project-jdk-type="JavaSDK">
-=======
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
->>>>>>> 37a6af2e6d36ab514d01a93dbd5be6538a2572c7
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index d977b687b3c340eccc8cf30a665528eea8e5f65f..0a7fbaac58efbb979826bca26b2bc5a1547712c6 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -2,11 +2,45 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="688d774d-cfc7-4b0d-b00c-5ca931aba600" name="Default Changelist" comment="">
- <change beforePath="$PROJECT_DIR$/.idea/modules.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.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/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$2.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/ChatScreen$2.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/ColorPallete.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/ColorPallete.class" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/DrawingArea$1.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/DrawingArea$1.class" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/DrawingArea$Mode.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/DrawingArea$Mode.class" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/DrawingArea.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/DrawingArea.class" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/MenuBar.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/MenuBar.class" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/PaintGUI$1.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/PaintGUI$1.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.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/StartScreen.class" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/ToolBar.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/ToolBar.class" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/Tools.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/Tools.class" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/client/ChatUpdate.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/client/ChatUpdate.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.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/client/ClientUpdate.class" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/client/DrawingUpdate.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/client/DrawingUpdate.class" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/remote/IChatController.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/remote/IChatController.class" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/remote/IChatUpdate.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/remote/IChatUpdate.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.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/remote/IClientUpdate.class" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/remote/IDrawingController.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/remote/IDrawingController.class" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/remote/IDrawingUpdate.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/remote/IDrawingUpdate.class" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/server/ChatController.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/server/ChatController.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/DrawingController.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/server/DrawingController.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$/out/production/infinitymonkeys/server/User.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/server/User.class" 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/ChatScreen.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/GUI/ChatScreen.java" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/src/server/User.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/server/User.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" />
</list>
- <ignored path="$PROJECT_DIR$/out/" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -17,19 +51,6 @@
<option name="testRunner" value="GRADLE" />
<option name="delegatedBuild" value="true" />
</component>
- <component name="FileEditorManager">
- <leaf>
- <file pinned="false" current-in-tab="true">
- <entry file="file://$PROJECT_DIR$/src/GUI/ChatScreen.java">
- <provider selected="true" editor-type-id="text-editor">
- <state relative-caret-position="323">
- <caret line="81" selection-start-line="81" selection-end-line="81" />
- </state>
- </provider>
- </entry>
- </file>
- </leaf>
- </component>
<component name="FindInProjectRecents">
<findStrings>
<find>RMI</find>
@@ -52,25 +73,6 @@
</map>
</option>
</component>
- <component name="IdeDocumentHistory">
- <option name="CHANGED_PATHS">
- <list>
- <option value="$PROJECT_DIR$/src/server/Server.java" />
- <option value="$PROJECT_DIR$/src/client/ChatUpdate.java" />
- <option value="$PROJECT_DIR$/src/client/Client.java" />
- <option value="$PROJECT_DIR$/src/server/ChatController.java" />
- <option value="$PROJECT_DIR$/src/remote/IChatController.java" />
- <option value="$PROJECT_DIR$/src/remote/IChatUpdate.java" />
- <option value="$PROJECT_DIR$/src/server/ClientController.java" />
- <option value="$PROJECT_DIR$/src/remote/IClientController.java" />
- <option value="$PROJECT_DIR$/src/client/ClientUpdate.java" />
- <option value="$PROJECT_DIR$/src/remote/IClientUpdate.java" />
- <option value="$PROJECT_DIR$/src/GUI/ChatScreen.form" />
- <option value="$PROJECT_DIR$/src/server/User.java" />
- <option value="$PROJECT_DIR$/src/GUI/ChatScreen.java" />
- </list>
- </option>
- </component>
<component name="ProjectConfigurationFiles">
<option name="files">
<list>
@@ -78,75 +80,16 @@
</list>
</option>
</component>
- <component name="ProjectFrameBounds" extendedState="6">
- <option name="x" value="-3" />
- <option name="width" value="1946" />
- <option name="height" value="876" />
- </component>
- <component name="ProjectView">
- <navigator proportions="" version="1">
- <foldersAlwaysOnTop value="true" />
- </navigator>
- <panes>
- <pane id="ProjectPane">
- <subPane>
- <expand>
- <path>
- <item name="infinitymonkeys" type="b2602c69:ProjectViewProjectNode" />
- <item name="infinitymonkeys" type="462c0819:PsiDirectoryNode" />
- </path>
- <path>
- <item name="infinitymonkeys" type="b2602c69:ProjectViewProjectNode" />
- <item name="infinitymonkeys" type="462c0819:PsiDirectoryNode" />
- <item name="src" type="462c0819:PsiDirectoryNode" />
- </path>
- <path>
- <item name="infinitymonkeys" type="b2602c69:ProjectViewProjectNode" />
- <item name="infinitymonkeys" type="462c0819:PsiDirectoryNode" />
- <item name="src" type="462c0819:PsiDirectoryNode" />
- <item name="client" type="462c0819:PsiDirectoryNode" />
- </path>
- <path>
- <item name="infinitymonkeys" type="b2602c69:ProjectViewProjectNode" />
- <item name="infinitymonkeys" type="462c0819:PsiDirectoryNode" />
- <item name="src" type="462c0819:PsiDirectoryNode" />
- <item name="GUI" type="462c0819:PsiDirectoryNode" />
- </path>
- <path>
- <item name="infinitymonkeys" type="b2602c69:ProjectViewProjectNode" />
- <item name="infinitymonkeys" type="462c0819:PsiDirectoryNode" />
- <item name="src" type="462c0819:PsiDirectoryNode" />
- <item name="GUI" type="462c0819:PsiDirectoryNode" />
- <item name="ChatScreen" type="e9f4de52:FormNode" />
- </path>
- <path>
- <item name="infinitymonkeys" type="b2602c69:ProjectViewProjectNode" />
- <item name="infinitymonkeys" type="462c0819:PsiDirectoryNode" />
- <item name="src" type="462c0819:PsiDirectoryNode" />
- <item name="remote" type="462c0819:PsiDirectoryNode" />
- </path>
- <path>
- <item name="infinitymonkeys" type="b2602c69:ProjectViewProjectNode" />
- <item name="infinitymonkeys" type="462c0819:PsiDirectoryNode" />
- <item name="src" type="462c0819:PsiDirectoryNode" />
- <item name="server" type="462c0819:PsiDirectoryNode" />
- </path>
- </expand>
- <select />
- </subPane>
- </pane>
- <pane id="PackagesPane" />
- <pane id="Scope" />
- </panes>
- </component>
+ <component name="ProjectId" id="1SVgnDiSFxSanFbLYY5D9RJaXPS" />
<component name="PropertiesComponent">
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
+ <property name="UI_DESIGNER_EDITOR_MODE.UIDesignerToolWindowManager.WIDTH" value="387" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../Git Projects" />
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
- <property name="project.structure.last.edited" value="Global Libraries" />
+ <property name="project.structure.last.edited" value="Project" />
<property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.2" />
</component>
@@ -162,11 +105,11 @@
</list>
</option>
</component>
- <component name="RunManager" selected="Application.Client2">
+ <component name="RunManager" selected="Application.Client 3">
<configuration name="Client 3" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="client.Client" />
<module name="infinitymonkeys" />
- <option name="PROGRAM_PARAMETERS" value="Eldar -Djava.rmi.server.codebase=file:"C:\infinitemonkeys\out\production\infinitemonkeys\"" />
+ <option name="PROGRAM_PARAMETERS" value="Eldar -Djava.rmi.server.codebase=file:"G:\My Drive\UniMelb\2nd Semester\Distributed Systems\Assignment 2\Code\comp90015-dsass2-infinitymonkeys-remaster\out\production\comp90015-dsass2-infinitymonkeys-remaster"" />
<method v="2">
<option name="Make" enabled="true" />
</method>
@@ -174,7 +117,7 @@
<configuration name="Client1" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="client.Client" />
<module name="infinitymonkeys" />
- <option name="PROGRAM_PARAMETERS" value="Max -Djava.rmi.server.codebase=file:"C:\infinitemonkeys\out\production\infinitemonkeys\"" />
+ <option name="PROGRAM_PARAMETERS" value="Max -Djava.rmi.server.codebase=file:"G:\My Drive\UniMelb\2nd Semester\Distributed Systems\Assignment 2\Code\comp90015-dsass2-infinitymonkeys-remaster\out\production\comp90015-dsass2-infinitymonkeys-remaster"" />
<method v="2">
<option name="Make" enabled="true" />
</method>
@@ -182,7 +125,7 @@
<configuration name="Client2" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="client.Client" />
<module name="infinitymonkeys" />
- <option name="PROGRAM_PARAMETERS" value="Hai -Djava.rmi.server.codebase=file:"C:\infinitemonkeys\out\production\infinitemonkeys\"" />
+ <option name="PROGRAM_PARAMETERS" value="Hai -Djava.rmi.server.codebase=file:"G:\My Drive\UniMelb\2nd Semester\Distributed Systems\Assignment 2\Code\comp90015-dsass2-infinitymonkeys-remaster\out\production\comp90015-dsass2-infinitymonkeys-remaster"" />
<method v="2">
<option name="Make" enabled="true" />
</method>
@@ -190,7 +133,7 @@
<configuration name="Server" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="server.Server" />
<module name="infinitymonkeys" />
- <option name="PROGRAM_PARAMETERS" value="-Djava.rmi.server.codebase=file:"C:\infinitemonkeys\out\production\infinitemonkeys\"" />
+ <option name="PROGRAM_PARAMETERS" value="-Djava.rmi.server.codebase=file:"G:\My Drive\UniMelb\2nd Semester\Distributed Systems\Assignment 2\Code\comp90015-dsass2-infinitymonkeys-remaster\out\production\comp90015-dsass2-infinitymonkeys-remaster"" />
<method v="2">
<option name="Make" enabled="true" />
</method>
@@ -213,6 +156,7 @@
<option name="presentableId" value="Default" />
<updated>1571631720382</updated>
<workItem from="1571631723795" duration="17601000" />
+ <workItem from="1571654347656" duration="17476000" />
</task>
<task id="LOCAL-00001" summary="Changed the join method to send over a reference of the ClientUpdate Interface">
<created>1571646862883</created>
@@ -224,45 +168,6 @@
<option name="localTasksCounter" value="2" />
<servers />
</component>
- <component name="TimeTrackingManager">
- <option name="totallyTimeSpent" value="17601000" />
- </component>
- <component name="ToolWindowManager">
- <frame x="-7" y="-7" width="1295" height="704" extended-state="6" />
- <editor active="true" />
- <layout>
- <window_info id="Designer" />
- <window_info id="Image Layers" />
- <window_info id="Capture Tool" />
- <window_info id="UI Designer" />
- <window_info id="Favorites" side_tool="true" />
- <window_info id="JavaEE:App" side_tool="true" />
- <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.24939272" />
- <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
- <window_info anchor="bottom" id="Terminal" visible="true" weight="0.26923078" />
- <window_info anchor="bottom" id="Docker" show_stripe_button="false" />
- <window_info anchor="bottom" id="Event Log" side_tool="true" />
- <window_info anchor="bottom" id="Messages" weight="0.32867134" />
- <window_info anchor="bottom" id="Database Changes" />
- <window_info anchor="bottom" id="Version Control" weight="0.32867134" />
- <window_info anchor="bottom" id="Message" order="0" />
- <window_info anchor="bottom" id="Find" order="1" />
- <window_info anchor="bottom" id="Run" order="2" weight="0.32867134" />
- <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
- <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
- <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
- <window_info anchor="bottom" id="TODO" order="6" />
- <window_info anchor="right" id="Maven" />
- <window_info anchor="right" id="Palette" />
- <window_info anchor="right" id="Capture Analysis" />
- <window_info anchor="right" id="Database" />
- <window_info anchor="right" id="Palette	" />
- <window_info anchor="right" id="Theme Preview" />
- <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
- <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
- <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
- </layout>
- </component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
@@ -276,208 +181,19 @@
</list>
</option>
</component>
+ <component name="Vcs.Log.Tabs.Properties">
+ <option name="TAB_STATES">
+ <map>
+ <entry key="MAIN">
+ <value>
+ <State />
+ </value>
+ </entry>
+ </map>
+ </option>
+ </component>
<component name="VcsManagerConfiguration">
<MESSAGE value="Changed the join method to send over a reference of the ClientUpdate Interface" />
<option name="LAST_COMMIT_MESSAGE" value="Changed the join method to send over a reference of the ClientUpdate Interface" />
</component>
- <component name="editorHistoryManager">
- <entry file="file://$PROJECT_DIR$/src/GUI/StartScreen.form">
- <provider selected="true" editor-type-id="ui-designer" />
- </entry>
- <entry file="file://$PROJECT_DIR$/src/client/DrawingUpdate.java">
- <provider selected="true" editor-type-id="text-editor">
- <state relative-caret-position="170">
- <caret line="15" column="28" selection-start-line="15" selection-start-column="28" selection-end-line="15" selection-end-column="28" />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/GUI/PaintGUI.java">
- <provider selected="true" editor-type-id="text-editor">
- <state relative-caret-position="186">
- <caret line="218" lean-forward="true" selection-start-line="218" selection-end-line="218" />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/server/DrawingController.java">
- <provider selected="true" editor-type-id="text-editor">
- <state relative-caret-position="187">
- <caret line="16" lean-forward="true" selection-start-line="16" selection-end-line="16" />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/server/Server.java">
- <provider selected="true" editor-type-id="text-editor">
- <state relative-caret-position="-650">
- <caret line="10" lean-forward="true" selection-start-line="10" selection-end-line="10" />
- <folding>
- <element signature="imports" expanded="true" />
- </folding>
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/remote/IChatController.java">
- <provider selected="true" editor-type-id="text-editor">
- <state relative-caret-position="187">
- <caret line="12" lean-forward="true" selection-start-line="12" selection-end-line="12" />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/remote/IChatUpdate.java">
- <provider selected="true" editor-type-id="text-editor">
- <state relative-caret-position="170">
- <caret line="12" lean-forward="true" selection-start-line="12" selection-end-line="12" />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/GUI/ChatScreen.form">
- <provider selected="true" editor-type-id="ui-designer" />
- </entry>
- <entry file="file://$PROJECT_DIR$/src/needsDebugging/client/ChatUpdate.java">
- <provider selected="true" editor-type-id="text-editor">
- <state relative-caret-position="68">
- <caret line="8" column="13" selection-start-line="8" selection-start-column="13" selection-end-line="8" selection-end-column="13" />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/client/ClientUpdate.java">
- <provider selected="true" editor-type-id="text-editor">
- <state relative-caret-position="663">
- <caret line="39" column="31" lean-forward="true" selection-start-line="39" selection-start-column="31" selection-end-line="39" selection-end-column="31" />
- <folding>
- <element signature="imports" expanded="true" />
- </folding>
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/server/ChatController.java">
- <provider selected="true" editor-type-id="text-editor">
- <state relative-caret-position="-939">
- <caret line="9" column="45" selection-start-line="9" selection-start-column="45" selection-end-line="9" selection-end-column="45" />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/remote/IClientController.java">
- <provider selected="true" editor-type-id="text-editor">
- <state relative-caret-position="187">
- <caret line="12" selection-start-line="12" selection-end-line="12" />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/remote/IClientUpdate.java">
- <provider selected="true" editor-type-id="text-editor">
- <state relative-caret-position="170">
- <caret line="12" selection-start-line="12" selection-end-line="12" />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/client/Client.java">
- <provider selected="true" editor-type-id="text-editor">
- <state relative-caret-position="119">
- <caret line="133" column="104" selection-start-line="133" selection-start-column="104" selection-end-line="133" selection-end-column="104" />
- <folding>
- <element signature="e#892#893#0" expanded="true" />
- <element signature="e#923#924#0" expanded="true" />
- <element signature="e#969#970#0" expanded="true" />
- <element signature="e#1002#1003#0" expanded="true" />
- <element signature="e#1059#1060#0" expanded="true" />
- <element signature="e#1102#1103#0" expanded="true" />
- <element signature="e#1157#1158#0" expanded="true" />
- <element signature="e#1194#1195#0" expanded="true" />
- <element signature="e#1252#1253#0" expanded="true" />
- <element signature="e#1291#1292#0" expanded="true" />
- <element signature="e#1427#1428#0" expanded="true" />
- <element signature="e#1467#1468#0" expanded="true" />
- <element signature="e#1506#1507#0" expanded="true" />
- <element signature="e#1542#1543#0" expanded="true" />
- <element signature="e#1604#1605#0" expanded="true" />
- <element signature="e#1654#1655#0" expanded="true" />
- <element signature="e#3373#3374#0" expanded="true" />
- <element signature="e#3411#3412#0" expanded="true" />
- </folding>
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/client/ChatUpdate.java">
- <provider selected="true" editor-type-id="text-editor">
- <state relative-caret-position="114">
- <caret line="25" column="65" selection-start-line="25" selection-start-column="65" selection-end-line="25" selection-end-column="65" />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/server/User.java">
- <provider selected="true" editor-type-id="text-editor">
- <state relative-caret-position="186">
- <caret line="47" lean-forward="true" selection-start-line="47" selection-end-line="47" />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/server/ClientController.java">
- <provider selected="true" editor-type-id="text-editor">
- <state relative-caret-position="-1602">
- <caret line="12" column="13" selection-start-line="12" selection-start-column="13" selection-end-line="12" selection-end-column="13" />
- <folding>
- <element signature="imports" expanded="true" />
- </folding>
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/GUI/ChatScreen.java">
- <provider selected="true" editor-type-id="text-editor">
- <state relative-caret-position="323">
- <caret line="81" selection-start-line="81" selection-end-line="81" />
- </state>
- </provider>
- </entry>
- </component>
- <component name="masterDetails">
- <states>
- <state key="GlobalLibrariesConfigurable.UI">
- <settings>
- <last-edited>JavaFX-11</last-edited>
- <splitter-proportions>
- <option name="proportions">
- <list>
- <option value="0.2" />
- </list>
- </option>
- </splitter-proportions>
- </settings>
- </state>
- <state key="JdkListConfigurable.UI">
- <settings>
- <last-edited>12</last-edited>
- <splitter-proportions>
- <option name="proportions">
- <list>
- <option value="0.2" />
- </list>
- </option>
- </splitter-proportions>
- </settings>
- </state>
- <state key="ProjectJDKs.UI">
- <settings>
- <last-edited>12</last-edited>
- <splitter-proportions>
- <option name="proportions">
- <list>
- <option value="0.2" />
- </list>
- </option>
- </splitter-proportions>
- </settings>
- </state>
- <state key="ProjectLibrariesConfigurable.UI">
- <settings>
- <splitter-proportions>
- <option name="proportions">
- <list>
- <option value="0.2" />
- </list>
- </option>
- </splitter-proportions>
- </settings>
- </state>
- </states>
- </component>
</project>
\ No newline at end of file
diff --git a/out/production/infinitymonkeys/GUI/ChatScreen$1.class b/out/production/infinitymonkeys/GUI/ChatScreen$1.class
index ad070b4025d27146d6f511cc46e339e0c5c90c9d..e5351eda8653b944c5b5a1c45e528d33b5f893e6 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
index 07582e35529293a7e6d54c86eba62b526188a63b..85463d202dcded639b7ad7d60bf5bb0d22da1512 100644
Binary files a/out/production/infinitymonkeys/GUI/ChatScreen$2.class and b/out/production/infinitymonkeys/GUI/ChatScreen$2.class differ
diff --git a/out/production/infinitymonkeys/GUI/ChatScreen.class b/out/production/infinitymonkeys/GUI/ChatScreen.class
index d4722fd42983973ce3fd9102362ac5251df9d15d..71a58897e8c0cc4cf66f42a9f276ff7ab10ec343 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/ColorPallete.class b/out/production/infinitymonkeys/GUI/ColorPallete.class
index 8df577c8690fd5e0b3d5b25f8cf23b457129201b..0795201c54134b35416d2e9bc194cb3e30720c7b 100644
Binary files a/out/production/infinitymonkeys/GUI/ColorPallete.class and b/out/production/infinitymonkeys/GUI/ColorPallete.class differ
diff --git a/out/production/infinitymonkeys/GUI/DrawingArea$1.class b/out/production/infinitymonkeys/GUI/DrawingArea$1.class
index 3bf3599b49fa2317bb5c547aebf4ecbf58871f0c..153fe6661e260df1c185996c6d8e8f84cc9d88a2 100644
Binary files a/out/production/infinitymonkeys/GUI/DrawingArea$1.class and b/out/production/infinitymonkeys/GUI/DrawingArea$1.class differ
diff --git a/out/production/infinitymonkeys/GUI/DrawingArea$Mode.class b/out/production/infinitymonkeys/GUI/DrawingArea$Mode.class
index d3026d6d41527de6d5356b7e70e33b406f1832ec..300ae0e92370228635ee2d2eda3cef4cc4aadaae 100644
Binary files a/out/production/infinitymonkeys/GUI/DrawingArea$Mode.class and b/out/production/infinitymonkeys/GUI/DrawingArea$Mode.class differ
diff --git a/out/production/infinitymonkeys/GUI/DrawingArea.class b/out/production/infinitymonkeys/GUI/DrawingArea.class
index 11e1ba0dc65316974a4a077932d3b3990b954bd1..e8789e03a5bde6470e969558471b15342c72b15e 100644
Binary files a/out/production/infinitymonkeys/GUI/DrawingArea.class and b/out/production/infinitymonkeys/GUI/DrawingArea.class differ
diff --git a/out/production/infinitymonkeys/GUI/MenuBar.class b/out/production/infinitymonkeys/GUI/MenuBar.class
index 9d80cbd3e3d7cc30dc751bb56542a73faf046c17..a24c9fc484961be8f3ca5d24268b42ed44163d5e 100644
Binary files a/out/production/infinitymonkeys/GUI/MenuBar.class and b/out/production/infinitymonkeys/GUI/MenuBar.class differ
diff --git a/out/production/infinitymonkeys/GUI/PaintGUI$1.class b/out/production/infinitymonkeys/GUI/PaintGUI$1.class
index 05dffb8fa1c36748b9542754e26f8c8e15359c41..cc90a9c6246be3e81b09d9081b834ead1f6cc592 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 165d1af870b042236228c40f2dae99862c758f71..592ac85cd5cd5ffa4ac44a16db9b3f65232a079d 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/GUI/StartScreen$1.class b/out/production/infinitymonkeys/GUI/StartScreen$1.class
index 5f3fca41b1bc9a34e71f5e61b6c7e4a5112503d2..1a7d5b7bdb4598ed53bab3ee9d3b760ec703980b 100644
Binary files a/out/production/infinitymonkeys/GUI/StartScreen$1.class and b/out/production/infinitymonkeys/GUI/StartScreen$1.class differ
diff --git a/out/production/infinitymonkeys/GUI/StartScreen.class b/out/production/infinitymonkeys/GUI/StartScreen.class
index 6144e540958fa2d41f60d7e6557e4fd56278e677..88ef04241f6adbc213948d6042d7c6c09d930b94 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/GUI/ToolBar.class b/out/production/infinitymonkeys/GUI/ToolBar.class
index 86440c28b7ba58855af71c32d05357aaef175bb9..a261bb8a4822e43418c1708eeb8e113b94739e4a 100644
Binary files a/out/production/infinitymonkeys/GUI/ToolBar.class and b/out/production/infinitymonkeys/GUI/ToolBar.class differ
diff --git a/out/production/infinitymonkeys/GUI/Tools.class b/out/production/infinitymonkeys/GUI/Tools.class
index 9620099b39c681d78c05e11f2192a974d533a6ef..b27fffe3334a1604da267722f9a0490a7cd01d2a 100644
Binary files a/out/production/infinitymonkeys/GUI/Tools.class and b/out/production/infinitymonkeys/GUI/Tools.class differ
diff --git a/out/production/infinitymonkeys/client/ChatUpdate.class b/out/production/infinitymonkeys/client/ChatUpdate.class
index d3d43bbf0dbe0a7b388beca7ad07b42d699e904d..67a49f505beee840b3e57a9e85b034dd23bf2d8c 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 c77e62aac733fe7def8e84b41a6801f5ef591816..8383d03a66abfaa23c51240fa8b3f0efaf8e1da2 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/ClientUpdate$1.class b/out/production/infinitymonkeys/client/ClientUpdate$1.class
new file mode 100644
index 0000000000000000000000000000000000000000..52c7050bf27d1bfb74566e3771a7334deedadfee
Binary files /dev/null and b/out/production/infinitymonkeys/client/ClientUpdate$1.class differ
diff --git a/out/production/infinitymonkeys/client/ClientUpdate.class b/out/production/infinitymonkeys/client/ClientUpdate.class
index f3d25e75dcea30aad35683b0aedc4e92e2561079..e9016f67a3275ae7307131c6afe81eb63077fb97 100644
Binary files a/out/production/infinitymonkeys/client/ClientUpdate.class and b/out/production/infinitymonkeys/client/ClientUpdate.class differ
diff --git a/out/production/infinitymonkeys/client/DrawingUpdate.class b/out/production/infinitymonkeys/client/DrawingUpdate.class
index 0d069f263b5239d56e9d5cbba428006c12a08e44..a3b8302dd9e3252b1941eb2af93b54760ea2b35b 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/remote/IChatController.class b/out/production/infinitymonkeys/remote/IChatController.class
index e45f4bf9040a0c82a58b3ef00527c279fade4b20..53c3ebdbeb067f1865fe93a3e90ce8ef69e59d0b 100644
Binary files a/out/production/infinitymonkeys/remote/IChatController.class and b/out/production/infinitymonkeys/remote/IChatController.class differ
diff --git a/out/production/infinitymonkeys/remote/IChatUpdate.class b/out/production/infinitymonkeys/remote/IChatUpdate.class
index d5575ab470b8e67f3224b6e865177ce1dee04ee2..f84138bb8bf132eae71b572e7f8c37323da8ae93 100644
Binary files a/out/production/infinitymonkeys/remote/IChatUpdate.class and b/out/production/infinitymonkeys/remote/IChatUpdate.class differ
diff --git a/out/production/infinitymonkeys/remote/IClientController$Action.class b/out/production/infinitymonkeys/remote/IClientController$Action.class
new file mode 100644
index 0000000000000000000000000000000000000000..035ddf1381adff501a6e806d89ed427882488ad0
Binary files /dev/null and b/out/production/infinitymonkeys/remote/IClientController$Action.class differ
diff --git a/out/production/infinitymonkeys/remote/IClientController.class b/out/production/infinitymonkeys/remote/IClientController.class
index af990bfd9d6831459f2f3939f2d796d185906326..d438a291276cb8f60071c2bb1916a305991156c4 100644
Binary files a/out/production/infinitymonkeys/remote/IClientController.class and b/out/production/infinitymonkeys/remote/IClientController.class differ
diff --git a/out/production/infinitymonkeys/remote/IClientUpdate$Action.class b/out/production/infinitymonkeys/remote/IClientUpdate$Action.class
new file mode 100644
index 0000000000000000000000000000000000000000..e8c67716e8ad38b3061fe7b87f09a74c4e8dc8a5
Binary files /dev/null and b/out/production/infinitymonkeys/remote/IClientUpdate$Action.class differ
diff --git a/out/production/infinitymonkeys/remote/IClientUpdate.class b/out/production/infinitymonkeys/remote/IClientUpdate.class
index fa0006f9dd46ac92c7dd4b02ade6b505c33797d2..7d8923621a39f42b6628c674a2a110f8b54dd03d 100644
Binary files a/out/production/infinitymonkeys/remote/IClientUpdate.class and b/out/production/infinitymonkeys/remote/IClientUpdate.class differ
diff --git a/out/production/infinitymonkeys/remote/IDrawingController.class b/out/production/infinitymonkeys/remote/IDrawingController.class
index ed5925c413644c2148bd9b14149a734e51f912e3..77e8bd2728f2914be430a512c07dfd1396cf82db 100644
Binary files a/out/production/infinitymonkeys/remote/IDrawingController.class and b/out/production/infinitymonkeys/remote/IDrawingController.class differ
diff --git a/out/production/infinitymonkeys/remote/IDrawingUpdate.class b/out/production/infinitymonkeys/remote/IDrawingUpdate.class
index 04552df1f1be58eafbbc8c8a7aa9177c13b188b4..e988f5b56317e1471a72d9c155b99fb2765377fd 100644
Binary files a/out/production/infinitymonkeys/remote/IDrawingUpdate.class and b/out/production/infinitymonkeys/remote/IDrawingUpdate.class differ
diff --git a/out/production/infinitymonkeys/server/ChatController.class b/out/production/infinitymonkeys/server/ChatController.class
index 9e315892458c07ba08f68892312f539f23895f84..b56eaad1cdbc2c794f9ab2a79109a88eb63fa3fb 100644
Binary files a/out/production/infinitymonkeys/server/ChatController.class and b/out/production/infinitymonkeys/server/ChatController.class differ
diff --git a/out/production/infinitymonkeys/server/ClientController$1.class b/out/production/infinitymonkeys/server/ClientController$1.class
new file mode 100644
index 0000000000000000000000000000000000000000..638165f68d21b9d922e0ae61d1a9b8491e1d12d3
Binary files /dev/null and b/out/production/infinitymonkeys/server/ClientController$1.class differ
diff --git a/out/production/infinitymonkeys/server/ClientController.class b/out/production/infinitymonkeys/server/ClientController.class
index fe0b87bb2045cdd4eb764eff6cfed1a0ac766134..182374ac80a0f963d89850cb7ae67fa2d3c75199 100644
Binary files a/out/production/infinitymonkeys/server/ClientController.class and b/out/production/infinitymonkeys/server/ClientController.class differ
diff --git a/out/production/infinitymonkeys/server/DrawingController.class b/out/production/infinitymonkeys/server/DrawingController.class
index 28a0e95f65317dc06d0c1e3f0830495787b51dc4..54810ef813fa516a548036a63fa70a7be2a0c5c5 100644
Binary files a/out/production/infinitymonkeys/server/DrawingController.class and b/out/production/infinitymonkeys/server/DrawingController.class differ
diff --git a/out/production/infinitymonkeys/server/Server.class b/out/production/infinitymonkeys/server/Server.class
index 5ea7e2c5c0df974a0d3f05bf71dbdd9279cd976c..0c1967b8f8157aa219773025b224455fa21cf3ef 100644
Binary files a/out/production/infinitymonkeys/server/Server.class and b/out/production/infinitymonkeys/server/Server.class differ
diff --git a/out/production/infinitymonkeys/server/User.class b/out/production/infinitymonkeys/server/User.class
index 17261fd1d0f03ebf8fb8b05a1c22619d50174f68..a82ad43f335c18a83de06d206fede36f98e49c41 100644
Binary files a/out/production/infinitymonkeys/server/User.class and b/out/production/infinitymonkeys/server/User.class differ
diff --git a/src/GUI/ChatScreen.form b/src/GUI/ChatScreen.form
index 9d8893e963fd7589e8246cf21b7735b63c75c9e6..c84b144f32f20c26e5dac9fb98eb22b72cc00d46 100644
--- a/src/GUI/ChatScreen.form
+++ b/src/GUI/ChatScreen.form
@@ -67,7 +67,7 @@
<properties/>
<border type="none" title="Manager's Tools"/>
<children>
- <component id="b7068" class="javax.swing.JComboBox" binding="userSelectComboBox">
+ <component id="b7068" class="javax.swing.JComboBox" binding="kickUserComboBox">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
diff --git a/src/GUI/ChatScreen.java b/src/GUI/ChatScreen.java
index 8dda5bb827736fa34432e329ad2647adec928766..d338a03722f2e8ee340b65178f1b1f1e27b06e6a 100644
--- a/src/GUI/ChatScreen.java
+++ b/src/GUI/ChatScreen.java
@@ -19,7 +19,7 @@ public class ChatScreen {
private JPanel othersPanel;
private JComboBox sendMessageToComboBox;
private JTextArea chatDisplayBox;
- private JComboBox userSelectComboBox;
+ private JComboBox kickUserComboBox;
private JButton kickOutButton;
private JButton promoteToManagerButton;
private JTextField chatInputBox;
@@ -42,9 +42,11 @@ public class ChatScreen {
{
this.client = client;
yourNameDisplay.setText(client.getUserName());
-// sentMessageToComboBox.addItem(client.getUserName());
quitButton.addActionListener(actionListener);
sendButton.addActionListener(actionListener);
+ kickOutButton.addActionListener(actionListener);
+ promoteToManagerButton.addActionListener(actionListener);
+
frame = new JFrame("Application");
frame.setContentPane(panel2);
createUIComponents();
@@ -95,10 +97,32 @@ public class ChatScreen {
return sendMessageToComboBox;
}
+ public JComboBox getKickUserComboBox()
+ {
+ return kickUserComboBox;
+ }
+
public JPanel getDrawingPanel() {
return drawingPanel;
}
+ public void setManagerToolsVisibility() {
+ try {
+ if (client.getClientController().getAdmin().equals(client.getUserName())){
+ managersPanel.setVisible(true);
+ }
+ else {
+ managersPanel.setVisible(false);
+ }
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void exitChatScreen() {
+ System.exit(0);
+ }
+
ActionListener actionListener = new ActionListener()
{
@@ -136,13 +160,44 @@ public class ChatScreen {
{
System.out.println("Exit room button pressed");
clientController.quit(client.getUserName());
- System.exit(0);
+ exitChatScreen();
}
catch (RemoteException ex)
{
ex.printStackTrace();
}
}
+ else if (e.getSource() == kickOutButton)
+ {
+
+ IClientController clientController = client.getClientController();
+ String toUser = kickUserComboBox.getSelectedItem().toString();
+
+ try {
+ System.out.println("Kick out button pressed");
+ clientController.kickUser(client.getUserName(), toUser);
+ }
+ catch (RemoteException ex) {
+
+ ex.printStackTrace();
+ }
+
+ }
+ else if (e.getSource() == promoteToManagerButton)
+ {
+
+ IClientController clientController = client.getClientController();
+ String toUser = kickUserComboBox.getSelectedItem().toString();
+
+ try {
+ System.out.println("Promote to manager button pressed");
+ clientController.assignAdmin(client.getUserName(), toUser);
+ }
+ catch (RemoteException ex) {
+ ex.printStackTrace();
+ }
+
+ }
}
};
diff --git a/src/client/Client.java b/src/client/Client.java
index b5c34ee2fb7f85c513dac93d4208a17c0d12623a..71445f3d0d853093bfc45d4ae1cae6a7c6021328 100644
--- a/src/client/Client.java
+++ b/src/client/Client.java
@@ -96,8 +96,7 @@ public class Client
{
Client client = new Client(args[0]);
client.connect();
-// client.startScreen.go();
-// client.getPaintGUI().showGUI();
+ client.getChatScreen().setManagerToolsVisibility();
}
catch (Exception e)
{
@@ -105,21 +104,6 @@ public class Client
}
}
-// public void doSomething()
-// {
-//// new ChatScreen();
-//
-// try
-// {
-// new ChatScreen(this);
-// System.out.println("Sleeping...");
-// TimeUnit.MINUTES.sleep(5);
-// }
-// catch(Exception e)
-// {
-// e.printStackTrace();
-// }
-// }
public boolean connect()
{
@@ -146,13 +130,4 @@ public class Client
return false;
}
- public String getReceivedMessage()
- {
- return receivedMessage;
- }
-
- public void setReceivedMessage(String receivedMessage)
- {
- this.receivedMessage = receivedMessage;
- }
}
\ No newline at end of file
diff --git a/src/client/ClientUpdate.java b/src/client/ClientUpdate.java
index 83967bc77631a406b91fd2c60dda30d076d7e279..6f5e3805f3d535ced928f263847ae025461d6794 100644
--- a/src/client/ClientUpdate.java
+++ b/src/client/ClientUpdate.java
@@ -18,22 +18,16 @@ public class ClientUpdate extends UnicastRemoteObject implements IClientUpdate,
this.client = client;
}
- @Override
- public boolean notifyClient(String fromClient, String newUsername) throws RemoteException
- {
- client.getChatScreen().getSendMessageToComboBox().addItem(newUsername);
-
- return true;
- }
-
@Override
public boolean updateUserList(String[] users) throws RemoteException
{
//client.setConnectedUsers(users);
JComboBox userBox = client.getChatScreen().getSendMessageToComboBox();
+ JComboBox kickUserBox = client.getChatScreen().getKickUserComboBox();
userBox.removeAllItems();
+ kickUserBox.removeAllItems();
userBox.addItem("All");
@@ -43,8 +37,36 @@ public class ClientUpdate extends UnicastRemoteObject implements IClientUpdate,
{
userBox.addItem(s);
}
+
+ if( !s.equals(client.getClientController().getAdmin()) )
+ {
+ kickUserBox.addItem(s);
+ }
+
}
return true;
}
+
+ @Override
+ public void terminateChat() throws RemoteException {
+ client.getChatScreen().exitChatScreen();
+ }
+
+ @Override
+ public void setVisibility() {
+ client.getChatScreen().setManagerToolsVisibility();
+ }
+
+ @Override
+ public void notifyManagerActions(String toClient, Action action) throws RemoteException {
+ switch (action) {
+ case KICKOUT:
+ 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");
+ break;
+ }
+ }
}
diff --git a/src/remote/IClientController.java b/src/remote/IClientController.java
index bde0a0f500ed01f94c2485ba8de0bdea378d05d9..349297d37ca18e26184c87e1d7754b5299718340 100644
--- a/src/remote/IClientController.java
+++ b/src/remote/IClientController.java
@@ -5,11 +5,17 @@ import java.rmi.RemoteException;
public interface IClientController extends Remote
{
+ enum Action {KICKOUT, ASSIGNADMIN};
+
boolean join(String username, IChatUpdate clientChat, IClientUpdate clientUpdate, IDrawingUpdate clientDrawing) throws RemoteException;
void quit(String username) throws RemoteException;
- boolean assignAdmin(String username) throws RemoteException;
+ boolean assignAdmin(String oldAdmin, String newAdmin) throws RemoteException;
boolean kickUser(String username, String who) throws RemoteException;
+
+ boolean broadcastManagerMessage(String toClient, Action action) throws RemoteException;
+
+ String getAdmin() throws RemoteException;
}
diff --git a/src/remote/IClientUpdate.java b/src/remote/IClientUpdate.java
index c1337f90f560c6b527bd067d7d5d2cf0d85ee234..1d4dea6c68a9e1957ee31e94319807e95d08f5cb 100644
--- a/src/remote/IClientUpdate.java
+++ b/src/remote/IClientUpdate.java
@@ -6,7 +6,10 @@ import java.rmi.RemoteException;
public interface IClientUpdate extends Remote, Serializable {
- boolean notifyClient(String fromClient, String newUsername) throws RemoteException;
-
+ enum Action {KICKOUT, ASSIGNADMIN};
boolean updateUserList(String[] users) throws RemoteException;
+ void terminateChat() throws RemoteException;
+ void notifyManagerActions(String toClient, Action action) throws RemoteException;
+ void setVisibility() throws RemoteException;
+
}
diff --git a/src/server/ClientController.java b/src/server/ClientController.java
index bcfd261f7da172aca929a6a4f291b39c277fb2b1..9a82aa05c5e0189368b7eaab553b82b13e356173 100644
--- a/src/server/ClientController.java
+++ b/src/server/ClientController.java
@@ -56,13 +56,17 @@ public class ClientController extends UnicastRemoteObject implements IClientCont
}
@Override
- public boolean assignAdmin(String username) throws RemoteException
+ public boolean assignAdmin(String oldAdmin, String newAdmin) throws RemoteException
{
- int adminIndex = getUserIndex(username);
+ int oldAdminIndex = getUserIndex(oldAdmin);
+ int newAdminIndex = getUserIndex(newAdmin);
- if( adminIndex >= 0 )
+ if( newAdminIndex >= 0 && server.users.get(oldAdminIndex).isAdmin())
{
- server.users.get(adminIndex).setAdmin(true);
+ server.users.get(oldAdminIndex).setAdmin(false);
+ server.users.get(newAdminIndex).setAdmin(true);
+ broadcastUserList();
+ broadcastManagerMessage(newAdmin, Action.ASSIGNADMIN);
return true;
}
@@ -71,17 +75,25 @@ public class ClientController extends UnicastRemoteObject implements IClientCont
}
@Override
- public boolean kickUser(String username, String who) throws RemoteException
+ public boolean kickUser(String manager, String kickedUser) throws RemoteException
{
- int userIndex = getUserIndex(who);
+ int userIndex = getUserIndex(kickedUser);
- int adminIndex = getUserIndex(username);
+ int adminIndex = getUserIndex(manager);
- if ( adminIndex > 0 && userIndex > 0 && server.users.get(adminIndex).isAdmin() )
+ if ( adminIndex >= 0 && userIndex >= 0 && server.users.get(adminIndex).isAdmin() )
{
- server.users.remove(userIndex);
- broadcastUserList();
+ try {
+ server.users.get(userIndex).getIClientUpdate().terminateChat();
+ }
+ finally {
+ System.out.print(server.users);
+ server.users.remove(userIndex);
+ System.out.print(server.users);
+ broadcastUserList();
+ broadcastManagerMessage(kickedUser, Action.KICKOUT);
+ }
return true;
}
@@ -105,7 +117,7 @@ public class ClientController extends UnicastRemoteObject implements IClientCont
return index;
}
- private void broadcastUserList() throws RemoteException
+ public void broadcastUserList() throws RemoteException
{
String[] connectedUsers = new String[server.users.size()];
@@ -119,4 +131,50 @@ public class ClientController extends UnicastRemoteObject implements IClientCont
u.getIClientUpdate().updateUserList(connectedUsers);
}
}
+
+ @Override
+ public String getAdmin() throws RemoteException
+ {
+ String adminName = "";
+ for( User u : server.users )
+ {
+ if (u.isAdmin()) {
+ adminName = u.getUserName();
+ }
+ }
+ return adminName;
+ }
+
+ @Override
+ public boolean broadcastManagerMessage(String toClient, Action action) throws RemoteException {
+ System.out.print("Broadcasting message to everyone...");
+ IClientUpdate client;
+
+ switch (action){
+ case KICKOUT:
+ for( User u : server.users )
+ {
+ client = u.getIClientUpdate();
+ client.notifyManagerActions(toClient, remote.IClientUpdate.Action.KICKOUT);
+ }
+
+ System.out.print("...DONE\n");
+ System.out.println(toClient + " has been kicked out the room.");
+ break;
+
+ case ASSIGNADMIN:
+ for( User u : server.users )
+ {
+ client = u.getIClientUpdate();
+ client.notifyManagerActions(toClient, remote.IClientUpdate.Action.ASSIGNADMIN);
+ client.setVisibility();
+ }
+
+ System.out.print("...DONE\n");
+ System.out.println(toClient + " is the new manager.");
+ break;
+ }
+
+ return true;
+ }
}