Revision: 18428
          http://sourceforge.net/p/jmol/code/18428
Author:   hansonr
Date:     2013-07-04 21:21:15 +0000 (Thu, 04 Jul 2013)
Log Message:
-----------
___JmolVersion="13.1.19_dev_2013.07.04"

new feature: {*}.ms, {*}.cs %[ms] %[cs] magnetic shielding and chemical shift
new feature: label <color red>xxx</color>
new feature: set shift_H_hz xxx, set shift_H_PPM_400 xxx
new feature: getProperty("nmrInfo")

Modified Paths:
--------------
    trunk/Jmol/src/org/jmol/g3d/TextRenderer.java
    trunk/Jmol/src/org/jmol/viewer/Jmol.properties

Modified: trunk/Jmol/src/org/jmol/g3d/TextRenderer.java
===================================================================
--- trunk/Jmol/src/org/jmol/g3d/TextRenderer.java       2013-07-04 20:59:37 UTC 
(rev 18427)
+++ trunk/Jmol/src/org/jmol/g3d/TextRenderer.java       2013-07-04 21:21:15 UTC 
(rev 18428)
@@ -28,6 +28,8 @@
 import java.util.Map;
 
 import org.jmol.api.JmolRendererInterface;
+import org.jmol.util.C;
+import org.jmol.util.ColorUtil;
 import org.jmol.util.JmolFont;
 
 
@@ -83,7 +85,7 @@
     if (text.length() == 0)
       return 0;
     //System.out.println(x + "  " + y + " " + text);
-    if (text.indexOf("<su") >= 0)
+    if (text.indexOf("<su") >= 0 || text.indexOf("<color") >= 0)
       return plotByCharacter(x, y, z, argb, bgargb, text, font3d, g3d, 
jmolRenderer,
           antialias);
     int offset = font3d.getAscent();
@@ -122,8 +124,23 @@
     int len = text.length();
     int suboffset = Math.round(font3d.getHeight() * 0.25f);
     int supoffset = -Math.round(font3d.getHeight() * 0.3f);
+    int argb0 = 0;
     for (int i = 0; i < len; i++) {
       if (text.charAt(i) == '<') {
+        if (i + 5 < len && text.substring(i, i + 6).equals("<color")) {
+          argb0 = argb;
+          int pt = text.indexOf(">", i);
+          if (pt < 0)
+            continue;
+          argb = ColorUtil.getArgbFromString(text.substring(i + 7, pt).trim());
+          i = pt;
+          continue;
+        }
+        if (i + 7 < len && text.substring(i, i + 8).equals("</color>")) {
+          i += 7;
+          argb = argb0;
+          continue;
+        }
         if (i + 4 < len && text.substring(i, i + 5).equals("<sub>")) {
           i += 4;
           y += suboffset;

Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties
===================================================================
--- trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2013-07-04 20:59:37 UTC 
(rev 18427)
+++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2013-07-04 21:21:15 UTC 
(rev 18428)
@@ -11,6 +11,12 @@
 
 ___JmolVersion="13.1.19_dev_2013.07.04"
 
+new feature: {*}.ms, {*}.cs %[ms] %[cs] magnetic shielding and chemical shift
+new feature: label <color red>xxx</color>
+new feature: set shift_H_hz xxx, set shift_H_PPM_400 xxx
+new feature: getProperty("nmrInfo")
+ 
+ 
 code: org.jmol.quantum.NMRCalculation implements 
org.jmol.api.JmolNMRCalculation:
   public float getQuadrupolarConstant(Tensor efg);
   public float getJCouplingHz(Atom a1, Atom a2, String type, Tensor t);

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


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Jmol-commits mailing list
Jmol-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to