Commit 96666db6 authored by Noah SIGOIGNE's avatar Noah SIGOIGNE
Browse files

Merge remote-tracking branch 'origin/master'

parents 7d4b0289 d164ff02
......@@ -16,11 +16,15 @@ class ImagePanel extends JPanel {
super();
image = null;
}
public ImagePanel(String filePath){
this();
chargerImage(filePath);
}
public void chargerImage(String url) {
System.out.println("loading image from " + url);
public void chargerImage(String filePath) {
System.out.println("loading image from " + filePath);
try {
image = ImageIO.read(new File(url));
image = ImageIO.read(new File(filePath));
} catch (IOException e) {
e.printStackTrace();
}
......
package info1.Vue;
import info1.application.appli;
import info1.controlleur.QuitterJeuControleur;
import info1.controlleur.*;
import info1.network.*;
import javax.imageio.*;
import javax.swing.*;
import javax.swing.border.*;
import info1.ships.*;
import java.awt.event.*;
import java.util.*;
import java.awt.*;
import java.awt.image.*;
import java.io.*;
public class PageJeu extends JPanel {
......@@ -37,7 +41,7 @@ public class PageJeu extends JPanel {
this.listPlouf = new ArrayList<>();
Dimension tailleMap = new Dimension(500,500);
Dimension tailleConfirmer = new Dimension(100,60);
Dimension tailleConfirmer = new Dimension(134,52);
Dimension taillePV = new Dimension (500,60);
JPanel panelMap = new JPanel();
......@@ -71,10 +75,17 @@ public class PageJeu extends JPanel {
JPanel sud = new JPanel();
sud.setLayout(new FlowLayout());
confirmer = new JButton("Shoot !");
confirmer = new JButton();
confirmer.setPreferredSize(tailleConfirmer);
confirmer.setAlignmentX(Component.CENTER_ALIGNMENT);
confirmer.setAlignmentY(Component.RIGHT_ALIGNMENT);
//!pour set les images c'est de là
try {
confirmer.setIcon(new ImageIcon((ImageIO.read(new File("img/interface/bouton/boutonShoot1.png"))).getScaledInstance((int)tailleConfirmer.getWidth(),(int)tailleConfirmer.getHeight(), Image.SCALE_SMOOTH)));
} catch (IOException e) {
System.out.println("problem loading image: "+"img/interface/bouton/boutonShoot1.png");
}
//!à là
sud.add(confirmer);
sud.setAlignmentX(Component.CENTER_ALIGNMENT);
sud.setAlignmentY(Component.RIGHT_ALIGNMENT);
......
package info1.Vue;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Toolkit;
import java.awt.*;
import javax.swing.*;
......@@ -16,14 +11,10 @@ public class ViewManager extends JFrame {
private Dimension ScreenSize = Toolkit.getDefaultToolkit().getScreenSize();
private int screenWidth=(int) ScreenSize.getWidth();
private int screenHeight=(int) ScreenSize.getHeight();
private static final int WIDTH = 1000;
private static final int HEIGHT = 600;
public String getTitre() {
return this.getTitle();
}
public void setTitre(String titre) {
setTitle(titre);
public ViewManager() {
super();
}
public JPanel getMainView() {
......@@ -44,8 +35,12 @@ public class ViewManager extends JFrame {
this.pack();
this.setVisible(true);
}
public ViewManager() {
super();
public String getTitre() {
return this.getTitle();
}
public void setTitre(String titre) {
setTitle(titre);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment