Revision: 20347
          http://sourceforge.net/p/jmol/code/20347
Author:   hansonr
Date:     2015-02-28 23:10:50 +0000 (Sat, 28 Feb 2015)
Log Message:
-----------
Jmol.___JmolVersion="14.3.12_2015.02.28"

bug fix: late discovery of mmCIF format does not load secondary structure
bug fix: reading PNGJ file saved after load with /dssr or /rna3d annotations 
ignores annotations
bug fix: {*}.find("~d~G:C")  broken (find with bioSMARTS)

note: show image replaced by new command IMAGE

new feature: image             # the current view as an image
new feature: image 300 400     # adjustable size
new feature: image "c:/temp/t.bmp" # image from a file

new feature: image "" close    # close the current view image
new feature: image "c:/temp/t.bmp" close # close image from a file
new feature: image CLOSE       # close all

new feature: image ID ...
 -- id for IMAGE CLOSE;
 -- displayed in title of frame
 -- examples:
  
     image ID "test" 
     image ID "test" 400 500
     image ID "test" "bob.png"
     image ID "test" close

Modified Paths:
--------------
    trunk/Jmol/src/org/jmol/console/ImageDialog.java
    trunk/Jmol/src/org/jmol/scriptext/CmdExt.java
    trunk/Jmol/src/org/jmol/viewer/Jmol.properties
    trunk/Jmol/src/org/jmol/viewer/StatusManager.java
    trunk/Jmol/src/org/jmol/viewer/Viewer.java

Modified: trunk/Jmol/src/org/jmol/console/ImageDialog.java
===================================================================
--- trunk/Jmol/src/org/jmol/console/ImageDialog.java    2015-02-28 19:58:56 UTC 
(rev 20346)
+++ trunk/Jmol/src/org/jmol/console/ImageDialog.java    2015-02-28 23:10:50 UTC 
(rev 20347)
@@ -62,6 +62,7 @@
   protected Viewer vwr;
   protected Canvas canvas;
   private String title;
+
   private Map<String, GenericImageDialog> imageMap;
 
   private JmolAppConsoleInterface console;
@@ -163,12 +164,9 @@
     this.image = (Image) oimage;
     int w = image.getWidth(null);
     int h = image.getHeight(null);
-    setTitle(title.substring(title.lastIndexOf("/") + 1) + " [" + w + " x " + h
-        + "]");
+    setTitle(title + " [" + w + " x " + h + "]");
     Dimension d = new Dimension(w, h);
     canvas.setSize(d);
-    //canvas.setBackground(new Color(55,0,0));
-    //setPreferredSize(d);
     pack();
     repaint();
   }  

Modified: trunk/Jmol/src/org/jmol/scriptext/CmdExt.java
===================================================================
--- trunk/Jmol/src/org/jmol/scriptext/CmdExt.java       2015-02-28 19:58:56 UTC 
(rev 20346)
+++ trunk/Jmol/src/org/jmol/scriptext/CmdExt.java       2015-02-28 23:10:50 UTC 
(rev 20347)
@@ -1889,7 +1889,8 @@
       pt++;
     }
     String fileName = e.optParameterAsString(pt);
-    if (!fileName.equals("close") && (slen == pt || slen == pt + 2)) {
+    boolean isClose = e.optParameterAsString(slen - 
1).equalsIgnoreCase("close");
+    if (!isClose && (slen == pt || slen == pt + 2)) {
       // image
       // image 400 400
       // image id "testing"
@@ -1908,21 +1909,24 @@
       return;
     }
     pt++;
-    boolean isClose = false;
-    if (fileName.equalsIgnoreCase("close")) {
-      // image close
-      // image ID "testing" close
-      // image close "filename"
-      e.checkLength(slen == pt || id != null ? pt : pt + 1);
-      isClose = true;
-      fileName = (slen == pt && id == null ? "closeall" : e
-          .optParameterAsString(pt));
-    } else {
-      e.checkLength(pt);
+    if (isClose) {
+      switch (slen) {
+      case 2:
+        // image close
+        fileName = "closeall";
+        break;
+      case 3: 
+      case 4:
+        // image "filename" close
+        // image ID "testing" close
+        break;
+      default:
+        checkLength(0);
+      }
     }
     if (!chk)
       vwr.fm.loadImage(isClose ? "\1close" : fileName, "\1" + fileName + "\1"
-          + id);
+          + ("".equals(id) || id == null ? null : id));
   }
   
   private void mapProperty() throws ScriptException {

Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties
===================================================================
--- trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2015-02-28 19:58:56 UTC 
(rev 20346)
+++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2015-02-28 23:10:50 UTC 
(rev 20347)
@@ -22,10 +22,14 @@
 
 note: show image replaced by new command IMAGE
 
+new feature: image             # the current view as an image
 new feature: image 300 400     # adjustable size
-new feature: image CLOSE ""              # the model image
-new feature: image CLOSE "c:/temp/t.bmp" # the image for this file
+new feature: image "c:/temp/t.bmp" # image from a file
+
+new feature: image "" close    # close the current view image
+new feature: image "c:/temp/t.bmp" close # close image from a file
 new feature: image CLOSE       # close all
+
 new feature: image ID ...
  -- id for IMAGE CLOSE;
  -- displayed in title of frame

Modified: trunk/Jmol/src/org/jmol/viewer/StatusManager.java
===================================================================
--- trunk/Jmol/src/org/jmol/viewer/StatusManager.java   2015-02-28 19:58:56 UTC 
(rev 20346)
+++ trunk/Jmol/src/org/jmol/viewer/StatusManager.java   2015-02-28 23:10:50 UTC 
(rev 20347)
@@ -355,6 +355,8 @@
    * @param image  or Boolean.TRUE for "close all" or Boolean.FALSE for "close"
    */
   synchronized void showImage(String title, Object image) {
+    String[] a = PT.split(title,  "\1");
+    title = (a.length < 3 || a[2].equals("null") ? 
a[1].substring(a[1].lastIndexOf("/") + 1) : a[2]);
     String sJmol = jmolScriptCallback(CBK.IMAGE);
     if (notifyEnabled(CBK.IMAGE))
       cbl.notifyCallback(CBK.IMAGE, new Object[] { sJmol, title, image });
@@ -370,9 +372,6 @@
     }
     if (imageMap == null)
       imageMap = new Hashtable<String, GenericImageDialog>();
-    title = title.substring(title.indexOf("\1") + 1);
-    if (title.equals("null"))
-      title = "";
     GenericImageDialog d = imageMap.get(title);
     if (Boolean.FALSE.equals(image)) {
       if (d != null)

Modified: trunk/Jmol/src/org/jmol/viewer/Viewer.java
===================================================================
--- trunk/Jmol/src/org/jmol/viewer/Viewer.java  2015-02-28 19:58:56 UTC (rev 
20346)
+++ trunk/Jmol/src/org/jmol/viewer/Viewer.java  2015-02-28 23:10:50 UTC (rev 
20347)
@@ -8007,7 +8007,7 @@
     if (echoName == null) {
       setBackgroundImage((image == null ? null : nameOrError), image);
     } else if (echoName.startsWith("\1")) {
-      sm.showImage(echoName.substring(1), image);
+      sm.showImage(echoName, image);
     } else {
       shm.loadShape(JC.SHAPE_ECHO);
       setShapeProperty(JC.SHAPE_ECHO, "text", nameOrError);

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


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Jmol-commits mailing list
Jmol-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to