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
80cad7a8
Commit
80cad7a8
authored
Oct 24, 2019
by
Ho Dac Hai
Browse files
Options
Downloads
Plain Diff
Merge branch 'hai' into 'master'
fixed GUI layout See merge request
!41
parents
2d99e358
025629b0
No related branches found
No related tags found
1 merge request
!41
fixed GUI layout
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/GUI/DrawingArea.java
+2
-0
2 additions, 0 deletions
src/GUI/DrawingArea.java
src/GUI/PaintGUI.java
+8
-3
8 additions, 3 deletions
src/GUI/PaintGUI.java
with
10 additions
and
3 deletions
src/GUI/DrawingArea.java
+
2
−
0
View file @
80cad7a8
...
@@ -94,6 +94,8 @@ public class DrawingArea extends JPanel implements MouseMotionListener, MouseLis
...
@@ -94,6 +94,8 @@ public class DrawingArea extends JPanel implements MouseMotionListener, MouseLis
public
void
clear
()
{
public
void
clear
()
{
image
=
new
BufferedImage
(
AREA_WIDTH
,
AREA_HEIGHT
,
BufferedImage
.
TYPE_INT_ARGB
);
image
=
new
BufferedImage
(
AREA_WIDTH
,
AREA_HEIGHT
,
BufferedImage
.
TYPE_INT_ARGB
);
g2
=
(
Graphics2D
)
image
.
getGraphics
();
g2
.
setRenderingHint
(
RenderingHints
.
KEY_ANTIALIASING
,
RenderingHints
.
VALUE_ANTIALIAS_ON
);
repaint
();
repaint
();
}
}
...
...
This diff is collapsed.
Click to expand it.
src/GUI/PaintGUI.java
+
8
−
3
View file @
80cad7a8
package
GUI
;
package
GUI
;
import
client.Client
;
import
client.Client
;
import
remote.IDrawingUpdate
;
import
javax.imageio.ImageIO
;
import
javax.imageio.ImageIO
;
import
javax.swing.*
;
import
javax.swing.*
;
...
@@ -107,7 +106,7 @@ public class PaintGUI extends JPanel {
...
@@ -107,7 +106,7 @@ public class PaintGUI extends JPanel {
// setFontBtn = new JButton("Font");
// setFontBtn = new JButton("Font");
// setFontBtn.addActionListener(actionListener);
// setFontBtn.addActionListener(actionListener);
textInput
=
new
JTextField
(
"Text here."
);
textInput
=
new
JTextField
(
"Text here."
);
textInput
.
setColumns
(
8
);
textInput
.
setColumns
(
13
);
textInput
.
addFocusListener
(
focusListener
);
textInput
.
addFocusListener
(
focusListener
);
// textInput.setVisible(false);
// textInput.setVisible(false);
textSize
=
new
JTextField
(
"12"
);
textSize
=
new
JTextField
(
"12"
);
...
@@ -409,7 +408,13 @@ public class PaintGUI extends JPanel {
...
@@ -409,7 +408,13 @@ public class PaintGUI extends JPanel {
private
void
setTextDetail
()
{
private
void
setTextDetail
()
{
String
textString
=
textInput
.
getText
();
String
textString
=
textInput
.
getText
();
int
size
=
Integer
.
parseInt
(
textSize
.
getText
());
int
size
=
12
;
// default
if
(!
textSize
.
getText
().
isEmpty
())
{
size
=
Integer
.
parseInt
(
textSize
.
getText
());
}
else
{
textSize
.
setText
(
Integer
.
toString
(
size
));
}
drawingArea
.
setModeText
(
textString
,
size
);
drawingArea
.
setModeText
(
textString
,
size
);
}
}
...
...
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