JAL-3210 Improvements to eclipse detection. New src tree and SwingJS updated from...
[jalview.git] / src / jalview / gui / Preferences.java
index dbb5aec..b1206a2 100755 (executable)
@@ -84,67 +84,6 @@ import ext.edu.ucsf.rbvi.strucviz2.StructureManager;
 @SuppressWarnings("serial")
 public class Preferences extends GPreferences
 {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
   public static final String ADD_SS_ANN = "ADD_SS_ANN";
 
   public static final String ADD_TEMPFACT_ANN = "ADD_TEMPFACT_ANN";
@@ -261,6 +200,8 @@ public class Preferences extends GPreferences
 
   public static final String STRUCTURE_DISPLAY = "STRUCTURE_DISPLAY";
 
+  public static final String STRUCTURE_DIMENSIONS = "STRUCTURE_DIMENSIONS";
+
   public static final String UNIPROT_DOMAIN = "UNIPROT_DOMAIN";
 
   public static final String USE_FULL_SO = "USE_FULL_SO";
@@ -302,6 +243,8 @@ public class Preferences extends GPreferences
 
   public static final String SHOW_FULLSCREEN = "SHOW_FULLSCREEN";
 
+  public static final Dimension DEFAULT_STRUCTURE_DIMENSIONS = new Dimension(
+          600, 600);
 
   static
   {
@@ -363,11 +306,13 @@ public class Preferences extends GPreferences
       wsPrefs = new WsPreferences();
       wsTab.add(wsPrefs, BorderLayout.CENTER);
     }
-    int width = 500, height = 450;
+    int width = 500, height = 510; // BH 2019.07.12 added 60 to height
+    // (structure panel was too small anyway, and I added a default dimension
+    // for Jmol
     if (Platform.isAMacAndNotJS())
     {
       width = 570;
-      height = 480;
+      height = 540; // BH 2019.07.12 added 30
     }
 
     Desktop.addInternalFrame(frame,
@@ -512,6 +457,10 @@ public class Preferences extends GPreferences
     addTempFactor.setEnabled(structSelected);
     structViewer.setSelectedItem(
             Cache.getDefault(STRUCTURE_DISPLAY, ViewerType.JMOL.name()));
+    Dimension d = Cache.getDefaultDim(STRUCTURE_DIMENSIONS,
+            DEFAULT_STRUCTURE_DIMENSIONS);
+    String s = d.width + "," + d.height;
+    structureDimensions.setText(s);
     chimeraPath.setText(Cache.getDefault(CHIMERA_PATH, ""));
     chimeraPath.addActionListener(new ActionListener()
     {
@@ -872,6 +821,8 @@ public class Preferences extends GPreferences
             Boolean.toString(structFromPdb.isSelected()));
     Cache.setPropertyNoSave(STRUCTURE_DISPLAY,
             structViewer.getSelectedItem().toString());
+    Cache.setPropertyNoSave(STRUCTURE_DIMENSIONS,
+            structureDimensions.getText()); // BH 2019.07.12
     Cache.setOrRemove(CHIMERA_PATH, chimeraPath.getText());
     Cache.setPropertyNoSave(MAP_WITH_SIFTS,
             Boolean.toString(siftsMapping.isSelected()));