Revision: 18284
          http://sourceforge.net/p/jmol/code/18284
Author:   hansonr
Date:     2013-06-06 03:11:07 +0000 (Thu, 06 Jun 2013)
Log Message:
-----------
___version=13.0.16_dev_2013.06.04

bug fix: antialiasing or resizing stray lines problem solved (introduced in 
11.0, 08/2006!)

Modified Paths:
--------------
    branches/v13_0/Jmol/src/org/jmol/g3d/Graphics3D.java
    branches/v13_0/Jmol/src/org/jmol/g3d/Line3D.java
    branches/v13_0/Jmol/src/org/jmol/viewer/Jmol.properties
    branches/v13_0/Jmol/src/org/openscience/jmol/app/jmolpanel/JmolPanel.java

Modified: branches/v13_0/Jmol/src/org/jmol/g3d/Graphics3D.java
===================================================================
--- branches/v13_0/Jmol/src/org/jmol/g3d/Graphics3D.java        2013-06-06 
02:53:58 UTC (rev 18283)
+++ branches/v13_0/Jmol/src/org/jmol/g3d/Graphics3D.java        2013-06-06 
03:11:07 UTC (rev 18284)
@@ -353,6 +353,7 @@
     pbufT = null;
     zbufT = null;
     platform.releaseBuffers();
+    line3d.clearLineCache();
   }
   
   public boolean setPass2(boolean antialiasTranslucent) {

Modified: branches/v13_0/Jmol/src/org/jmol/g3d/Line3D.java
===================================================================
--- branches/v13_0/Jmol/src/org/jmol/g3d/Line3D.java    2013-06-06 02:53:58 UTC 
(rev 18283)
+++ branches/v13_0/Jmol/src/org/jmol/g3d/Line3D.java    2013-06-06 03:11:07 UTC 
(rev 18284)
@@ -70,9 +70,9 @@
     slope = (dx != 0 ?  dy / dx : dy >= 0 ? Float.MAX_VALUE  : 
-Float.MAX_VALUE);
     lineTypeX = (slope <=1 && slope >= -1);
     //lineDirection = (slope < 0 ? -1 : 1);
+    nBits = (lineTypeX ? g3d.width : g3d.height);
     if (getCachedLine())
       return;
-    nBits = (lineTypeX ? g3d.width : g3d.height);
     lineBits = new BitSet(nBits);
     dy = Math.abs(dy);
     dx = Math.abs(dx);
@@ -95,18 +95,24 @@
     //if (--test > 0 || ((100-test) % 100 == 0)) System.out.println(test+" 
"+dx + " " + dy + " " + lineBits);
   }
   
+  void clearLineCache() {
+    lineCache.clear();
+    nCached = 0;
+  }
+
   Map<Float, BitSet> lineCache = new Hashtable<Float, BitSet>();
   Float slopeKey;
+
   boolean getCachedLine() {
     slopeKey = new Float(slope);
     if (!lineCache.containsKey(slopeKey))
       return false;
     lineBits = lineCache.get(slopeKey);
-    nFound++;
-    if (nFound == 1000000)
-      if (Logger.debugging) {
+    if (Logger.debugging) {
+      nFound++;
+      if (nFound == 1000000)
         Logger.debug("nCached/nFound lines: " + nCached + " " + nFound);
-      }
+    }
     return true;
   }
   

Modified: branches/v13_0/Jmol/src/org/jmol/viewer/Jmol.properties
===================================================================
--- branches/v13_0/Jmol/src/org/jmol/viewer/Jmol.properties     2013-06-06 
02:53:58 UTC (rev 18283)
+++ branches/v13_0/Jmol/src/org/jmol/viewer/Jmol.properties     2013-06-06 
03:11:07 UTC (rev 18284)
@@ -11,6 +11,7 @@
 
 ___version=13.0.16_dev_2013.06.04
 
+bug fix: antialiasing or resizing stray lines problem solved (introduced in 
11.0, 08/2006!)
 bug fix: "display add" by itself should not do anything
 bug fix: Gaussian reader not splitting MO set by model
 bug fix: polyhedra not saved in state

