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)
{
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;
}
}