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
7a1d5044
Commit
7a1d5044
authored
5 years ago
by
Hai HoDac
Browse files
Options
Downloads
Patches
Plain Diff
fixed dragging line stroke
uncomment all drawing relation methods (EXCEPT the notifyUserDrawing)
parent
025629b0
Branches
Branches containing commit
No related tags found
1 merge request
!42
fixed dragging line stroke
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/GUI/DrawingArea.java
+1
-0
1 addition, 0 deletions
src/GUI/DrawingArea.java
src/server/DrawingController.java
+10
-10
10 additions, 10 deletions
src/server/DrawingController.java
with
11 additions
and
10 deletions
src/GUI/DrawingArea.java
+
1
−
0
View file @
7a1d5044
...
@@ -116,6 +116,7 @@ public class DrawingArea extends JPanel implements MouseMotionListener, MouseLis
...
@@ -116,6 +116,7 @@ public class DrawingArea extends JPanel implements MouseMotionListener, MouseLis
/// Eraser has no border color ///
/// Eraser has no border color ///
Color
borderColor
=
currentMode
!=
Mode
.
ERASE
?
shapeColor
:
Color
.
WHITE
;
Color
borderColor
=
currentMode
!=
Mode
.
ERASE
?
shapeColor
:
Color
.
WHITE
;
g2
.
setColor
(
borderColor
);
g2
.
setColor
(
borderColor
);
g2
.
setStroke
(
lineStroke
);
g2
.
draw
(
drawing
);
g2
.
draw
(
drawing
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/server/DrawingController.java
+
10
−
10
View file @
7a1d5044
...
@@ -34,7 +34,7 @@ public class DrawingController extends UnicastRemoteObject implements IDrawingCo
...
@@ -34,7 +34,7 @@ public class DrawingController extends UnicastRemoteObject implements IDrawingCo
@Override
@Override
public
boolean
broadcastText
(
String
fromClient
,
String
text
,
Font
font
,
Color
color
,
Point
startPoint
)
throws
RemoteException
{
public
boolean
broadcastText
(
String
fromClient
,
String
text
,
Font
font
,
Color
color
,
Point
startPoint
)
throws
RemoteException
{
System
.
out
.
print
(
"Broadcasting drawing to everyone..."
);
//
System.out.print("Broadcasting drawing to everyone...");
g2
=
(
Graphics2D
)
bufferedImage
.
getGraphics
();
g2
=
(
Graphics2D
)
bufferedImage
.
getGraphics
();
g2
.
setRenderingHint
(
RenderingHints
.
KEY_ANTIALIASING
,
RenderingHints
.
VALUE_ANTIALIAS_ON
);
g2
.
setRenderingHint
(
RenderingHints
.
KEY_ANTIALIASING
,
RenderingHints
.
VALUE_ANTIALIAS_ON
);
...
@@ -55,7 +55,7 @@ public class DrawingController extends UnicastRemoteObject implements IDrawingCo
...
@@ -55,7 +55,7 @@ public class DrawingController extends UnicastRemoteObject implements IDrawingCo
}
}
}
}
System
.
out
.
print
(
"...DONE\n"
);
//
System.out.print("...DONE\n");
return
true
;
return
true
;
}
}
...
@@ -63,7 +63,7 @@ public class DrawingController extends UnicastRemoteObject implements IDrawingCo
...
@@ -63,7 +63,7 @@ public class DrawingController extends UnicastRemoteObject implements IDrawingCo
@Override
@Override
public
boolean
broadcastDrawing
(
String
fromClient
,
Shape
drawing
,
String
mode
,
Color
color
,
int
strokeSize
)
throws
RemoteException
{
public
boolean
broadcastDrawing
(
String
fromClient
,
Shape
drawing
,
String
mode
,
Color
color
,
int
strokeSize
)
throws
RemoteException
{
System
.
out
.
print
(
"Broadcasting drawing to everyone..."
);
//
System.out.print("Broadcasting drawing to everyone...");
g2
=
(
Graphics2D
)
bufferedImage
.
getGraphics
();
g2
=
(
Graphics2D
)
bufferedImage
.
getGraphics
();
g2
.
setRenderingHint
(
RenderingHints
.
KEY_ANTIALIASING
,
RenderingHints
.
VALUE_ANTIALIAS_ON
);
g2
.
setRenderingHint
(
RenderingHints
.
KEY_ANTIALIASING
,
RenderingHints
.
VALUE_ANTIALIAS_ON
);
...
@@ -97,13 +97,13 @@ public class DrawingController extends UnicastRemoteObject implements IDrawingCo
...
@@ -97,13 +97,13 @@ public class DrawingController extends UnicastRemoteObject implements IDrawingCo
}
}
}
}
System
.
out
.
print
(
"...DONE\n"
);
//
System.out.print("...DONE\n");
return
true
;
return
true
;
}
}
public
boolean
broadcastDraggingDrawing
(
String
fromClient
,
Shape
drawing
,
String
mode
,
Color
color
,
int
strokeSize
)
throws
RemoteException
{
public
boolean
broadcastDraggingDrawing
(
String
fromClient
,
Shape
drawing
,
String
mode
,
Color
color
,
int
strokeSize
)
throws
RemoteException
{
System
.
out
.
print
(
"Broadcasting dragging drawing to everyone..."
);
//
System.out.print("Broadcasting dragging drawing to everyone...");
g2
=
(
Graphics2D
)
bufferedImage
.
getGraphics
();
g2
=
(
Graphics2D
)
bufferedImage
.
getGraphics
();
g2
.
setRenderingHint
(
RenderingHints
.
KEY_ANTIALIASING
,
RenderingHints
.
VALUE_ANTIALIAS_ON
);
g2
.
setRenderingHint
(
RenderingHints
.
KEY_ANTIALIASING
,
RenderingHints
.
VALUE_ANTIALIAS_ON
);
...
@@ -137,13 +137,13 @@ public class DrawingController extends UnicastRemoteObject implements IDrawingCo
...
@@ -137,13 +137,13 @@ public class DrawingController extends UnicastRemoteObject implements IDrawingCo
}
}
}
}
System
.
out
.
print
(
"...DONE\n"
);
//
System.out.print("...DONE\n");
return
true
;
return
true
;
}
}
public
boolean
broadcastClearCanvas
(
String
fromClient
)
throws
RemoteException
{
public
boolean
broadcastClearCanvas
(
String
fromClient
)
throws
RemoteException
{
System
.
out
.
print
(
"Broadcasting canvas clearance to everyone..."
);
//
System.out.print("Broadcasting canvas clearance to everyone...");
IDrawingUpdate
client
;
IDrawingUpdate
client
;
...
@@ -159,7 +159,7 @@ public class DrawingController extends UnicastRemoteObject implements IDrawingCo
...
@@ -159,7 +159,7 @@ public class DrawingController extends UnicastRemoteObject implements IDrawingCo
}
}
}
}
System
.
out
.
print
(
"...DONE\n"
);
//
System.out.print("...DONE\n");
return
true
;
return
true
;
}
}
...
@@ -178,7 +178,7 @@ public class DrawingController extends UnicastRemoteObject implements IDrawingCo
...
@@ -178,7 +178,7 @@ public class DrawingController extends UnicastRemoteObject implements IDrawingCo
public
boolean
broadcastUpdateImage
(
String
fromClient
)
throws
RemoteException
{
public
boolean
broadcastUpdateImage
(
String
fromClient
)
throws
RemoteException
{
System
.
out
.
print
(
"Broadcasting new image loading to everyone..."
);
//
System.out.print("Broadcasting new image loading to everyone...");
try
{
try
{
...
@@ -206,7 +206,7 @@ public class DrawingController extends UnicastRemoteObject implements IDrawingCo
...
@@ -206,7 +206,7 @@ public class DrawingController extends UnicastRemoteObject implements IDrawingCo
err
.
printStackTrace
();
err
.
printStackTrace
();
}
}
System
.
out
.
print
(
"...DONE\n"
);
//
System.out.print("...DONE\n");
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