From 55f2d14d2b9c3daff0c7bb968d78eb5455d9c71c Mon Sep 17 00:00:00 2001 From: piquerez <corentin.piquerez1@etu.univ-lorraine.fr> Date: Fri, 19 May 2023 15:31:00 +0200 Subject: [PATCH] rajout javadoc --- shukan/ShukanController.java | 9 +++++++++ shukan/ShukanParameters.java | 5 ++++- shukan/ShukanViewBar.java | 7 ++++--- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/shukan/ShukanController.java b/shukan/ShukanController.java index 21df055..4c02726 100644 --- a/shukan/ShukanController.java +++ b/shukan/ShukanController.java @@ -156,6 +156,10 @@ public class ShukanController canvas.repaint (); } } + // Manage the double click to open a new window + if (e.getClickCount() == 2 && e.getButton() == MouseEvent.BUTTON1) { + System.out.println("double clicked"); + } if (e.getButton () == MouseEvent.BUTTON3) { if (e.isShiftDown ()) @@ -202,6 +206,11 @@ public class ShukanController public void mouseReleased (MouseEvent e) { } + + /** Invoked when a button has been clicked + * Implementation from actionListener + * @param e detected action event + * */ public void actionPerformed(ActionEvent e){ if (e.getSource()== bar.buttons[0]) canvas.saveData (); diff --git a/shukan/ShukanParameters.java b/shukan/ShukanParameters.java index 77ce5d0..8924b50 100644 --- a/shukan/ShukanParameters.java +++ b/shukan/ShukanParameters.java @@ -5,11 +5,14 @@ import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; - +/** parameters of Shukan */ class ShukanParameters extends JFrame { + /** panels of the graphic interface */ private JPanel pPrincipal,p, p1; + /** buttons of the graphic interface */ private JButton changerdetheme, theme1, theme2, theme3, retour, changertouches, changercouleurs; + /** built a parameter window */ public ShukanParameters(String titre) { super(titre); p = new JPanel(); diff --git a/shukan/ShukanViewBar.java b/shukan/ShukanViewBar.java index c865346..8585c22 100644 --- a/shukan/ShukanViewBar.java +++ b/shukan/ShukanViewBar.java @@ -3,6 +3,7 @@ package shukan; import javax.swing.*; import java.awt.*; +/** toolbar of Shukan */ public class ShukanViewBar extends JPanel { /** Name of the images files for the buttons of the toolbar */ @@ -13,7 +14,7 @@ public class ShukanViewBar extends JPanel { private String imagesExtension = ".png"; /** height in pixel of the toolbar */ private int height; - + /** Built the toolbar */ public ShukanViewBar(int height){ this.height = height; @@ -24,9 +25,9 @@ public class ShukanViewBar extends JPanel { add(buttons[i]); } } - + /** return the height of the toolbar in pixels */ public int getHeight(){return height;} - + /** add actions for the different buttons */ public void addActionListener(ShukanController controller){ for(int i =0; i<imagesName.length; i++){ buttons[i].addActionListener(controller); -- GitLab