From: hansonr Date: Sun, 19 May 2019 03:35:43 +0000 (-0500) Subject: Jalview-JS/JAL-3253-applet Creating X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=0c648e74175ca878f88f369e886726ab22bc153b;p=jalview.git Jalview-JS/JAL-3253-applet Creating site/swingjs/j2s/com/stevesoft/core.js Applying a simple trick to use a custom core file. 1) In buildcore.xml: 2) In com/stevesoft, add a line that loads j2s/core/core_stevesoft.z.js static { /** * @j2sNative * * swingjs.JSUtil.loadStaticResource$S("core/core_stevesoft.z.js"); */ } --- diff --git a/buildcore.xml b/buildcore.xml index 3c21f43..8f7fea6 100644 --- a/buildcore.xml +++ b/buildcore.xml @@ -34,6 +34,21 @@ --> + + + + + + + + + + + + + + + Building core file '${core.name}' - warnings are OK; "does not exist" is trouble diff --git a/src/com/stevesoft/pat/Regex.java b/src/com/stevesoft/pat/Regex.java index c00ddad..7b5214c 100755 --- a/src/com/stevesoft/pat/Regex.java +++ b/src/com/stevesoft/pat/Regex.java @@ -16,9 +16,11 @@ import java.util.Hashtable; import com.stevesoft.pat.wrap.StringWrap; + /** Matches a Unicode punctuation character. */ class UnicodePunct extends UniValidator { + @Override public int validate(StringLike s, int from, int to) { return from < s.length() && Prop.isPunct(s.charAt(from)) ? to : -1; @@ -28,6 +30,7 @@ class UnicodePunct extends UniValidator /** Matches a Unicode white space character. */ class UnicodeWhite extends UniValidator { + @Override public int validate(StringLike s, int from, int to) { return from < s.length() && Prop.isWhite(s.charAt(from)) ? to : -1; @@ -39,6 +42,7 @@ class UnicodeWhite extends UniValidator */ class NUnicodePunct extends UniValidator { + @Override public int validate(StringLike s, int from, int to) { return from < s.length() && !Prop.isPunct(s.charAt(from)) ? to : -1; @@ -50,6 +54,7 @@ class NUnicodePunct extends UniValidator */ class NUnicodeWhite extends UniValidator { + @Override public int validate(StringLike s, int from, int to) { return from < s.length() && !Prop.isWhite(s.charAt(from)) ? to : -1; @@ -59,6 +64,7 @@ class NUnicodeWhite extends UniValidator /** Matches a Unicode word character: an alphanumeric or underscore. */ class UnicodeW extends UniValidator { + @Override public int validate(StringLike s, int from, int to) { if (from >= s.length()) @@ -74,6 +80,7 @@ class UnicodeW extends UniValidator /** Matches a character that is not a Unicode alphanumeric or underscore. */ class NUnicodeW extends UniValidator { + @Override public int validate(StringLike s, int from, int to) { if (from >= s.length()) @@ -89,6 +96,7 @@ class NUnicodeW extends UniValidator /** Matches a Unicode decimal digit. */ class UnicodeDigit extends UniValidator { + @Override public int validate(StringLike s, int from, int to) { return from < s.length() && Prop.isDecimalDigit(s.charAt(from)) ? to @@ -99,6 +107,7 @@ class UnicodeDigit extends UniValidator /** Matches a character that is not a Unicode digit. */ class NUnicodeDigit extends UniValidator { + @Override public int validate(StringLike s, int from, int to) { return from < s.length() && !Prop.isDecimalDigit(s.charAt(from)) ? to @@ -109,6 +118,7 @@ class NUnicodeDigit extends UniValidator /** Matches a Unicode math character. */ class UnicodeMath extends UniValidator { + @Override public int validate(StringLike s, int from, int to) { return from < s.length() && Prop.isMath(s.charAt(from)) ? to : -1; @@ -118,6 +128,7 @@ class UnicodeMath extends UniValidator /** Matches a non-math Unicode character. */ class NUnicodeMath extends UniValidator { + @Override public int validate(StringLike s, int from, int to) { return from < s.length() && !Prop.isMath(s.charAt(from)) ? to : -1; @@ -127,6 +138,7 @@ class NUnicodeMath extends UniValidator /** Matches a Unicode currency symbol. */ class UnicodeCurrency extends UniValidator { + @Override public int validate(StringLike s, int from, int to) { return from < s.length() && Prop.isCurrency(s.charAt(from)) ? to : -1; @@ -136,6 +148,7 @@ class UnicodeCurrency extends UniValidator /** Matches a non-currency symbol Unicode character. */ class NUnicodeCurrency extends UniValidator { + @Override public int validate(StringLike s, int from, int to) { return from < s.length() && !Prop.isCurrency(s.charAt(from)) ? to : -1; @@ -145,6 +158,7 @@ class NUnicodeCurrency extends UniValidator /** Matches a Unicode alphabetic character. */ class UnicodeAlpha extends UniValidator { + @Override public int validate(StringLike s, int from, int to) { return from < s.length() && Prop.isAlphabetic(s.charAt(from)) ? to : -1; @@ -154,6 +168,7 @@ class UnicodeAlpha extends UniValidator /** Matches a non-alphabetic Unicode character. */ class NUnicodeAlpha extends UniValidator { + @Override public int validate(StringLike s, int from, int to) { return from < s.length() && !Prop.isAlphabetic(s.charAt(from)) ? to @@ -164,6 +179,7 @@ class NUnicodeAlpha extends UniValidator /** Matches an upper case Unicode character. */ class UnicodeUpper extends UniValidator { + @Override public int validate(StringLike s, int from, int to) { return from < s.length() && isUpper(s.charAt(from)) ? to : -1; @@ -178,6 +194,7 @@ class UnicodeUpper extends UniValidator /** Matches an upper case Unicode character. */ class UnicodeLower extends UniValidator { + @Override public int validate(StringLike s, int from, int to) { return from < s.length() && isLower(s.charAt(from)) ? to : -1; @@ -290,6 +307,16 @@ class UnicodeLower extends UniValidator */ public class Regex extends RegRes implements FilenameFilter { + + static + { + /** + * @j2sNative + * + * swingjs.JSUtil.loadStaticResource$S("core/core_stevesoft.z.js"); + */ + } + /** * BackRefOffset gives the identity number of the first pattern. Version 1.0 * used zero, version 1.1 uses 1 to be more compatible with perl. @@ -599,7 +626,7 @@ public class Regex extends RegRes implements FilenameFilter /** Essentially clones the Regex object */ public Regex(Regex r) { - super((RegRes) r); + super(r); dontMatchInQuotes = r.dontMatchInQuotes; esc = r.esc; ignoreCase = r.ignoreCase; @@ -674,6 +701,7 @@ public class Regex extends RegRes implements FilenameFilter * patterns are equal as well as the most recent match. If a Regex is compare * with a RegRes, only the result of the most recent match is compared. */ + @Override public boolean equals(Object o) { if (o instanceof Regex) @@ -694,6 +722,7 @@ public class Regex extends RegRes implements FilenameFilter } /** A clone by any other name would smell as sweet. */ + @Override public Object clone() { return new Regex(this); @@ -1077,7 +1106,7 @@ public class Regex extends RegRes implements FilenameFilter { try { - return (Regex) getClass().newInstance(); + return getClass().newInstance(); } catch (InstantiationException ie) { return null; @@ -1641,7 +1670,7 @@ public class Regex extends RegRes implements FilenameFilter { if (p instanceof Any && p.next == null) { - return (Pattern) new DotMulti(lo, hi); + return new DotMulti(lo, hi); } return RegOpt.safe4fm(p) ? (Pattern) new FastMulti(lo, hi, p) : (Pattern) new Multi(lo, hi, p); @@ -1801,6 +1830,7 @@ public class Regex extends RegRes implements FilenameFilter * representations. Also be prepared to see some strange output if your * characters are not printable. */ + @Override public String toString() { if (false && thePattern == null) @@ -1901,6 +1931,7 @@ public class Regex extends RegRes implements FilenameFilter * * @see com.stevesoft.pat.FileRegex */ + @Override public boolean accept(File dir, String s) { return search(s); diff --git a/swingjs/SwingJS-site.zip b/swingjs/SwingJS-site.zip index 4db1b9f..eaeed6d 100644 Binary files a/swingjs/SwingJS-site.zip and b/swingjs/SwingJS-site.zip differ diff --git a/swingjs/_j2sclasslist.txt b/swingjs/_j2sclasslist.txt index d05ef27..486ecb3 100644 --- a/swingjs/_j2sclasslist.txt +++ b/swingjs/_j2sclasslist.txt @@ -172,6 +172,7 @@ javajs/util/JSThread.js javajs/util/Lst.js javajs/util/PT.js javajs/util/SB.js +javax/net/ssl/HttpsUrlConnection.js javax/swing/AbstractAction.js javax/swing/AbstractButton.js javax/swing/AbstractListModel.js diff --git a/swingjs/timestamp b/swingjs/timestamp index 50500d5..06df058 100644 --- a/swingjs/timestamp +++ b/swingjs/timestamp @@ -1 +1 @@ -20190518172259 +20190518175634 diff --git a/swingjs/ver/3.2.4/SwingJS-site.zip b/swingjs/ver/3.2.4/SwingJS-site.zip index 4db1b9f..eaeed6d 100644 Binary files a/swingjs/ver/3.2.4/SwingJS-site.zip and b/swingjs/ver/3.2.4/SwingJS-site.zip differ diff --git a/swingjs/ver/3.2.4/_j2sclasslist.txt b/swingjs/ver/3.2.4/_j2sclasslist.txt index d05ef27..486ecb3 100644 --- a/swingjs/ver/3.2.4/_j2sclasslist.txt +++ b/swingjs/ver/3.2.4/_j2sclasslist.txt @@ -172,6 +172,7 @@ javajs/util/JSThread.js javajs/util/Lst.js javajs/util/PT.js javajs/util/SB.js +javax/net/ssl/HttpsUrlConnection.js javax/swing/AbstractAction.js javax/swing/AbstractButton.js javax/swing/AbstractListModel.js diff --git a/swingjs/ver/3.2.4/timestamp b/swingjs/ver/3.2.4/timestamp index 50500d5..06df058 100644 --- a/swingjs/ver/3.2.4/timestamp +++ b/swingjs/ver/3.2.4/timestamp @@ -1 +1 @@ -20190518172259 +20190518175634