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
45627a40
Commit
45627a40
authored
Oct 23, 2019
by
Chang Che Hao
Browse files
Options
Downloads
Patches
Plain Diff
stroke description changed & eraser bug fixed
parent
121c616c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/GUI/DrawingArea.java
+1
-1
1 addition, 1 deletion
src/GUI/DrawingArea.java
src/GUI/PaintGUI.java
+3
-3
3 additions, 3 deletions
src/GUI/PaintGUI.java
with
4 additions
and
4 deletions
src/GUI/DrawingArea.java
+
1
−
1
View file @
45627a40
...
@@ -357,7 +357,7 @@ public class DrawingArea extends JPanel implements MouseMotionListener, MouseLis
...
@@ -357,7 +357,7 @@ public class DrawingArea extends JPanel implements MouseMotionListener, MouseLis
/// Eraser is continuously drawing "small white circle" from current point to previous point ///
/// Eraser is continuously drawing "small white circle" from current point to previous point ///
case
ERASE:
case
ERASE:
((
Ellipse2D
)
drawing
).
setFrame
(
currentPoint
.
getX
(),
currentPoint
.
getY
(),
10
,
10
);
((
Ellipse2D
)
drawing
).
setFrame
(
currentPoint
.
getX
(),
currentPoint
.
getY
(),
eraserSize
,
eraserSize
);
g2
.
setColor
(
Color
.
WHITE
);
g2
.
setColor
(
Color
.
WHITE
);
g2
.
fill
(
drawing
);
g2
.
fill
(
drawing
);
g2
.
draw
(
drawing
);
g2
.
draw
(
drawing
);
...
...
This diff is collapsed.
Click to expand it.
src/GUI/PaintGUI.java
+
3
−
3
View file @
45627a40
...
@@ -21,7 +21,7 @@ public class PaintGUI extends JPanel {
...
@@ -21,7 +21,7 @@ public class PaintGUI extends JPanel {
DrawingArea
drawingArea
;
DrawingArea
drawingArea
;
String
[]
shapes
=
{
"Freehand"
,
"Line"
,
"Circle"
,
"Rectangle"
,
"Oval"
,
"Eraser"
,
"Text"
};
String
[]
shapes
=
{
"Freehand"
,
"Line"
,
"Circle"
,
"Rectangle"
,
"Oval"
,
"Eraser"
,
"Text"
};
String
[]
strokes
=
{
"
Small
"
,
"Medium"
,
"
Large
"
};
String
[]
strokes
=
{
"
Thin
"
,
"Medium"
,
"
Thick
"
};
String
[]
eraserSizes
=
{
"Small"
,
"Medium"
,
"Large"
};
String
[]
eraserSizes
=
{
"Small"
,
"Medium"
,
"Large"
};
JFrame
frame
;
JFrame
frame
;
JButton
clearBtn
,
newBtn
,
openBtn
,
saveBtn
,
saveAsBtn
;
JButton
clearBtn
,
newBtn
,
openBtn
,
saveBtn
,
saveAsBtn
;
...
@@ -302,13 +302,13 @@ public class PaintGUI extends JPanel {
...
@@ -302,13 +302,13 @@ public class PaintGUI extends JPanel {
String
strokeChosen
=
(
String
)
strokeOptions
.
getSelectedItem
();
String
strokeChosen
=
(
String
)
strokeOptions
.
getSelectedItem
();
switch
(
strokeChosen
)
{
switch
(
strokeChosen
)
{
case
"
Small
"
:
case
"
Thin
"
:
drawingArea
.
setStroke
(
3
);
drawingArea
.
setStroke
(
3
);
break
;
break
;
case
"Medium"
:
case
"Medium"
:
drawingArea
.
setStroke
(
6
);
drawingArea
.
setStroke
(
6
);
break
;
break
;
case
"
Large
"
:
case
"
Thick
"
:
drawingArea
.
setStroke
(
10
);
drawingArea
.
setStroke
(
10
);
break
;
break
;
}
}
...
...
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