Package GUI

Examples of GUI.ImageTab


      JFileChooser fc = new JFileChooser();
      fc.showOpenDialog(null);
      if (fc.getSelectedFile() != null)
      {
        BufferedImage img = IO.ReadImage(fc.getSelectedFile());
        ImageTab imgtab = new ImageTab(img, fc.getSelectedFile().getName());
        imgtab.getMemento().push(img);
        System.out.println(imgtab.getMemento().getStack().getPtr());
        //memento_.push(IO.ReadImage(fc.getSelectedFile()));
        //gui_.updateImage(memento_.getImage());
        gui_.addTab(imgtab);
      }
    } else if (item.getText().equals("Save image"))
    {
      JFileChooser fc = new JFileChooser();
      fc.showSaveDialog(null);
      if (fc.getSelectedFile() != null)
      {
        IO.SaveImage(fc.getSelectedFile(), gui_.getCurrentTab().getMemento()
            .getImage());
      }
    } else if (item.getText().equals("Open project"))
    {
      JFileChooser fc = new JFileChooser();
      fc.showOpenDialog(null);
      if (fc.getSelectedFile() != null)
      {
        Memento memento = Serializer.Deserialize(fc.getSelectedFile());
        ImageTab imgtab = new ImageTab(memento.getImage(), fc.getSelectedFile()
            .getName());
        imgtab.setMemento(memento);
        gui_.addTab(imgtab);
        //gui_.getCurrentTab().setMemento(Serializer.Deserialize(fc.getSelectedFile()));
        //gui_.getCurrentTab().updateImage(gui_.getCurrentTab().getMemento().getImage());
        //memento_ = gui_.getMemento();
        //gui_.updateImage(gui_.getMemento().getImage());
View Full Code Here

TOP

Related Classes of GUI.ImageTab

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.