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
9ebe72d5
Commit
9ebe72d5
authored
1 year ago
by
CHEVALIER Noemy
Browse files
Options
Downloads
Patches
Plain Diff
Update ShukanViewBar.java
parent
0d2d5dc4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
shukan/ShukanViewBar.java
+37
-16
37 additions, 16 deletions
shukan/ShukanViewBar.java
with
37 additions
and
16 deletions
shukan/ShukanViewBar.java
+
37
−
16
View file @
9ebe72d5
package
shukan
;
package
shukan
;
import
javax.swing.*
;
import
javax.swing.*
;
import
javax.swing.border.LineBorder
;
import
javax.swing.border.MatteBorder
;
import
java.awt.*
;
import
java.awt.*
;
/**
toolbar of
Shukan */
/**
barre d'outils de
Shukan */
public
class
ShukanViewBar
extends
JPanel
{
public
class
ShukanViewBar
extends
JPanel
{
/** N
ame of the images files for the buttons of the toolbar
*/
/** N
oms des fichiers d'images pour les boutons de la barre d'outils
*/
private
String
[]
imagesName
=
{
"save"
,
"back"
,
"plus"
,
"delete"
,
"left"
,
"right"
,
"export"
,
"parameter"
};
private
String
[]
imagesName
=
{
"save"
,
"back"
,
"plus"
,
"delete"
,
"left"
,
"right"
,
"export"
,
"parameter"
};
/** Bu
t
tons
of the toolbar
*/
/** B
o
utons
de la barre d'outils
*/
protected
JButton
buttons
[]
=
new
JButton
[
8
];
protected
JButton
buttons
[]
=
new
JButton
[
8
];
/**
type of the
images */
/**
Extension des
images */
private
String
imagesExtension
=
".png"
;
private
String
imagesExtension
=
".png"
;
/**
height in pixel of the toolbar
*/
/**
Hauteur en pixels de la barre d'outils
*/
private
int
height
;
private
int
height
;
/** B
uilt the toolbar
*/
/** B
arre contenant tous les boutons
*/
p
ublic
ShukanViewBar
(
int
height
){
p
rivate
JPanel
fonct
;
/** Construit la barre d'outils */
public
ShukanViewBar
(
int
height
)
{
fonct
=
new
JPanel
();
this
.
height
=
height
;
this
.
height
=
height
;
for
(
int
i
=
0
;
i
<
imagesName
.
length
;
i
++){
for
(
int
i
=
0
;
i
<
imagesName
.
length
;
i
++)
{
buttons
[
i
]
=
new
JButton
(
""
,
new
ImageIcon
(
"data/images/"
+
imagesName
[
i
]+
imagesExtension
));
buttons
[
i
]
=
new
JButton
(
""
,
new
ImageIcon
(
"data/images/"
+
imagesName
[
i
]
+
imagesExtension
));
buttons
[
i
].
setPreferredSize
(
new
Dimension
(
80
,
80
));
buttons
[
i
].
setPreferredSize
(
new
Dimension
(
85
,
85
));
add
(
buttons
[
i
]);
buttons
[
i
].
setBackground
(
Color
.
WHITE
);
buttons
[
i
].
setBorder
(
new
LineBorder
(
Color
.
WHITE
));
fonct
.
add
(
buttons
[
i
]);
}
}
// Définir la taille personnalisée pour la JPanel
fonct
.
setPreferredSize
(
new
Dimension
(
300
,
height
+
10
));
fonct
.
setBackground
(
Color
.
WHITE
);
setLayout
(
new
BorderLayout
());
add
(
fonct
,
BorderLayout
.
CENTER
);
setBackground
(
Color
.
WHITE
);
}
}
/** return the height of the toolbar in pixels */
public
int
getHeight
(){
return
height
;}
/** Retourne la hauteur de la barre d'outils en pixels */
/** add actions for the different buttons */
public
int
getHeight
()
{
public
void
addActionListener
(
ShukanController
controller
){
return
height
;
for
(
int
i
=
0
;
i
<
imagesName
.
length
;
i
++){
}
/** Ajoute les actions pour les différents boutons */
public
void
addActionListener
(
ShukanController
controller
)
{
for
(
int
i
=
0
;
i
<
imagesName
.
length
;
i
++)
{
buttons
[
i
].
addActionListener
(
controller
);
buttons
[
i
].
addActionListener
(
controller
);
}
}
}
}
...
...
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