Revision: 20515
          http://sourceforge.net/p/jmol/code/20515
Author:   hansonr
Date:     2015-05-24 05:37:36 +0000 (Sun, 24 May 2015)
Log Message:
-----------
PROGRESS
========
5/23/2015 BH

- fix for java.util.Random.nextInt(bits)

- adds loadimage.htm and jumbledimage.htm 

- Q: What sets the "south" button to be the full width?

Modified Paths:
--------------
    trunk/Jmol/srcjs/java/util/Arrays.js
    trunk/Jmol/srcjs/java/util/Random.js

Added Paths:
-----------
    trunk/Jmol/srcjs/java/net/UnknownServiceException.java

Added: trunk/Jmol/srcjs/java/net/UnknownServiceException.java
===================================================================
--- trunk/Jmol/srcjs/java/net/UnknownServiceException.java                      
        (rev 0)
+++ trunk/Jmol/srcjs/java/net/UnknownServiceException.java      2015-05-24 
05:37:36 UTC (rev 20515)
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 1995, 1997, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.net;
+
+import java.io.IOException;
+
+/**
+ * Thrown to indicate that an unknown service exception has
+ * occurred. Either the MIME type returned by a URL connection does
+ * not make sense, or the application is attempting to write to a
+ * read-only URL connection.
+ *
+ * @author  unascribed
+ * @since   JDK1.0
+ */
+public class UnknownServiceException extends IOException {
+    /**
+     * Constructs a new <code>UnknownServiceException</code> with no
+     * detail message.
+     */
+    public UnknownServiceException() {
+    }
+
+    /**
+     * Constructs a new <code>UnknownServiceException</code> with the
+     * specified detail message.
+     *
+     * @param   msg   the detail message.
+     */
+    public UnknownServiceException(String msg) {
+        super(msg);
+    }
+}


Property changes on: trunk/Jmol/srcjs/java/net/UnknownServiceException.java
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/Jmol/srcjs/java/util/Arrays.js
===================================================================
--- trunk/Jmol/srcjs/java/util/Arrays.js        2015-05-24 00:42:05 UTC (rev 
20514)
+++ trunk/Jmol/srcjs/java/util/Arrays.js        2015-05-24 05:37:36 UTC (rev 
20515)
@@ -1,8 +1,23 @@
 // BH adjusted to have only one sort method.
+// BH -- added Java 6  copyOfRange
 
 
Clazz.load(["java.util.AbstractList","$.RandomAccess"],"java.util.Arrays",["java.lang.ArrayIndexOutOfBoundsException","$.IllegalArgumentException","$.NullPointerException"],function(){
 c$=Clazz.declareType(java.util,"Arrays");
 
+c$.copyOfRange = Clazz.defineMethod (c$, "copyOfRange", 
+function (original, from, to) {
+to = Math.min(original.length, to);
+var newLength = to - from;
+if (newLength < 0) throw  new IllegalArgumentException (from + " > " + to);
+if (original.slice)
+  return original.slice(from, to);
+  // MSIE and Chrome do not have Int32Array.slice()
+var c = Clazz.newIntArray(newLength, 0);
+for (var i = 0; i < newLength; i++)
+  c[i] = original[from++];
+return c;  
+}, "~A,~N,~N");
+
 c$.sort=Clazz.overrideMethod(c$,"sort",
 function(a,c,d,e){
   switch (arguments.length) {

Modified: trunk/Jmol/srcjs/java/util/Random.js
===================================================================
--- trunk/Jmol/srcjs/java/util/Random.js        2015-05-24 00:42:05 UTC (rev 
20514)
+++ trunk/Jmol/srcjs/java/util/Random.js        2015-05-24 05:37:36 UTC (rev 
20515)
@@ -61,6 +61,10 @@
 Clazz.defineMethod(c$,"nextInt",
 function(n){
 if(n>0){
+n = Math.min(n, 31);
+return Math.floor((2 << (n - 1)) * Math.random())
+
+/*
 if((n&-n)==n){
 return((n*this.next(31))>>31);
 }var bits;
@@ -69,8 +73,13 @@
 bits=this.next(31);
 val=bits%n;
 }while(bits-val+(n-1)<0);
+
+
 return val;
-}throw new IllegalArgumentException();
+
+*/
+}
+throw new IllegalArgumentException();
 },"~N");
 Clazz.defineMethod(c$,"nextLong",
 function(){

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


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Jmol-commits mailing list
Jmol-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to