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
38aee1e5
Commit
38aee1e5
authored
5 years ago
by
Hai HoDac
Browse files
Options
Downloads
Patches
Plain Diff
commit
parent
9cfb4f1b
No related branches found
No related tags found
1 merge request
!34
Added encryption
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
+7
-21
7 additions, 21 deletions
src/GUI/PaintGUI.java
with
8 additions
and
22 deletions
src/GUI/DrawingArea.java
+
1
−
1
View file @
38aee1e5
...
...
@@ -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 ///
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
.
fill
(
drawing
);
g2
.
draw
(
drawing
);
...
...
This diff is collapsed.
Click to expand it.
src/GUI/PaintGUI.java
+
7
−
21
View file @
38aee1e5
...
...
@@ -21,14 +21,13 @@ public class PaintGUI extends JPanel {
DrawingArea
drawingArea
;
String
[]
shapes
=
{
"Freehand"
,
"Line"
,
"Circle"
,
"Rectangle"
,
"Oval"
,
"Eraser"
,
"Text"
};
String
[]
strokes
=
{
"
Small
"
,
"Medium"
,
"
Large
"
};
String
[]
strokes
=
{
"
Thin
"
,
"Medium"
,
"
Thick
"
};
String
[]
eraserSizes
=
{
"Small"
,
"Medium"
,
"Large"
};
JFrame
frame
;
JButton
clearBtn
,
newBtn
,
openBtn
,
saveBtn
,
saveAsBtn
;
JButton
freehandBtn
,
lineBtn
,
circleBtn
,
rectBtn
,
ovalBtn
,
eraserBtn
,
textBtn
;
JButton
colorPaletteBtn
,
setFontBtn
;
JTextField
textInput
;
JTextField
textSize
;
JTextField
textInput
,
textSize
;
JComboBox
strokeOptions
;
JComboBox
eraserSizeOptions
;
...
...
@@ -133,12 +132,12 @@ public class PaintGUI extends JPanel {
toolbox1
.
add
(
circleBtn
);
toolbox1
.
add
(
rectBtn
);
toolbox1
.
add
(
ovalBtn
);
toolbox1
.
add
(
eraserBtn
);
toolbox
1
.
add
(
textBtn
);
toolbox1
.
add
(
strokeOptions
);
toolbox
2
.
add
(
textBtn
);
toolbox2
.
add
(
textInput
);
// toolbox2.add(setFontBtn);
toolbox2
.
add
(
textSize
);
toolbox2
.
add
(
strokeOptions
);
toolbox2
.
add
(
eraserBtn
);
toolbox2
.
add
(
eraserSizeOptions
);
toolbox2
.
add
(
clearBtn
);
...
...
@@ -302,13 +301,13 @@ public class PaintGUI extends JPanel {
String
strokeChosen
=
(
String
)
strokeOptions
.
getSelectedItem
();
switch
(
strokeChosen
)
{
case
"
Small
"
:
case
"
Thin
"
:
drawingArea
.
setStroke
(
3
);
break
;
case
"Medium"
:
drawingArea
.
setStroke
(
6
);
break
;
case
"
Large
"
:
case
"
Thick
"
:
drawingArea
.
setStroke
(
10
);
break
;
}
...
...
@@ -383,17 +382,4 @@ public class PaintGUI extends JPanel {
drawingArea
.
setModeText
(
textString
,
size
);
}
// public void showGUI() {
// frame = new JFrame("Shared Whiteboard System");
// JFrame.setDefaultLookAndFeelDecorated(true);
// frame.setContentPane(global);
//
// frame.setSize(800, 600);
// frame.setLocationRelativeTo( null );
// frame.setResizable(false);
// frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// frame.setVisible(true);
// }
}
\ No newline at end of file
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