Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Game engine template
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
LABOUREL Arnaud
Game engine template
Commits
9fc20818
Commit
9fc20818
authored
2 years ago
by
LABOUREL Arnaud
Browse files
Options
Downloads
Patches
Plain Diff
Corrected files in order to pass checkstyle
parent
f961f589
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
build.gradle
+0
-7
0 additions, 7 deletions
build.gradle
src/main/java/sample/MyJavaFrame.java
+24
-0
24 additions, 0 deletions
src/main/java/sample/MyJavaFrame.java
src/main/java/sample/MyJavaPanel.java
+13
-6
13 additions, 6 deletions
src/main/java/sample/MyJavaPanel.java
with
37 additions
and
13 deletions
build.gradle
+
0
−
7
View file @
9fc20818
...
...
@@ -8,8 +8,6 @@ plugins {
group
'fr.univ_amu'
version
'1.0-SNAPSHOT'
checkstyle
{
toolVersion
=
'10.3.4'
}
...
...
@@ -19,14 +17,11 @@ repositories {
}
dependencies
{
checkstyle
"com.puppycrawl.tools:checkstyle:10.3.4"
testImplementation
(
'org.junit.jupiter:junit-jupiter-api:5.9.0'
,
'org.assertj:assertj-core:3.23.1'
)
testRuntimeOnly
'org.junit.jupiter:junit-jupiter-engine:5.9.0'
}
test
{
finalizedBy
jacocoTestReport
// report is always generated after tests run
}
...
...
@@ -34,8 +29,6 @@ jacocoTestReport {
dependsOn
test
// tests are required to run before generating the report
}
test
{
useJUnitPlatform
()
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/sample/MyJFrame.java
→
src/main/java/sample/MyJ
ava
Frame.java
+
24
−
0
View file @
9fc20818
package
sample
;
import
javax.swing.*
;
//import java.awt.*;
import
javax.swing.JFrame
;
public
class
MyJFrame
extends
JFrame
{
public
MyJFrame
(){
/**
* An extended version of javax.swing.JFrame containing a panel to draw images.
*/
public
class
MyJavaFrame
extends
JFrame
{
/**
* Constructs a new visible frame.
*/
public
MyJavaFrame
()
{
setTitle
(
"Main window"
);
setSize
(
400
,
400
);
setLocationRelativeTo
(
null
);
setDefaultCloseOperation
(
JFrame
.
EXIT_ON_CLOSE
);
add
(
new
MyJPanel
());
add
(
new
MyJ
ava
Panel
());
setVisible
(
true
);
}
public
static
void
main
(
String
[]
args
)
{
MyJFrame
app
=
new
MyJFrame
();
new
MyJ
ava
Frame
();
}
}
This diff is collapsed.
Click to expand it.
src/main/java/sample/MyJPanel.java
→
src/main/java/sample/MyJ
ava
Panel.java
+
13
−
6
View file @
9fc20818
package
sample
;
import
javax.imageio.ImageIO
;
import
javax.swing.*
;
import
java.awt.*
;
import
java.awt.Graphics
;
import
java.awt.image.BufferedImage
;
import
java.io.IOException
;
import
java.util.Objects
;
import
javax.imageio.ImageIO
;
import
javax.swing.JPanel
;
public
class
MyJPanel
extends
JPanel
{
/**
* An extension of javax.swing.JFrame that can draw images.
*/
public
class
MyJavaPanel
extends
JPanel
{
private
BufferedImage
image
;
/**
* Constructs a new panel that draw an image.
*/
public
MyJPanel
()
{
public
MyJ
ava
Panel
()
{
try
{
image
=
ImageIO
.
read
(
getClass
().
getResource
(
"image.png"
));
image
=
ImageIO
.
read
(
Objects
.
requireNonNull
(
getClass
().
getResource
(
"image.png"
))
)
;
}
catch
(
IOException
ex
)
{
System
.
out
.
println
(
"problem! image can't be loaded!"
);
}
...
...
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