diff --git a/data/2223_S2/version.txt b/data/2223_S2/version.txt index 26802805e470c96e94a6aa1a03d46abd373d3774..a28b2aff894b92cee2b147e3364389084279be47 100644 --- a/data/2223_S2/version.txt +++ b/data/2223_S2/version.txt @@ -1,2 +1,2 @@ -3 -230411 +4 +230511 diff --git a/data/images/parameter.png b/data/images/parameter.png index 43c815296461d5c81fa40f9107c0001eae83baa8..94ad75f5e0aa6627ce0b4ce5ea03c0c980a4ebdc 100644 Binary files a/data/images/parameter.png and b/data/images/parameter.png differ diff --git a/out/production/sae2.01-developpement-application/data/2223_S2/version.txt b/out/production/sae2.01-developpement-application/data/2223_S2/version.txt index 26802805e470c96e94a6aa1a03d46abd373d3774..a28b2aff894b92cee2b147e3364389084279be47 100644 --- a/out/production/sae2.01-developpement-application/data/2223_S2/version.txt +++ b/out/production/sae2.01-developpement-application/data/2223_S2/version.txt @@ -1,2 +1,2 @@ -3 -230411 +4 +230511 diff --git a/shukan/Shukan.java b/shukan/Shukan.java index 81ccce3d885e17cf10b146879545cf8db968f5d7..f92c6e229090e7004217aea42c1a222be1bc2734 100644 --- a/shukan/Shukan.java +++ b/shukan/Shukan.java @@ -1,5 +1,5 @@ package shukan; -import javax.swing.JFrame; +import javax.swing.*; import java.awt.*; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; @@ -35,8 +35,9 @@ public class Shukan // Creating Shukan viewer JFrame frame = new JFrame ("SHUKAN 1.6"); + JPanel global = new JPanel(new BorderLayout()); ShukanView canvas = new ShukanView (data, io); - ShukanViewBar barre = new ShukanViewBar(io, data); + ShukanViewBar barre = new ShukanViewBar(io, data, 90); // Getting the display size GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment (); @@ -44,13 +45,14 @@ public class Shukan GraphicsConfiguration[] gc = gd.getConfigurations (); Rectangle gcBounds = gc[0].getBounds (); canvas.restrictSize ((int) (gcBounds.getWidth ()) - LEFT_MARGIN, - (int) (gcBounds.getHeight ()) - TOP_MARGIN); + (int) (gcBounds.getHeight ()) - TOP_MARGIN - barre.getHeight()); + barre.setSize(new Dimension((int) (gcBounds.getWidth ()) - LEFT_MARGIN, barre.getHeight())); // Adding a openGL input handler (controller) ShukanController myController = new ShukanController (canvas, data); canvas.addKeyListener (myController); canvas.addMouseListener (myController); - // canvas.addMouseMotionListener (myController); + //canvas.addMouseMotionListener (myController); // Preparing the window closing button frame.addWindowListener ( @@ -65,11 +67,12 @@ public class Shukan // Setting the window geometry - frame.add(barre, BorderLayout.NORTH); - frame.add (canvas, BorderLayout.CENTER); + global.add(barre, BorderLayout.NORTH); + global.add (canvas, BorderLayout.CENTER); + frame.add(global); Insets ins = frame.getInsets (); frame.setSize (canvas.displayWidth () + ins.left + ins.right, - canvas.displayHeight ()+ ins.top + ins.bottom); + canvas.displayHeight ()+ barre.getHeight()+ ins.top + ins.bottom); frame.setLocation (LEFT_MARGIN, 0); frame.setBackground (Color.white); frame.setVisible (true); diff --git a/shukan/ShukanViewBar.java b/shukan/ShukanViewBar.java index 9b8ca20021601d3bcc6424fb552caa556909783f..01605ab1f78661ce7f7eedc3238cdd59fd6a18b2 100644 --- a/shukan/ShukanViewBar.java +++ b/shukan/ShukanViewBar.java @@ -10,15 +10,27 @@ public class ShukanViewBar extends JPanel { private ShukanIO myIO = null; /** Displayed data */ 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]; + /** type of the images */ private String imagesExtension = ".png"; + /** height in pixel of the toolbar */ + private int height; - public ShukanViewBar(ShukanIO myIO, ShukanData data){ + public ShukanViewBar(ShukanIO myIO, ShukanData data, int height){ this.myIO = myIO; this.data = data; + this.height = height; + + 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)); + add(buttons[i]); + } } - @Override +/* @Override public void paintComponent(Graphics g) { super.paintComponents(g); // load images @@ -29,7 +41,10 @@ public class ShukanViewBar extends JPanel { } } catch(Exception e){System.out.println("Image manquante");} - } + }*/ + + + public int getHeight(){return height;} public static void main(String args[]){ ShukanData data = new ShukanData (); @@ -37,8 +52,8 @@ public class ShukanViewBar extends JPanel { EventQueue.invokeLater(new Runnable() { public void run() { JFrame f = new JFrame("esssai"); - ShukanViewBar s = new ShukanViewBar (io,data); - f.setSize(1000, 80); + ShukanViewBar s = new ShukanViewBar (io,data, 90); + f.setSize(1000, s.getHeight()); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.add(s);