component config refactoring, localization fixes
[debian/openrocket] / src / net / sf / openrocket / util / Prefs.java
index 16e338c4a7692597505dc76287a800d986d0d4a1..dfe05a1d4a3f864e75f6ba2f55552a1c9ce76ef8 100644 (file)
@@ -38,8 +38,8 @@ import net.sf.openrocket.rocketcomponent.RecoveryDevice;
 import net.sf.openrocket.rocketcomponent.Rocket;
 import net.sf.openrocket.rocketcomponent.RocketComponent;
 import net.sf.openrocket.simulation.FlightDataType;
-import net.sf.openrocket.simulation.GUISimulationConditions;
 import net.sf.openrocket.simulation.RK4SimulationStepper;
+import net.sf.openrocket.simulation.SimulationOptions;
 import net.sf.openrocket.startup.Application;
 import net.sf.openrocket.unit.UnitGroup;
 
@@ -715,11 +715,22 @@ public class Prefs {
                return new Dimension(x, y);
        }
        
+       
+       public static boolean isWindowMaximized(Class<?> c) {
+               String pref = PREFNODE.node("windows").get("size." + c.getCanonicalName(), null);
+               return "max".equals(pref);
+       }
+       
        public static void setWindowSize(Class<?> c, Dimension d) {
                PREFNODE.node("windows").put("size." + c.getCanonicalName(), "" + d.width + "," + d.height);
                storeVersion();
        }
        
+       public static void setWindowMaximized(Class<?> c) {
+               PREFNODE.node("windows").put("size." + c.getCanonicalName(), "max");
+               storeVersion();
+       }
+       
        
        ////  Printing
        
@@ -758,7 +769,7 @@ public class Prefs {
        
        public static Simulation getBackgroundSimulation(Rocket rocket) {
                Simulation s = new Simulation(rocket);
-               GUISimulationConditions cond = s.getConditions();
+               SimulationOptions cond = s.getOptions();
                
                cond.setTimeStep(RK4SimulationStepper.RECOMMENDED_TIME_STEP * 2);
                cond.setWindSpeedAverage(1.0);