Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SAE2.01 - Developpement application
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PIQUEREZ Corentin
SAE2.01 - Developpement application
Commits
98751da3
Commit
98751da3
authored
2 years ago
by
PIQUEREZ Corentin
Browse files
Options
Downloads
Patches
Plain Diff
updated ShukanViewBar.java
parent
b4c49a30
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
out/production/sae2.01-developpement-application/.gitignore
+1
-1
1 addition, 1 deletion
out/production/sae2.01-developpement-application/.gitignore
shukan/Shukan.java
+3
-0
3 additions, 0 deletions
shukan/Shukan.java
shukan/ShukanViewBar.java
+29
-3
29 additions, 3 deletions
shukan/ShukanViewBar.java
with
33 additions
and
4 deletions
out/production/sae2.01-developpement-application/.gitignore
+
1
−
1
View file @
98751da3
.idea
.
out
out
sae2.01-developpement-application.iml
\ No newline at end of file
This diff is collapsed.
Click to expand it.
shukan/Shukan.java
+
3
−
0
View file @
98751da3
...
...
@@ -29,6 +29,7 @@ public class Shukan
ShukanData
data
=
new
ShukanData
();
ShukanIO
io
=
new
ShukanIO
(
data
);
// Handling edition mode
if
(
args
.
length
>
0
)
if
(
args
[
0
].
equals
(
"edit"
))
...
...
@@ -40,6 +41,7 @@ public class Shukan
// Creating Shukan viewer
JFrame
frame
=
new
JFrame
(
"SHUKAN 1.6"
);
ShukanView
canvas
=
new
ShukanView
(
data
,
io
);
ShukanViewBar
barre
=
new
ShukanViewBar
(
io
,
data
);
// Getting the display size
GraphicsEnvironment
ge
=
GraphicsEnvironment
.
getLocalGraphicsEnvironment
();
...
...
@@ -66,6 +68,7 @@ public class Shukan
}
});
// Setting the window geometry
frame
.
add
(
canvas
);
Insets
ins
=
frame
.
getInsets
();
...
...
This diff is collapsed.
Click to expand it.
shukan/ShukanViewBar.java
+
29
−
3
View file @
98751da3
package
shukan
;
import
javax.imageio.ImageIO
;
import
javax.swing.*
;
import
java.awt.*
;
import
java.io.File
;
public
class
ShukanViewBar
extends
JPanel
{
/** File manager */
private
ShukanIO
myIO
=
null
;
/** Displayed data */
private
ShukanData
data
=
null
;
private
String
[]
imagesName
=
{
"save"
,
"back"
,
"plus"
,
"delete"
,
"left"
,
"right"
,
"export"
,
"parameter"
};
private
String
imagesExtension
=
".png"
;
public
ShukanViewBar
(
ShukanIO
myIO
,
ShukanData
data
){
this
.
myIO
=
myIO
;
...
...
@@ -15,9 +19,31 @@ public class ShukanViewBar extends JPanel {
}
@Override
public
void
paintComponents
(
Graphics
g
)
{
public
void
paintComponent
(
Graphics
g
)
{
super
.
paintComponents
(
g
);
setSize
(
getWidth
(),
80
);
// load images
try
{
for
(
int
i
=
0
;
i
<
imagesName
.
length
;
i
++){
Image
im
=
ImageIO
.
read
(
new
File
(
"data/images/"
+
imagesName
[
i
]+
imagesExtension
));
g
.
drawImage
(
im
,
i
*(
100
),
0
,
this
);
}
}
catch
(
Exception
e
){
System
.
out
.
println
(
"Image manquante"
);}
}
public
static
void
main
(
String
args
[]){
ShukanData
data
=
new
ShukanData
();
ShukanIO
io
=
new
ShukanIO
(
data
);
EventQueue
.
invokeLater
(
new
Runnable
()
{
public
void
run
()
{
JFrame
f
=
new
JFrame
(
"esssai"
);
ShukanViewBar
s
=
new
ShukanViewBar
(
io
,
data
);
f
.
setDefaultCloseOperation
(
JFrame
.
EXIT_ON_CLOSE
);
f
.
add
(
s
);
f
.
pack
();
f
.
setVisible
(
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