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
25a0b11d
Commit
25a0b11d
authored
1 year ago
by
CHEVALIER Noemy
Browse files
Options
Downloads
Patches
Plain Diff
Ajout des différents thèmes
parent
f2ba3bbf
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/ShukanParameters.java
+48
-16
48 additions, 16 deletions
shukan/ShukanParameters.java
with
48 additions
and
16 deletions
shukan/ShukanParameters.java
+
48
−
16
View file @
25a0b11d
...
...
@@ -13,6 +13,9 @@ class ShukanParameters extends JFrame {
private
JButton
changerdetheme
,
theme1
,
theme2
,
theme3
,
retour
,
changertouches
,
changercouleurs
;
/** view of the app */
private
ShukanView
canvas
;
/** Color background, text, hollydays*/
private
Color
BACK_COLOR
,
BACK_COLOR2
,
TEXT_COLOR
,
HOLLY_COLOR
,
INACTIVE_COLOR
;
/** built a parameter window */
public
ShukanParameters
(
String
titre
,
ShukanView
canvas
)
{
super
(
titre
);
...
...
@@ -43,28 +46,57 @@ class ShukanParameters extends JFrame {
theme1
=
new
JButton
(
"Thème sombre"
);
theme1
.
setPreferredSize
(
new
Dimension
(
150
,
25
));
theme1
.
addActionListener
(
new
ActionListener
()
{
@Override
public
void
actionPerformed
(
ActionEvent
e
)
{
canvas
.
setBackgroundColor
(
Color
.
BLACK
);
}
});
theme1
.
addActionListener
(
new
ActionListener
()
{
@Override
public
void
actionPerformed
(
ActionEvent
e
)
{
for
(
int
i
=
0
;
i
<=
6
;
i
++){
BACK_COLOR
=
new
Color
(
51
,
51
,
51
);
BACK_COLOR2
=
new
Color
(
102
,
102
,
102
);
TEXT_COLOR
=
Color
.
WHITE
;
HOLLY_COLOR
=
new
Color
(
153
,
0
,
0
);
INACTIVE_COLOR
=
new
Color
(
204
,
204
,
204
);
canvas
.
setBackgroundColor
(
BACK_COLOR
,
BACK_COLOR2
);
canvas
.
setForeground
(
TEXT_COLOR
,
HOLLY_COLOR
,
INACTIVE_COLOR
);
}
canvas
.
repaint
();
}
});
theme2
=
new
JButton
(
"Thème clair"
);
theme2
.
setPreferredSize
(
new
Dimension
(
150
,
25
));
/*theme2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEVent e) {
getContentPane().setBackground(Color.WHITE);
}
});*/
theme2
.
addActionListener
(
new
ActionListener
()
{
public
void
actionPerformed
(
ActionEvent
e
)
{
for
(
int
i
=
0
;
i
<=
nbModules
;
i
++){
BACK_COLOR
=
new
Color
(
102
,
102
,
102
);
BACK_COLOR2
=
new
Color
(
153
,
153
,
153
);
TEXT_COLOR
=
Color
.
BLACK
;
HOLLY_COLOR
=
new
Color
(
255
,
102
,
102
);
INACTIVE_COLOR
=
new
Color
(
51
,
51
,
51
);
canvas
.
setBackgroundColor
(
BACK_COLOR
,
BACK_COLOR2
);
canvas
.
setForeground
(
TEXT_COLOR
,
HOLLY_COLOR
,
INACTIVE_COLOR
);
}
canvas
.
repaint
();
}
});
theme3
=
new
JButton
(
"Thème modéré"
);
theme3
.
setPreferredSize
(
new
Dimension
(
150
,
25
));
/*theme3.addActionListener(new ActionListener() {
public void actionPerformed(ActionEVent e) {
getContentPane().setBackground(Color.GRIS);
}
});*/
theme3
.
addActionListener
(
new
ActionListener
()
{
public
void
actionPerformed
(
ActionEvent
e
)
{
for
(
int
i
=
0
;
i
<=
nbModules
;
i
++){
BACK_COLOR
=
new
Color
(
226
,
226
,
226
);
BACK_COLOR2
=
Color
.
LIGHT_GRAY
;
TEXT_COLOR
=
Color
.
BLACK
;
HOLLY_COLOR
=
new
Color
(
1
.
f
,
0.8f
,
0.7f
);
INACTIVE_COLOR
=
new
Color
(
0.5f
,
0.5f
,
0.5f
);
canvas
.
setBackgroundColor
(
BACK_COLOR
,
BACK_COLOR2
);
canvas
.
setForeground
(
TEXT_COLOR
,
HOLLY_COLOR
,
INACTIVE_COLOR
);
}
canvas
.
repaint
();
}
});
retour
=
new
JButton
(
"Retour"
);
retour
.
setPreferredSize
(
new
Dimension
(
150
,
25
));
...
...
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