Search in sources :

Example 6 with Frame

use of com.cburch.logisim.gui.main.Frame in project logisim-evolution by reds-heig.

the class ProjectActions method doQuit.

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);
}
Also used : Frame(com.cburch.logisim.gui.main.Frame) ArrayList(java.util.ArrayList)

Example 7 with Frame

use of com.cburch.logisim.gui.main.Frame in project logisim-evolution by reds-heig.

the class Projects method windowCreated.

static void windowCreated(Project proj, Frame oldFrame, Frame frame) {
    if (oldFrame != null) {
        projectRemoved(proj, oldFrame, myListener);
    }
    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) {
        Dimension sz = frame.getToolkit().getScreenSize();
        int x = Math.min(lowest.x + 20, sz.width - 200);
        int y = Math.min(lowest.y + 20, sz.height - 200);
        if (x < 0) {
            x = 0;
        }
        if (y < 0) {
            y = 0;
        }
        frame.setLocation(x, y);
    }
    if (frame.isVisible() && !openProjects.contains(proj)) {
        openProjects.add(proj);
        propertySupport.firePropertyChange(projectListProperty, null, null);
    }
    frame.addWindowListener(myListener);
}
Also used : Frame(com.cburch.logisim.gui.main.Frame) Point(java.awt.Point) Dimension(java.awt.Dimension) Point(java.awt.Point)

Aggregations

Frame (com.cburch.logisim.gui.main.Frame)7 LogisimFile (com.cburch.logisim.file.LogisimFile)2 OptionsFrame (com.cburch.logisim.gui.opts.OptionsFrame)2 LoadFailedException (com.cburch.logisim.file.LoadFailedException)1 LoadedLibrary (com.cburch.logisim.file.LoadedLibrary)1 Loader (com.cburch.logisim.file.Loader)1 LogFrame (com.cburch.logisim.gui.log.LogFrame)1 PreferencesFrame (com.cburch.logisim.gui.prefs.PreferencesFrame)1 TestFrame (com.cburch.logisim.gui.test.TestFrame)1 Project (com.cburch.logisim.proj.Project)1 Library (com.cburch.logisim.tools.Library)1 ChronoFrame (com.hepia.logisim.chronogui.ChronoFrame)1 Dimension (java.awt.Dimension)1 Point (java.awt.Point)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1