@@ -0,0 +1,3251 @@
+import java.awt.BorderLayout;%0Aimport java.awt.Image;%0Aimport java.awt.Toolkit;%0Aimport java.io.BufferedWriter;%0Aimport java.io.File;%0Aimport java.io.FileInputStream;%0Aimport java.io.FileOutputStream;%0Aimport java.io.FileWriter;%0Aimport java.io.IOException;%0Aimport java.io.ObjectInputStream;%0Aimport java.io.ObjectOutputStream;%0A%0Aimport javax.swing.ImageIcon;%0Aimport javax.swing.JFileChooser;%0Aimport javax.swing.JFrame;%0Aimport javax.swing.JScrollPane;%0A%0A%0Apublic class Base extends JFrame %7B%0A%09public ObjectOutputStream output;%0A    public ObjectInputStream input;%0A    %0A    public Essai dessin;%0A    protected Menu menuBar;%0A    public Option menugauche ;%0A%09%0A    public Base()%0A    %7B%0A    %09Toolkit kit = Toolkit.getDefaultToolkit();%0A        this.setTitle(%22Devis'Me%22);%0A        setSize(1024, 768);%0A        setLayout(new BorderLayout());%0A        %0A        dessin = new Essai();%0A        menuBar = new Menu();%0A        menugauche = new Option();%0A        add(new JScrollPane(dessin),  BorderLayout.CENTER);%0A        %0A        add(menugauche, BorderLayout.EAST);%0A        add(menuBar,    BorderLayout.NORTH);%0A        %0A        %0A        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);%0A        setVisible(true);%0A        %0A        Image img = kit.getImage(%22C:/3ial/PROJET/Devis.png%22);%0A        setIconImage(img);%0A%0A    %7D%0A    public File getFileName()%0A    %7B%0A        JFileChooser fileChooser = new JFileChooser();%0A        fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);%0A        fileChooser.setCurrentDirectory(new File(%22/Users/stevevitali/Desktop%22));%0A%0A        int result = fileChooser.showOpenDialog(this);%0A%0A        File fileName = fileChooser.getSelectedFile();%0A%0A        return fileName;%0A    %7D%0A    public void loadFile(File fileName)%0A    %7B%0A        try%0A        %7B%0A            input = new ObjectInputStream(new FileInputStream(fileName));%0A        %7D%0A        catch(IOException ioException)%0A        %7B%0A            System.err.println(%22Error loading file: %22+fileName);%0A            return;%0A        %7D%0A    %7D%0A%0A    public void openFile(File fileName)%0A    %7B%0A        try%0A        %7B%0A            output = new ObjectOutputStream(new FileOutputStream(fileName));%0A        %7D%0A        catch(IOException ioException)%0A        %7B%0A            System.err.println(%22Error loading file: %22+fileName);%0A            return;%0A        %7D%0A    %7D%0A%0A    public void saveFile()%0A    %7B%0A        try%0A        %7B%0A            JFileChooser chooseDirec = new JFileChooser();%0A            chooseDirec.setFileSelectionMode(JFileChooser.FILES_ONLY);%0A            chooseDirec.showSaveDialog(Main.test);%0A            File file = chooseDirec.getSelectedFile();%0A            file = new File(file+%22.spa%22);%0A            %0A            BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(file));%0A%0A            bufferedWriter.close();%0A%0A            openFile(file);%0A           // writeSketchToFile(file);%0A            closeFile();%0A        %7D%0A        catch (IOException exception)%0A        %7B%0A            System.err.println(%22Error saving to new file.%22);%0A        %7D%0A    %7D%0A%0A    public void closeFile()%0A    %7B%0A        try%0A        %7B%0A            if (output != null)%0A                output.close();%0A        %7D%0A        catch (IOException exception)%0A        %7B%0A            System.err.println(%22Error closing file%22);%0A            System.exit(1);%0A        %7D%0A    %7D%0A%0A%7D%0A

Create Base.java