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);
}
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);
}
Aggregations