package View;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLayeredPane;
import javax.swing.JScrollPane;
import Model.*;
@SuppressWarnings("serial")
public class Fenetre extends JFrame{
public JLayeredPane container;
public MenuBar menuBar;
public BottomArea bottomArea;
public EditionArea editionArea;
public JScrollPane scroller;
public Projet projet;
public Fenetre(){
projet = null;
setSize(1024,760);
setMinimumSize(new Dimension(1000, 600));
setDefaultCloseOperation(EXIT_ON_CLOSE);
setLocationRelativeTo(null);
setTitle("Mon CTT � moi");
setIconImage(new ImageIcon(ClassLoader.getSystemResource("Images/abstraction.gif")).getImage());
container = new JLayeredPane();
container.setBounds(0, 0, getWidth(), getHeight());
container.setOpaque(true);
container.setBackground(Color.DARK_GRAY);
container.setLayout(new BorderLayout());
menuBar = new MenuBar();
setJMenuBar(menuBar);
bottomArea = new BottomArea(this);
container.add(bottomArea, BorderLayout.SOUTH);
editionArea = new EditionArea(this);
scroller = new JScrollPane(editionArea);
scroller.setSize(getSize().width-15, getSize().height - 250);
scroller.setWheelScrollingEnabled(true);
container.add(scroller, BorderLayout.CENTER);
scroller.getHorizontalScrollBar().setValueIsAdjusting(false);
scroller.getVerticalScrollBar().setValueIsAdjusting(false);
setContentPane(container);
setVisible(true);
}
public void lancerProjet(Projet p){
projet = p;
editionArea.removeAll();
editionArea.add(projet.treeLabel.racine);
editionArea.buildTree(projet.treeLabel);
}
}