Skip to content
Snippets Groups Projects
Commit 55f2d14d authored by PIQUEREZ Corentin's avatar PIQUEREZ Corentin
Browse files

rajout javadoc

parent 221f3a9b
No related branches found
No related tags found
No related merge requests found
...@@ -156,6 +156,10 @@ public class ShukanController ...@@ -156,6 +156,10 @@ public class ShukanController
canvas.repaint (); 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.getButton () == MouseEvent.BUTTON3)
{ {
if (e.isShiftDown ()) if (e.isShiftDown ())
...@@ -202,6 +206,11 @@ public class ShukanController ...@@ -202,6 +206,11 @@ public class ShukanController
public void mouseReleased (MouseEvent e) 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){ public void actionPerformed(ActionEvent e){
if (e.getSource()== bar.buttons[0]) if (e.getSource()== bar.buttons[0])
canvas.saveData (); canvas.saveData ();
......
...@@ -5,11 +5,14 @@ import java.awt.*; ...@@ -5,11 +5,14 @@ import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
/** parameters of Shukan */
class ShukanParameters extends JFrame { class ShukanParameters extends JFrame {
/** panels of the graphic interface */
private JPanel pPrincipal,p, p1; private JPanel pPrincipal,p, p1;
/** buttons of the graphic interface */
private JButton changerdetheme, theme1, theme2, theme3, retour, changertouches, changercouleurs; private JButton changerdetheme, theme1, theme2, theme3, retour, changertouches, changercouleurs;
/** built a parameter window */
public ShukanParameters(String titre) { public ShukanParameters(String titre) {
super(titre); super(titre);
p = new JPanel(); p = new JPanel();
......
...@@ -3,6 +3,7 @@ package shukan; ...@@ -3,6 +3,7 @@ package shukan;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
/** toolbar of Shukan */
public class ShukanViewBar extends JPanel { public class ShukanViewBar extends JPanel {
/** Name of the images files for the buttons of the toolbar */ /** Name of the images files for the buttons of the toolbar */
...@@ -13,7 +14,7 @@ public class ShukanViewBar extends JPanel { ...@@ -13,7 +14,7 @@ public class ShukanViewBar extends JPanel {
private String imagesExtension = ".png"; private String imagesExtension = ".png";
/** height in pixel of the toolbar */ /** height in pixel of the toolbar */
private int height; private int height;
/** Built the toolbar */
public ShukanViewBar(int height){ public ShukanViewBar(int height){
this.height = height; this.height = height;
...@@ -24,9 +25,9 @@ public class ShukanViewBar extends JPanel { ...@@ -24,9 +25,9 @@ public class ShukanViewBar extends JPanel {
add(buttons[i]); add(buttons[i]);
} }
} }
/** return the height of the toolbar in pixels */
public int getHeight(){return height;} public int getHeight(){return height;}
/** add actions for the different buttons */
public void addActionListener(ShukanController controller){ public void addActionListener(ShukanController controller){
for(int i =0; i<imagesName.length; i++){ for(int i =0; i<imagesName.length; i++){
buttons[i].addActionListener(controller); buttons[i].addActionListener(controller);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment