import jalview.javascript.json.JSON;
-import java.awt.Color;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.MouseEvent;
public static void streamToFile(InputStream is, File outFile)
throws IOException
{
+ if (isJS() && /**
+ * JSTempFile direct transfer
+ *
+ * @j2sNative outFile.setBytes$O && outFile.setBytes$O(is) &&
+ */
+ true)
+ {
+ return;
+ }
FileOutputStream fio = new FileOutputStream(outFile);
try
{
- if (isJS()
- && /**
- * @j2sNative outFile.setBytes$O && outFile.setBytes$O(is) &&
- */
- true)
- {
- return;
- }
byte[] bb = new byte[32 * 1024];
int l;
while ((l = is.read(bb)) > 0)
*/
}
+ public static void ensureJmol()
+ {
+ loadStaticResource("core/core_jvjmol.z.js", "org.jmol.viewer.Viewer");
+ }
+
public static void ensureRegex()
{
loadStaticResource("core/core_stevesoft.z.js",
}
/**
- * @param c
- */
- public static Color getColorFromName(String name)
- {
- if (name == null)
- {
- return null;
- }
- /**
- * @j2sNative
- *
- * return swingjs.JSUtil.getColorFromName$S(name);
- */
- {
- // or make a static map; or use reflection on the field name
- switch (name.toLowerCase())
- {
- case "black":
- return Color.black;
- case "blue":
- return Color.blue;
- case "cyan":
- return Color.cyan;
- case "darkgray":
- return Color.darkGray;
- case "gray":
- return Color.gray;
- case "green":
- return Color.green;
- case "lightgray":
- return Color.lightGray;
- case "magenta":
- return Color.magenta;
- case "orange":
- return Color.orange;
- case "pink":
- return Color.pink;
- case "red":
- return Color.red;
- case "white":
- return Color.white;
- case "yellow":
- return Color.yellow;
- default:
- return null;
- }
-
- }
- }
-
- /**
* Initialize Java debug logging. A representative sample -- adapt as desired.
*/
public static void startJavaLogging()
}
+
}