From: BobHanson Date: Wed, 3 Jun 2020 20:54:03 +0000 (-0500) Subject: JAL-3664 support for user.home, user.dir, user X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=f16506aebc33ce6829623aa1d1f60ece3f078347;p=jalview.git JAL-3664 support for user.home, user.dir, user --- diff --git a/src/ext/edu/ucsf/rbvi/strucviz2/StructureManager.java b/src/ext/edu/ucsf/rbvi/strucviz2/StructureManager.java index 22c9098..4378457 100644 --- a/src/ext/edu/ucsf/rbvi/strucviz2/StructureManager.java +++ b/src/ext/edu/ucsf/rbvi/strucviz2/StructureManager.java @@ -34,6 +34,7 @@ package ext.edu.ucsf.rbvi.strucviz2; import jalview.bin.Cache; import jalview.gui.Preferences; +import jalview.util.Platform; import java.io.File; import java.io.IOException; @@ -931,7 +932,7 @@ public class StructureManager pathList.add("/usr/local/chimera/bin/chimera"); pathList.add("/usr/local/bin/chimera"); pathList.add("/usr/bin/chimera"); - pathList.add(System.getProperty("user.home") + "/opt/bin/chimera"); + pathList.add(Platform.getUserPath("opt/bin/chimera")); } else if (os.startsWith("Windows")) { diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index bb26c13..a89714a 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -247,10 +247,8 @@ public class Cache implements ApplicationSingletonI /** * Sifts settings */ - public static final String DEFAULT_SIFTS_DOWNLOAD_DIR = System - .getProperty("user.home") + File.separatorChar - + ".sifts_downloads" + File.separatorChar; - + public static final String DEFAULT_SIFTS_DOWNLOAD_DIR = Platform.getUserPath(".sifts_downloads/"); + private final static String DEFAULT_CACHE_THRESHOLD_IN_DAYS = "2"; private final static String DEFAULT_FAIL_SAFE_PID_THRESHOLD = "30"; @@ -258,8 +256,7 @@ public class Cache implements ApplicationSingletonI /** * Identifiers.org download settings */ - private static final String ID_ORG_FILE = System.getProperty("user.home") - + File.separatorChar + ".identifiers.org.ids.json"; + private static final String ID_ORG_FILE = Platform.getUserPath(".identifiers.org.ids.json"); /** * Allowed values are PDB or mmCIF @@ -363,8 +360,7 @@ public class Cache implements ApplicationSingletonI propertiesFile = propsFile; if (propsFile == null && !propsAreReadOnly) { - propertiesFile = System.getProperty("user.home") + File.separatorChar - + ".jalview_properties"; + propertiesFile = Platform.getUserPath(".jalview_properties"); } else { diff --git a/src/jalview/datamodel/features/FeatureAttributes.java b/src/jalview/datamodel/features/FeatureAttributes.java index 1a125c2..655d1eb 100644 --- a/src/jalview/datamodel/features/FeatureAttributes.java +++ b/src/jalview/datamodel/features/FeatureAttributes.java @@ -137,7 +137,7 @@ public class FeatureAttributes implements ApplicationSingletonI * Parse numeric value unless we have previously * seen text data for this attribute type */ - if (type == null || type == Datatype.Number) + if (type == null && couldBeNumber(value) || type == Datatype.Number) { try { @@ -224,6 +224,27 @@ public class FeatureAttributes implements ApplicationSingletonI } /** + * This quick check will save significant time avoiding numerous NumberFormatExceptions. + * + * @param f + * @return + */ + public boolean couldBeNumber(String f) + { + int len = f.length(); + if (len == 0) + return false; + char ch = f.charAt(0); + switch (ch) { + case '.': + case '+': + case '-': + return len > 1; + } + return (ch <= '9' && ch >= '0'); + } + + /** * Answers true if at least one attribute is known for the given feature type, * else false * diff --git a/src/jalview/io/BioJsHTMLOutput.java b/src/jalview/io/BioJsHTMLOutput.java index 9db3df2..5573e0d 100644 --- a/src/jalview/io/BioJsHTMLOutput.java +++ b/src/jalview/io/BioJsHTMLOutput.java @@ -25,6 +25,7 @@ import jalview.gui.OOMWarning; import jalview.json.binding.biojs.BioJSReleasePojo; import jalview.json.binding.biojs.BioJSRepositoryPojo; import jalview.util.MessageManager; +import jalview.util.Platform; import java.io.BufferedInputStream; import java.io.BufferedReader; @@ -44,8 +45,7 @@ public class BioJsHTMLOutput extends HTMLOutput private static TreeMap bioJsMSAVersions; - public static final String DEFAULT_DIR = System.getProperty("user.home") - + File.separatorChar + ".biojs_templates" + File.separatorChar; + public static final String DEFAULT_DIR = Platform.getUserPath(".biojs_templates/"); public static final String BJS_TEMPLATES_LOCAL_DIRECTORY = jalview.bin.Cache .getDefault("biojs_template_directory", DEFAULT_DIR); diff --git a/src/jalview/urls/IdentifiersUrlProvider.java b/src/jalview/urls/IdentifiersUrlProvider.java index 07eb23e..e898438 100644 --- a/src/jalview/urls/IdentifiersUrlProvider.java +++ b/src/jalview/urls/IdentifiersUrlProvider.java @@ -118,11 +118,6 @@ private HashMap readIdentifiers(String idFileName) } } catch (IOException | ParseException e) { - // unnecessary e.printStackTrace(); - // Note how in JavaScript we can grab the first bytes from any file reader. - // Typical report here is "NetworkError" because the file does not exist. - // "https://." is coming from System.getProperty("user.home"), but this could - // be set by the page developer to anything, of course. errorMessage = e.toString(); idData.clear(); } diff --git a/swingjs/SwingJS-site.zip b/swingjs/SwingJS-site.zip index d5e28c1..ea5d1e0 100644 Binary files a/swingjs/SwingJS-site.zip and b/swingjs/SwingJS-site.zip differ diff --git a/swingjs/timestamp b/swingjs/timestamp index 6c92ed6..ae3f683 100644 --- a/swingjs/timestamp +++ b/swingjs/timestamp @@ -1 +1 @@ -20200601093857 +20200603155024 diff --git a/swingjs/ver/3.2.9-j11/SwingJS-site.zip b/swingjs/ver/3.2.9-j11/SwingJS-site.zip index 5563c76..d5e28c1 100644 Binary files a/swingjs/ver/3.2.9-j11/SwingJS-site.zip and b/swingjs/ver/3.2.9-j11/SwingJS-site.zip differ diff --git a/swingjs/ver/3.2.9-j11/timestamp b/swingjs/ver/3.2.9-j11/timestamp index 71722a8..763c0a1 100644 --- a/swingjs/ver/3.2.9-j11/timestamp +++ b/swingjs/ver/3.2.9-j11/timestamp @@ -1 +1 @@ -20200528154316 +20200603075530 diff --git a/swingjs/ver/3.2.9/SwingJS-site.zip b/swingjs/ver/3.2.9/SwingJS-site.zip index d5e28c1..ea5d1e0 100644 Binary files a/swingjs/ver/3.2.9/SwingJS-site.zip and b/swingjs/ver/3.2.9/SwingJS-site.zip differ diff --git a/swingjs/ver/3.2.9/timestamp b/swingjs/ver/3.2.9/timestamp index 6c92ed6..ae3f683 100644 --- a/swingjs/ver/3.2.9/timestamp +++ b/swingjs/ver/3.2.9/timestamp @@ -1 +1 @@ -20200601093857 +20200603155024 diff --git a/utils/jalviewjs/_j2sclasslist.txt b/utils/jalviewjs/_j2sclasslist.txt index e35111e..e60fe60 100644 --- a/utils/jalviewjs/_j2sclasslist.txt +++ b/utils/jalviewjs/_j2sclasslist.txt @@ -321,7 +321,7 @@ sun/font/FontDesignMetrics.js sun/swing/DefaultLookup.js sun/swing/SwingLazyValue.js sun/text/resources/FormatData.js -sun/text/resources/FormatData_en.js +sun/text/resources/en/FormatData_en.js sun/util/resources/LocaleData.js swingjs/a2s/A2SContainer.js swingjs/a2s/A2SEvent.js diff --git a/utils/jalviewjs/classlists/_j2sclasslist_jmol.txt b/utils/jalviewjs/classlists/_j2sclasslist_jmol.txt new file mode 100644 index 0000000..bae181d --- /dev/null +++ b/utils/jalviewjs/classlists/_j2sclasslist_jmol.txt @@ -0,0 +1,232 @@ +jalview/ext/jmol/JalviewJmolBinding.js +jalview/ext/jmol/JmolCommands.js +jalview/ext/jmol/JmolParser.js +jalview/gui/AppJmol.js +jalview/gui/AppJmolBinding.js +jalview/gui/StructureViewerBase.js +jalview/io/StructureFile.js +jalview/jbgui/GStructureViewer.js +jalview/renderer/seqfeatures/FeatureColourFinder.js +jalview/structure/StructureListener.js +jalview/structure/StructureMapping.js +jalview/structure/StructureMappingcommandSet.js +jalview/structures/models/AAStructureBindingModel.js +jalview/structures/models/SequenceStructureBindingModel.js +jalview/util/CaseInsensitiveString.js +jalview/util/HttpUtils.js +jalview/util/MapList.js +jalview/ws/dbsources/EbiFileRetrievedProxy.js +jalview/ws/dbsources/Pdb.js +jalview/ws/seqfetcher/DbSourceProxy.js +jalview/ws/seqfetcher/DbSourceProxyImpl.js +java/awt/font/TextAttribute.js +java/awt/image/ImageProducer.js +java/awt/image/PixelGrabber.js +java/io/BufferedWriter.js +java/io/FilterOutputStream.js +java/io/OutputStream.js +java/io/OutputStreamWriter.js +java/io/PrintStream.js +java/io/StringWriter.js +java/io/Writer.js +javajs/api/BytePoster.js +javajs/api/GenericOutputChannel.js +javajs/util/A4.js +javajs/util/BS.js +javajs/util/CU.js +javajs/util/DF.js +javajs/util/LimitedLineReader.js +javajs/util/M3.js +javajs/util/M34.js +javajs/util/M4.js +javajs/util/Measure.js +javajs/util/OC.js +javajs/util/P3.js +javajs/util/P3i.js +javajs/util/P4.js +javajs/util/T3.js +javajs/util/T3i.js +javajs/util/T4.js +javajs/util/V3.js +mc_view/Atom.js +mc_view/Bond.js +mc_view/PDBChain.js +mc_view/Residue.js +org/jmol/adapter/readers/pdb/PdbReader.js +org/jmol/adapter/smarter/Atom.js +org/jmol/adapter/smarter/AtomIterator.js +org/jmol/adapter/smarter/AtomSetCollection.js +org/jmol/adapter/smarter/AtomSetCollectionReader.js +org/jmol/adapter/smarter/AtomSetObject.js +org/jmol/adapter/smarter/Bond.js +org/jmol/adapter/smarter/BondIterator.js +org/jmol/adapter/smarter/Resolver.js +org/jmol/adapter/smarter/SmarterJmolAdapter.js +org/jmol/adapter/smarter/Structure.js +org/jmol/api/AtomIndexIterator.js +org/jmol/api/EventManager.js +org/jmol/api/GenericFileInterface.js +org/jmol/api/GenericMouseInterface.js +org/jmol/api/GenericPlatform.js +org/jmol/api/Interface.js +org/jmol/api/JmolAdapter.js +org/jmol/api/JmolAdapterAtomIterator.js +org/jmol/api/JmolAdapterBondIterator.js +org/jmol/api/JmolCallbackListener.js +org/jmol/api/JmolGraphicsInterface.js +org/jmol/api/JmolPropertyManager.js +org/jmol/api/JmolRendererInterface.js +org/jmol/api/JmolRepaintManager.js +org/jmol/api/JmolScriptEvaluator.js +org/jmol/api/JmolScriptFunction.js +org/jmol/api/JmolScriptManager.js +org/jmol/api/JmolSelectionListener.js +org/jmol/api/JmolStatusListener.js +org/jmol/api/JmolViewer.js +org/jmol/api/PlatformViewer.js +org/jmol/api/Translator.js +org/jmol/atomdata/AtomDataServer.js +org/jmol/atomdata/RadiusData.js +org/jmol/awt/AwtFile.js +org/jmol/awt/AwtFont.js +org/jmol/awt/Display.js +org/jmol/awt/Image.js +org/jmol/awt/Mouse.js +org/jmol/awt/Platform.js +org/jmol/bspt/Bspf.js +org/jmol/bspt/Bspt.js +org/jmol/bspt/CubeIterator.js +org/jmol/bspt/Element.js +org/jmol/bspt/Leaf.js +org/jmol/bspt/Node.js +org/jmol/c/CBK.js +org/jmol/c/FIL.js +org/jmol/c/PAL.js +org/jmol/c/STER.js +org/jmol/c/STR.js +org/jmol/c/VDW.js +org/jmol/g3d/CylinderRenderer.js +org/jmol/g3d/G3DRenderer.js +org/jmol/g3d/Graphics3D.js +org/jmol/g3d/HermiteRenderer.js +org/jmol/g3d/LineRenderer.js +org/jmol/g3d/Pixelator.js +org/jmol/g3d/Platform3D.js +org/jmol/g3d/PrecisionRenderer.js +org/jmol/g3d/SphereRenderer.js +org/jmol/g3d/TextRenderer.js +org/jmol/g3d/TextString.js +org/jmol/g3d/TriangleRenderer.js +org/jmol/i18n/GT.js +org/jmol/i18n/Language.js +org/jmol/i18n/Resource.js +org/jmol/io/FileReader.js +org/jmol/modelset/Atom.js +org/jmol/modelset/AtomCollection.js +org/jmol/modelset/AtomIteratorWithinModel.js +org/jmol/modelset/Bond.js +org/jmol/modelset/BondCollection.js +org/jmol/modelset/BondIterator.js +org/jmol/modelset/BondIteratorSelected.js +org/jmol/modelset/Chain.js +org/jmol/modelset/Group.js +org/jmol/modelset/Model.js +org/jmol/modelset/ModelLoader.js +org/jmol/modelset/ModelSet.js +org/jmol/modelset/Orientation.js +org/jmol/modelset/Structure.js +org/jmol/modelsetbio/AlphaMonomer.js +org/jmol/modelsetbio/AlphaPolymer.js +org/jmol/modelsetbio/BioModel.js +org/jmol/modelsetbio/BioModelSet.js +org/jmol/modelsetbio/BioPolymer.js +org/jmol/modelsetbio/BioResolver.js +org/jmol/modelsetbio/Helix.js +org/jmol/modelsetbio/Monomer.js +org/jmol/modelsetbio/ProteinStructure.js +org/jmol/render/BallsRenderer.js +org/jmol/render/FontLineShapeRenderer.js +org/jmol/render/FrankRenderer.js +org/jmol/render/RepaintManager.js +org/jmol/render/ShapeRenderer.js +org/jmol/render/SticksRenderer.js +org/jmol/renderbio/BackboneRenderer.js +org/jmol/renderbio/BioShapeRenderer.js +org/jmol/renderbio/CartoonRenderer.js +org/jmol/renderbio/RocketsRenderer.js +org/jmol/renderbio/StrandsRenderer.js +org/jmol/script/ContextToken.js +org/jmol/script/SV.js +org/jmol/script/ScriptCompiler.js +org/jmol/script/ScriptContext.js +org/jmol/script/ScriptError.js +org/jmol/script/ScriptEval.js +org/jmol/script/ScriptExpr.js +org/jmol/script/ScriptFlowContext.js +org/jmol/script/ScriptFunction.js +org/jmol/script/ScriptManager.js +org/jmol/script/ScriptMathProcessor.js +org/jmol/script/ScriptParam.js +org/jmol/script/ScriptTokenParser.js +org/jmol/script/T.js +org/jmol/scriptext/MathExt.js +org/jmol/shape/AtomShape.js +org/jmol/shape/Balls.js +org/jmol/shape/Frank.js +org/jmol/shape/Mesh.js +org/jmol/shape/Shape.js +org/jmol/shape/Sticks.js +org/jmol/shapebio/Backbone.js +org/jmol/shapebio/BioShape.js +org/jmol/shapebio/BioShapeCollection.js +org/jmol/shapebio/Cartoon.js +org/jmol/shapebio/Rockets.js +org/jmol/thread/HoverWatcherThread.js +org/jmol/thread/JmolThread.js +org/jmol/util/BSUtil.js +org/jmol/util/BoxInfo.js +org/jmol/util/C.js +org/jmol/util/ColorEncoder.js +org/jmol/util/CommandHistory.js +org/jmol/util/DefaultLogger.js +org/jmol/util/Edge.js +org/jmol/util/Elements.js +org/jmol/util/Escape.js +org/jmol/util/GData.js +org/jmol/util/Geodesic.js +org/jmol/util/Int2IntHash.js +org/jmol/util/Int2IntHashEntry.js +org/jmol/util/Logger.js +org/jmol/util/LoggerInterface.js +org/jmol/util/MeshSurface.js +org/jmol/util/Node.js +org/jmol/util/Normix.js +org/jmol/util/Point3fi.js +org/jmol/util/Rectangle.js +org/jmol/util/Rgb16.js +org/jmol/util/Shader.js +org/jmol/util/SimpleEdge.js +org/jmol/util/SimpleNode.js +org/jmol/util/TempArray.js +org/jmol/viewer/ActionManager.js +org/jmol/viewer/AnimationManager.js +org/jmol/viewer/ColorManager.js +org/jmol/viewer/FileManager.js +org/jmol/viewer/Gesture.js +org/jmol/viewer/GlobalSettings.js +org/jmol/viewer/JC.js +org/jmol/viewer/ModelManager.js +org/jmol/viewer/MotionPoint.js +org/jmol/viewer/MouseState.js +org/jmol/viewer/PropertyManager.js +org/jmol/viewer/SelectionManager.js +org/jmol/viewer/ShapeManager.js +org/jmol/viewer/StateManager.js +org/jmol/viewer/StatusManager.js +org/jmol/viewer/TransformManager.js +org/jmol/viewer/Viewer.js +org/jmol/viewer/binding/Binding.js +org/jmol/viewer/binding/JmolBinding.js +sun/awt/image/OffScreenImageSource.js +sun/font/AttributeValues.js +sun/font/EAttribute.js \ No newline at end of file