Modified: 
branches/v13_0/Jmol/src/org/openscience/jmol/app/jmolpanel/JmolPanel.java
===================================================================
--- branches/v13_0/Jmol/src/org/openscience/jmol/app/jmolpanel/JmolPanel.java   
2013-06-06 02:53:58 UTC (rev 18283)
+++ branches/v13_0/Jmol/src/org/openscience/jmol/app/jmolpanel/JmolPanel.java   
2013-06-06 03:11:07 UTC (rev 18284)
@@ -578,36 +578,20 @@
     }
   }
 
-  protected boolean doClose(boolean isExit) {
-    if ((isExit || numWindows == 1) && JOptionPane.showConfirmDialog(frame, 
GT._("Exit Jmol?"),
+  protected boolean doClose(boolean saveSize) {
+    if (numWindows == 1 && viewer.getAtomCount() > 0 && 
JOptionPane.showConfirmDialog(frame, GT._("Exit Jmol?"),
         "Exit", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) != 
JOptionPane.YES_OPTION)
       return false;
-    if (isExit)
-      System.exit(0);
-    dispose(frame);
+    dispose(frame, saveSize);
     return true;
   }
 
-  private void dispose(JFrame f) {
+  void dispose(JFrame f, boolean saveSize) {
     // Save window positions and status in the history
     if (webExport != null)
       WebExport.cleanUp();
-    if (historyFile != null) {
-      if (frame != null) {
-        jmolApp.border.x = frame.getWidth() - display.dimSize.width;
-        jmolApp.border.y = frame.getHeight() - display.dimSize.height;
-        historyFile.addWindowInfo("Jmol", frame, jmolApp.border);
-      }
-      //historyFile.addWindowInfo(CONSOLE_WINDOW_NAME, consoleframe);
-      AppConsole console = (AppConsole) 
viewer.getProperty("DATA_API","getAppConsole", null);
-      if (console != null && console.jcd != null)
-        historyFile.addWindowInfo(SCRIPT_WINDOW_NAME, console.jcd, null);
-      Component c = (Component) 
viewer.getProperty("DATA_API","getScriptEditor", null);
-      if (c != null)
-        historyFile.addWindowInfo(EDITOR_WINDOW_NAME, c, null);
-      if (historyFile.getProperty("clearHistory", "false").equals("true"))
-        historyFile.clear();
-    }
+    if (saveSize)
+      saveWindowSizes();
     if (service != null) {
       service.close();
       service = null;
@@ -633,6 +617,27 @@
     }
   }
 
+  void saveWindowSizes() {
+    if (historyFile == null)
+      return;
+    if (frame != null) {
+      jmolApp.border.x = frame.getWidth() - display.dimSize.width;
+      jmolApp.border.y = frame.getHeight() - display.dimSize.height;
+      historyFile.addWindowInfo("Jmol", frame, jmolApp.border);
+    }
+    //historyFile.addWindowInfo(CONSOLE_WINDOW_NAME, consoleframe);
+    AppConsole console = (AppConsole) viewer.getProperty("DATA_API",
+        "getAppConsole", null);
+    if (console != null && console.jcd != null)
+      historyFile.addWindowInfo(SCRIPT_WINDOW_NAME, console.jcd, null);
+    Component c = (Component) viewer.getProperty("DATA_API", "getScriptEditor",
+        null);
+    if (c != null)
+      historyFile.addWindowInfo(EDITOR_WINDOW_NAME, c, null);
+    if (historyFile.getProperty("clearHistory", "false").equals("true"))
+      historyFile.clear();
+  }
+
 //  protected void setupNewFrame(JmolViewer viewer) {
 //    String state = viewer.getStateInfo();
 //    JFrame newFrame = new JFrame();
@@ -1233,9 +1238,6 @@
     }
   }
   
-  /**
-   * Really lame implementation of an exit command
-   */
   class ExitAction extends AbstractAction {
 
     ExitAction() {
@@ -1243,7 +1245,8 @@
     }
 
     public void actionPerformed(ActionEvent e) {
-      doClose(true);
+      saveWindowSizes();
+      System.exit(0);
     }
   }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
Jmol-commits mailing list
Jmol-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to