Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
COMP90015-DSAss2-InfinityMonkeys-remaster
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ho Dac Hai
COMP90015-DSAss2-InfinityMonkeys-remaster
Commits
97868314
Commit
97868314
authored
Oct 25, 2019
by
Hai HoDac
Browse files
Options
Downloads
Patches
Plain Diff
Fixed code
parent
e11739bf
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/GUI/DrawingArea.java
+4
-4
4 additions, 4 deletions
src/GUI/DrawingArea.java
src/client/DrawingUpdate.java
+15
-0
15 additions, 0 deletions
src/client/DrawingUpdate.java
with
19 additions
and
4 deletions
src/GUI/DrawingArea.java
+
4
−
4
View file @
97868314
...
@@ -292,9 +292,9 @@ public class DrawingArea extends JPanel implements MouseMotionListener, MouseLis
...
@@ -292,9 +292,9 @@ public class DrawingArea extends JPanel implements MouseMotionListener, MouseLis
if
(
currentMode
==
Mode
.
TEXT
){
if
(
currentMode
==
Mode
.
TEXT
){
notifyUsingTimer
();
notifyUsingTimer
();
}
}
else
{
//
else {
drawingController
.
broadcastDrawingUserStopped
(
client
.
getUserName
());
//
drawingController.broadcastDrawingUserStopped(client.getUserName());
}
//
}
}
catch
(
RemoteException
ex
)
{
}
catch
(
RemoteException
ex
)
{
ex
.
printStackTrace
();
ex
.
printStackTrace
();
...
@@ -403,7 +403,7 @@ public class DrawingArea extends JPanel implements MouseMotionListener, MouseLis
...
@@ -403,7 +403,7 @@ public class DrawingArea extends JPanel implements MouseMotionListener, MouseLis
try
{
try
{
if
(
currentMode
!=
Mode
.
TEXT
){
if
(
currentMode
!=
Mode
.
TEXT
){
drawingController
.
broadcastDraggingDrawing
(
client
.
getUserName
(),
drawing
,
currentMode
.
toString
(),
shapeColor
,
strokeSize
);
drawingController
.
broadcastDraggingDrawing
(
client
.
getUserName
(),
drawing
,
currentMode
.
toString
(),
shapeColor
,
strokeSize
);
drawingController
.
broadcastDrawingUser
(
client
.
getUserName
());
//
drawingController.broadcastDrawingUser(client.getUserName());
}
}
}
catch
(
RemoteException
ex
)
{
}
catch
(
RemoteException
ex
)
{
...
...
This diff is collapsed.
Click to expand it.
src/client/DrawingUpdate.java
+
15
−
0
View file @
97868314
...
@@ -74,6 +74,12 @@ public class DrawingUpdate extends UnicastRemoteObject implements IDrawingUpdate
...
@@ -74,6 +74,12 @@ public class DrawingUpdate extends UnicastRemoteObject implements IDrawingUpdate
g2
.
setColor
(
color
);
g2
.
setColor
(
color
);
client
.
getApplicationMain
().
getPaintGUI
().
getDrawingArea
().
repaint
();
client
.
getApplicationMain
().
getPaintGUI
().
getDrawingArea
().
repaint
();
DefaultListModel
temp
=
client
.
getApplicationMain
().
getChatScreen
().
getAllUserModel
();
int
elementIndex
=
-
1
;
if
(
temp
.
contains
(
fromClient
)){
elementIndex
=
temp
.
indexOf
(
fromClient
);
temp
.
remove
(
elementIndex
);
}
return
true
;
return
true
;
}
}
...
@@ -96,6 +102,15 @@ public class DrawingUpdate extends UnicastRemoteObject implements IDrawingUpdate
...
@@ -96,6 +102,15 @@ public class DrawingUpdate extends UnicastRemoteObject implements IDrawingUpdate
break
;
break
;
}
}
client
.
getApplicationMain
().
getPaintGUI
().
getDrawingArea
().
repaint
();
client
.
getApplicationMain
().
getPaintGUI
().
getDrawingArea
().
repaint
();
DefaultListModel
temp
=
client
.
getApplicationMain
().
getChatScreen
().
getAllUserModel
();
if
(
temp
.
contains
(
fromClient
)){
System
.
out
.
println
(
"Already in the list"
);
}
else
{
temp
.
addElement
(
fromClient
);
}
return
true
;
return
true
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment