Package com.cburch.logisim.gui.main

Examples of com.cburch.logisim.gui.main.Frame


  private static Frame mostRecentFrame = null;

  private Projects() { }
 
  public static Frame getTopFrame() {
    Frame ret = mostRecentFrame;
    if (ret == null) {
      Frame backup = null;
      for (Project proj : openProjects) {
        Frame frame = proj.getFrame();
        if (ret == null) ret = frame;
        if (ret.isVisible() && (ret.getExtendedState() & Frame.ICONIFIED) != 0) {
          backup = ret;
        }
      }
View Full Code Here


    if (frame == null) return;
   
    // locate the window
    Point lowest = null;
    for (Project p : openProjects) {
      Frame f = p.getFrame();
      if (f == null) continue;
      Point loc = p.getFrame().getLocation();
      if (lowest == null || loc.y > lowest.y) lowest = loc;
    }
    if (lowest != null) {
View Full Code Here

      mostRecentFrame = (Frame) event.getSource();
    }
   
    @Override
    public void windowClosing(WindowEvent event) {
      Frame frame = (Frame) event.getSource();
      if ((frame.getExtendedState() & Frame.ICONIFIED) == 0) {
        mostRecentFrame = frame;
        try {
          frameLocations.put(frame, frame.getLocationOnScreen());
        } catch (Throwable t) { }
      }
    }
View Full Code Here

      }
    }
   
    @Override
    public void windowClosed(WindowEvent event) {
      Frame frame = (Frame) event.getSource();
      Project proj = frame.getProject();
     
      if (frame == proj.getFrame()) {
        projectRemoved(proj, frame, this);
      }
      if (openProjects.isEmpty() && !MacCompatibility.isSwingUsingScreenMenuBar()) {
View Full Code Here

      }
    }
   
    @Override
    public void windowOpened(WindowEvent event) {
      Frame frame = (Frame) event.getSource();
      Project proj = frame.getProject();

      if (frame == proj.getFrame() && !openProjects.contains(proj)) {
        openProjects.add(proj);
        propertySupport.firePropertyChange(projectListProperty, null, null);
      }
View Full Code Here

    return file;
  }
 
  private static Frame createFrame(Project sourceProject, Project newProject) {
    if (sourceProject != null) {
      Frame frame = sourceProject.getFrame();
      if (frame != null) {
        frame.savePreferences();
      }
    }
    Frame newFrame = new Frame(newProject);
    newProject.setFrame(newFrame);
    return newFrame;
  }
View Full Code Here

  }
 
  public static Project doNew(Project baseProject) {
    LogisimFile file = createNewFile(baseProject);
    Project newProj = new Project(file);
    Frame frame = createFrame(baseProject, newProj);
    frame.setVisible(true);
    frame.getCanvas().requestFocus();
    newProj.getLogisimFile().getLoader().setParent(frame);
    return newProj;
  }
View Full Code Here

          JOptionPane.ERROR_MESSAGE);
      }
      return null;
    }
   
    Frame frame = proj.getFrame();
    if (frame == null) {
      frame = createFrame(baseProject, proj);
    }
    frame.setVisible(true);
    frame.toFront();
    frame.getCanvas().requestFocus();
    proj.getLogisimFile().getLoader().setParent(frame);
    return proj;
  }
View Full Code Here

    proj.setTool(oldTool);
    return ret;
  }

  public static void doQuit() {
    Frame top = Projects.getTopFrame();
    top.savePreferences();
   
    for (Project proj : new ArrayList<Project>(Projects.getOpenProjects())) {
      if (!proj.confirmClose(Strings.get("confirmQuitTitle"))) return;
    }
    System.exit(0);
View Full Code Here

      this.proj = proj;
      this.isStartupScreen = isStartup;
    }
   
    public void run() {
      Frame frame = createFrame(null, proj);
      frame.setVisible(true);
      frame.toFront();
      frame.getCanvas().requestFocus();
      loader.setParent(frame);
      if (isStartupScreen) proj.setStartupScreen(true);
    }
View Full Code Here

TOP

Related Classes of com.cburch.logisim.gui.main.Frame

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.