public void savePreferences() {
AppPreferences.TICK_FREQUENCY.set(Double.valueOf(proj.getSimulator().getTickFrequency()));
AppPreferences.LAYOUT_SHOW_GRID.setBoolean(layoutZoomModel.getShowGrid());
AppPreferences.LAYOUT_ZOOM.set(Double.valueOf(layoutZoomModel.getZoomFactor()));
if (appearance != null) {
ZoomModel aZoom = appearance.getZoomModel();
AppPreferences.APPEARANCE_SHOW_GRID.setBoolean(aZoom.getShowGrid());
AppPreferences.APPEARANCE_ZOOM.set(Double.valueOf(aZoom.getZoomFactor()));
}
int state = getExtendedState() & ~java.awt.Frame.ICONIFIED;
AppPreferences.WINDOW_STATE.set(Integer.valueOf(state));
Dimension dim = getSize();
AppPreferences.WINDOW_WIDTH.set(Integer.valueOf(dim.width));