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
17fcf14c
Commit
17fcf14c
authored
1 year ago
by
PIQUEREZ Corentin
Browse files
Options
Downloads
Patches
Plain Diff
Début des actions des boutons
parent
f3fd299a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
shukan/ShukanController.java
+32
-5
32 additions, 5 deletions
shukan/ShukanController.java
shukan/ShukanViewBar.java
+3
-3
3 additions, 3 deletions
shukan/ShukanViewBar.java
with
35 additions
and
8 deletions
shukan/ShukanController.java
+
32
−
5
View file @
17fcf14c
package
shukan
;
import
java.awt.event.KeyEvent
;
import
java.awt.event.KeyListener
;
import
java.awt.event.MouseEvent
;
import
java.awt.event.MouseListener
;
import
java.awt.event.*
;
/** Shukan controller
*/
public
class
ShukanController
implements
KeyListener
,
MouseListener
//, MouseMotionListener
implements
KeyListener
,
MouseListener
,
ActionListener
//, MouseMotionListener
{
/** Controlled display area. */
private
ShukanView
canvas
;
/** Controlled display bar */
private
ShukanViewBar
bar
;
/** Controlled application data. */
private
ShukanData
data
;
...
...
@@ -201,4 +200,32 @@ public class ShukanController
public
void
mouseReleased
(
MouseEvent
e
)
{
}
public
void
actionPerformed
(
ActionEvent
e
){
if
(
e
.
getSource
()==
bar
.
buttons
[
0
])
System
.
out
.
println
(
"save"
);
/**case bar.buttons[1]:
System.out.println("back");
break;
case bar.buttons[2]:
System.out.println("plus");
break;
case bar.buttons[3]:
System.out.println("delete");
break;
case bar.buttons[4]:
System.out.println("left");
break;
case bar.buttons[5]:
System.out.println("right");
break;
case bar.buttons[6]:
System.out.println("export");
break;
case bar.buttons[7]:
System.out.println("parameter");
break;*/
}
}
This diff is collapsed.
Click to expand it.
shukan/ShukanViewBar.java
+
3
−
3
View file @
17fcf14c
package
shukan
;
import
javax.imageio.ImageIO
;
import
javax.swing.*
;
import
java.awt.*
;
import
java.io.File
;
public
class
ShukanViewBar
extends
JPanel
{
/** File manager */
...
...
@@ -12,7 +10,8 @@ public class ShukanViewBar extends JPanel {
private
ShukanData
data
=
null
;
/** Name of the images files for the buttons of the toolbar */
private
String
[]
imagesName
=
{
"save"
,
"back"
,
"plus"
,
"delete"
,
"left"
,
"right"
,
"export"
,
"parameter"
};
private
JButton
buttons
[]
=
new
JButton
[
8
];
/** Buttons of the toolbar */
protected
JButton
buttons
[]
=
new
JButton
[
8
];
/** type of the images */
private
String
imagesExtension
=
".png"
;
/** height in pixel of the toolbar */
...
...
@@ -26,6 +25,7 @@ public class ShukanViewBar extends JPanel {
for
(
int
i
=
0
;
i
<
imagesName
.
length
;
i
++){
buttons
[
i
]
=
new
JButton
(
""
,
new
ImageIcon
(
"data/images/"
+
imagesName
[
i
]+
imagesExtension
));
buttons
[
i
].
setPreferredSize
(
new
Dimension
(
80
,
80
));
//buttons[i].addActionListener(...);
add
(
buttons
[
i
]);
}
}
...
...
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