git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4ac85f1
)
JAL-3368 JAL-2365 JAL-2642
author
hansonr
<hansonr@STO24954W.ad.stolaf.edu>
Tue, 15 Oct 2019 10:14:14 +0000
(06:14 -0400)
committer
hansonr
<hansonr@STO24954W.ad.stolaf.edu>
Tue, 15 Oct 2019 10:14:14 +0000
(06:14 -0400)
src/jalview/util/Platform.java
patch
|
blob
|
history
diff --git
a/src/jalview/util/Platform.java
b/src/jalview/util/Platform.java
index
ffecebb
..
68e6bb4
100644
(file)
--- a/
src/jalview/util/Platform.java
+++ b/
src/jalview/util/Platform.java
@@
-715,8
+715,10
@@
public class Platform
return Regex.perlCode(code);
}
return Regex.perlCode(code);
}
- /**
- * Convert a color name to a Color object. SwingJS can do this natively.
+ /**
+ * Convert a color name to a Color object.
+ *
+ *
* @param c
*/
public static Color getColorFromName(String name)
* @param c
*/
public static Color getColorFromName(String name)
@@
-725,44
+727,38
@@
public class Platform
{
return null;
}
{
return null;
}
- /**
- * @j2sNative
- *
- * return swingjs.JSUtil.getColorFromName$S(name);
- */
+ // SwingJS can do this natively. Not implemented here because that would
+ // introduce capabilities into JalviewJS that are not in Jalview/Java.
+ switch (name.toLowerCase())
{
{
- // 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;
- }
+ 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;
}
}
}
}