diff --git a/shukan/ShukanController.java b/shukan/ShukanController.java index 21df055bd57fea9e76493ed4848cebb9520b2101..4c027263c5fbded8733927e3f1fdf738d28d0da2 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 77ce5d034ecf6802e855734fc760277a340f7b7e..8924b50f304cd06c6bce99de6ccd9e8bb07d4ce1 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 c86534619e9e8c8dcba10a41ac0399498111a7ae..8585c22ba5f3b1265ab7a1d7a23f74c60ea4f5f6 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);