Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
(35) |
May
(67) |
Jun
(2) |
Jul
|
Aug
(12) |
Sep
(54) |
Oct
(91) |
Nov
(168) |
Dec
(100) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(209) |
Feb
(158) |
Mar
(19) |
Apr
(24) |
May
(184) |
Jun
(134) |
Jul
(54) |
Aug
(399) |
Sep
(218) |
Oct
(271) |
Nov
(207) |
Dec
(126) |
2004 |
Jan
(138) |
Feb
(249) |
Mar
(420) |
Apr
(100) |
May
(335) |
Jun
(143) |
Jul
(91) |
Aug
(129) |
Sep
(98) |
Oct
(170) |
Nov
(352) |
Dec
(355) |
2005 |
Jan
(256) |
Feb
(158) |
Mar
(163) |
Apr
(38) |
May
(217) |
Jun
(98) |
Jul
(213) |
Aug
(169) |
Sep
(260) |
Oct
(94) |
Nov
(87) |
Dec
(153) |
2006 |
Jan
(35) |
Feb
(176) |
Mar
(308) |
Apr
(168) |
May
(152) |
Jun
(67) |
Jul
(99) |
Aug
(90) |
Sep
(313) |
Oct
(266) |
Nov
(282) |
Dec
(189) |
2007 |
Jan
(118) |
Feb
(309) |
Mar
(289) |
Apr
(209) |
May
(268) |
Jun
(103) |
Jul
(91) |
Aug
(143) |
Sep
(146) |
Oct
(205) |
Nov
(157) |
Dec
(172) |
2008 |
Jan
(53) |
Feb
(87) |
Mar
(188) |
Apr
(99) |
May
(101) |
Jun
(91) |
Jul
(117) |
Aug
(158) |
Sep
(100) |
Oct
(221) |
Nov
(184) |
Dec
(127) |
2009 |
Jan
(64) |
Feb
(93) |
Mar
(60) |
Apr
(74) |
May
(76) |
Jun
(218) |
Jul
(130) |
Aug
(115) |
Sep
(142) |
Oct
(76) |
Nov
(160) |
Dec
(181) |
2010 |
Jan
(229) |
Feb
(231) |
Mar
(184) |
Apr
(243) |
May
(229) |
Jun
(204) |
Jul
(293) |
Aug
(370) |
Sep
(160) |
Oct
(164) |
Nov
(163) |
Dec
(161) |
2011 |
Jan
(145) |
Feb
(147) |
Mar
(117) |
Apr
(43) |
May
(102) |
Jun
(152) |
Jul
(204) |
Aug
(98) |
Sep
(162) |
Oct
(216) |
Nov
(107) |
Dec
(98) |
2012 |
Jan
(53) |
Feb
(131) |
Mar
(105) |
Apr
(109) |
May
(155) |
Jun
(88) |
Jul
(82) |
Aug
(69) |
Sep
(96) |
Oct
(83) |
Nov
(71) |
Dec
(50) |
2013 |
Jan
(51) |
Feb
(53) |
Mar
(81) |
Apr
(143) |
May
(75) |
Jun
(103) |
Jul
(126) |
Aug
(104) |
Sep
(73) |
Oct
(136) |
Nov
(148) |
Dec
(90) |
2014 |
Jan
(82) |
Feb
(146) |
Mar
(132) |
Apr
(125) |
May
(72) |
Jun
(84) |
Jul
(35) |
Aug
(68) |
Sep
(49) |
Oct
(54) |
Nov
(58) |
Dec
(15) |
2015 |
Jan
(76) |
Feb
(82) |
Mar
(74) |
Apr
(49) |
May
(48) |
Jun
(48) |
Jul
(57) |
Aug
(66) |
Sep
(45) |
Oct
(52) |
Nov
(18) |
Dec
(33) |
2016 |
Jan
(26) |
Feb
(27) |
Mar
(60) |
Apr
(30) |
May
(51) |
Jun
(25) |
Jul
(12) |
Aug
(47) |
Sep
(11) |
Oct
(26) |
Nov
(9) |
Dec
(27) |
2017 |
Jan
(44) |
Feb
(34) |
Mar
(22) |
Apr
(108) |
May
(42) |
Jun
(17) |
Jul
(38) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1
(10) |
2
(1) |
3
(2) |
4
(6) |
5
(6) |
6
|
7
|
8
(1) |
9
(3) |
10
|
11
|
12
|
13
|
14
(2) |
15
(18) |
16
(5) |
17
(9) |
18
(11) |
19
(2) |
20
(2) |
21
(15) |
22
(23) |
23
(52) |
24
(3) |
25
(12) |
26
(20) |
27
(23) |
28
(9) |
29
(14) |
|
|
|
|
|
|
From: Michael T Howard <michaelthoward@us...> - 2004-02-29 21:36:15
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/script In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27777/src/org/openscience/jmol/viewer/script Modified Files: Compiler.java Eval.java Log Message: many color changes Index: Compiler.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/script/Compiler.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- Compiler.java 28 Feb 2004 23:09:30 -0000 1.26 +++ Compiler.java 29 Feb 2004 21:17:54 -0000 1.27 @@ -211,7 +211,8 @@ ltoken.removeAllElements(); break; } - if ((token.tok & Token.setparam) == 0) + if ((token.tok & Token.setparam) == 0 && + token.tok != Token.identifier) return cannotSet(ident); } break; Index: Eval.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/script/Eval.java,v retrieving revision 1.99 retrieving revision 1.100 diff -u -r1.99 -r1.100 --- Eval.java 29 Feb 2004 11:04:53 -0000 1.99 +++ Eval.java 29 Feb 2004 21:17:54 -0000 1.100 @@ -2186,6 +2186,9 @@ case Token.write: notImplemented(1); break; + case Token.identifier: + viewer.setBooleanProperty((String)statement[1].value, getSetBoolean()); + break; case Token.background: case Token.stereo: setspecialShouldNotBeHere(); |
From: Michael T Howard <michaelthoward@us...> - 2004-02-29 21:36:15
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/datamodel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27777/src/org/openscience/jmol/viewer/datamodel Modified Files: Atom.java Log Message: many color changes Index: Atom.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/datamodel/Atom.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- Atom.java 25 Feb 2004 19:11:27 -0000 1.28 +++ Atom.java 29 Feb 2004 21:17:53 -0000 1.29 @@ -281,8 +281,10 @@ public int getAtomno() { if (pdbAtom != null) return pdbAtom.getAtomSerial(); - return atomIndex + - (frame.modelType == JmolConstants.MODEL_TYPE_XYZ ? 0 : 1); + if (frame.modelType == JmolConstants.MODEL_TYPE_XYZ && + frame.viewer.getZeroBasedXyzRasmol()) + return atomIndex; + return atomIndex + 1; } public Point3f getPoint3f() { |
From: Michael T Howard <michaelthoward@us...> - 2004-02-29 21:36:15
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/managers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27777/src/org/openscience/jmol/viewer/managers Modified Files: ColorManager.java StyleManager.java TransformManager.java Log Message: many color changes Index: ColorManager.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/managers/ColorManager.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- ColorManager.java 29 Feb 2004 11:04:52 -0000 1.30 +++ ColorManager.java 29 Feb 2004 21:17:53 -0000 1.31 @@ -54,6 +54,10 @@ System.out.println("setting color scheme to:" + colorScheme); if (colorScheme.equals("jmol")) { argbsCpk = JmolConstants.argbsCpk; + viewer.setColorBackground("snow"); + viewer.setColorMeasurement(Color.black); + viewer.setColorLabel(Color.black); + viewer.setColorDots(null); } else if (colorScheme.equals("rasmol")) { int argb = JmolConstants.argbsCpkRasmol[0] | 0xFF000000; argbsCpk = new int[JmolConstants.argbsCpk.length]; @@ -66,6 +70,10 @@ argbsCpk[atomNo] = argb; g3d.changeColixArgb((short)atomNo, argb); } + viewer.setColorBackground(Color.black); + viewer.setColorMeasurement(Color.white); + viewer.setColorLabel(null); + viewer.setColorDots(null); } else { System.out.println("unrecognized color scheme"); return; @@ -198,15 +206,15 @@ colixBackground = g3d.getColix(colorBackground); } - public Color colorAxes = Color.gray; - public short colixAxes = Graphics3D.GRAY; + public Color colorAxes = new Color(128, 128, 0); + public short colixAxes = Graphics3D.OLIVE; public void setColorAxes(Color color) { colorAxes = color; colixAxes = g3d.getColix(color); } - public Color colorAxesText = Color.gray; - public short colixAxesText = Graphics3D.GRAY; + public Color colorAxesText = colorAxes; + public short colixAxesText = Graphics3D.OLIVE; public void setColorAxesText(Color color) { colorAxesText = color; colixAxesText = g3d.getColix(color); Index: StyleManager.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/managers/StyleManager.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- StyleManager.java 26 Feb 2004 21:35:22 -0000 1.19 +++ StyleManager.java 29 Feb 2004 21:17:53 -0000 1.20 @@ -107,6 +107,11 @@ this.wireframeRotation = wireframeRotation; } + public boolean zeroBasedXyzRasmol = false; + public void setZeroBasedXyzRasmol(boolean zeroBasedXyzRasmol) { + this.zeroBasedXyzRasmol = zeroBasedXyzRasmol; + } + void setCommonDefaults() { viewer.zoomToPercent(100); viewer.setPercentVdwAtom(20); @@ -114,23 +119,23 @@ viewer.setPerspectiveDepth(true); viewer.setBondTolerance(0.45f); viewer.setMinBondDistance(0.40f); - viewer.setMarBond((short)100); + viewer.setMarBond((short)150); } public void setJmolDefaults() { setCommonDefaults(); - viewer.setColorBackground(Color.white); - viewer.setColorMeasurement(Color.black); - viewer.setColorLabel(Color.black); + viewer.setColorScheme("jmol"); + viewer.setAxesOrientationRasmol(false); + setZeroBasedXyzRasmol(false); } public void setRasmolDefaults() { setCommonDefaults(); - viewer.setColorBackground(Color.black); - viewer.setColorMeasurement(Color.white); + viewer.setColorScheme("rasmol"); + viewer.setAxesOrientationRasmol(true); + setZeroBasedXyzRasmol(true); viewer.setPercentVdwAtom(0); viewer.setMarBondDefault((short)1); - viewer.setColorLabel(null); } public boolean showFrank; Index: TransformManager.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/managers/TransformManager.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- TransformManager.java 22 Feb 2004 01:11:38 -0000 1.22 +++ TransformManager.java 29 Feb 2004 21:17:53 -0000 1.23 @@ -100,13 +100,13 @@ matrixRotate.mul(matrixTemp, matrixRotate); } public synchronized void rotateByY(float angleRadians) { - if (orientationRasMolChime) + if (axesOrientationRasmol) angleRadians = -angleRadians; matrixTemp.rotY(angleRadians); matrixRotate.mul(matrixTemp, matrixRotate); } public synchronized void rotateByZ(float angleRadians) { - if (orientationRasMolChime) + if (axesOrientationRasmol) angleRadians = -angleRadians; matrixTemp.rotZ(angleRadians); matrixRotate.mul(matrixTemp, matrixRotate); @@ -436,9 +436,14 @@ private final Vector3f vectorTemp = new Vector3f(); - public boolean orientationRasMolChime = true; - public void setOrientationRasMolChime(boolean orientationRasMolChime) { - this.orientationRasMolChime = orientationRasMolChime; + /**************************************************************** + * RasMol has the +Y axis pointing down + * And rotations about the y axis are left-handed + * setting this flag makes Jmol mimic this behavior + ****************************************************************/ + public boolean axesOrientationRasmol = false; + public void setAxesOrientationRasmol(boolean axesOrientationRasmol) { + this.axesOrientationRasmol = axesOrientationRasmol; } public void calcTransformMatrices() { @@ -483,7 +488,7 @@ cameraDistanceFloat / scalePixelsPerAngstrom; matrixTemp.setZero(); matrixTemp.setTranslation(vectorTemp); - if (orientationRasMolChime) + if (axesOrientationRasmol) matrixTransform.add(matrixTemp); // make all z positive else matrixTransform.sub(matrixTemp); // make all z negative @@ -491,7 +496,7 @@ // now scale to screen coordinates matrixTemp.setZero(); matrixTemp.set(scalePixelsPerAngstrom); - if (! orientationRasMolChime) { + if (! axesOrientationRasmol) { // negate y (for screen) and z (for zbuf) matrixTemp.m11 = matrixTemp.m22 = -scalePixelsPerAngstrom; } |
From: Michael T Howard <michaelthoward@us...> - 2004-02-29 21:36:14
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/app In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27777/src/org/openscience/jmol/app Modified Files: PreferencesDialog.java Log Message: many color changes Index: PreferencesDialog.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/app/PreferencesDialog.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- PreferencesDialog.java 21 Feb 2004 15:45:44 -0000 1.22 +++ PreferencesDialog.java 29 Feb 2004 21:17:52 -0000 1.23 @@ -84,7 +84,7 @@ private boolean perspectiveDepth; private boolean showAxes; private boolean showBoundingBox; - private boolean orientationRasMolChime; + private boolean axesOrientationRasmol; private boolean isLabelAtomColor; private boolean isBondAtomColor; private Color colorBackground; @@ -114,7 +114,7 @@ private JCheckBox cH, cV, cM; private JCheckBox cbWireframeRotation, cbPerspectiveDepth; private JCheckBox cbShowAxes, cbShowBoundingBox; - private JCheckBox cbOrientationRasMolChime; + private JCheckBox cbAxesOrientationRasmol; private JCheckBox cbIsLabelAtomColor, cbIsBondAtomColor; private Properties originalSystemProperties; private Properties jmolDefaultProperties; @@ -133,15 +133,15 @@ "perspectiveDepth", "true", "showAxes", "false", "showBoundingBox", "false", - "orientationRasMolChime", "true", + "axesOrientationRasmol", "false", "styleLabel", "0", "percentVdwAtom", "20", "autoBond", "true", - "marBond", "100", + "marBond", "150", "minBondDistance", "0.40", "bondTolerance", "0.45", "colorSelection", "16762880", - "colorBackground", "16777215", + "colorBackground", "16775930", // snow "isLabelAtomColor", "false", "colorText", "0", "isBondAtomColor", "true", @@ -160,6 +160,7 @@ "colorMeasurement", "16777215", "percentVdwAtom", "0", "marBond", "1", + "axesOrientationRasmol", "true", }; private JmolViewer viewer; @@ -290,9 +291,9 @@ cbShowBoundingBox.addItemListener(checkBoxListener); fooPanel.add(cbShowBoundingBox); - cbOrientationRasMolChime = - guimap.newJCheckBox("Prefs.orientationRasMolChime", - viewer.getOrientationRasMolChime()); + cbAxesOrientationRasmol = + guimap.newJCheckBox("Prefs.axesOrientationRasmol", + viewer.getAxesOrientationRasmol()); constraints = new GridBagConstraints(); constraints.gridwidth = GridBagConstraints.REMAINDER; @@ -304,8 +305,8 @@ axesPanel.setBorder(new TitledBorder("")); axesPanel.setLayout(new GridLayout(1, 1)); - cbOrientationRasMolChime.addItemListener(checkBoxListener); - axesPanel.add(cbOrientationRasMolChime); + cbAxesOrientationRasmol.addItemListener(checkBoxListener); + axesPanel.add(cbAxesOrientationRasmol); constraints = new GridBagConstraints(); constraints.gridwidth = GridBagConstraints.REMAINDER; @@ -985,7 +986,7 @@ cbShowBoundingBox.setSelected(viewer. getShapeShow(JmolConstants.SHAPE_BBCAGE)); - cbOrientationRasMolChime.setSelected(viewer.getOrientationRasMolChime()); + cbAxesOrientationRasmol.setSelected(viewer.getAxesOrientationRasmol()); // Atom panel controls: aLabel.setSelectedIndex(viewer.getStyleLabel()); @@ -1065,7 +1066,7 @@ perspectiveDepth = Boolean.getBoolean("perspectiveDepth"); showAxes = Boolean.getBoolean("showAxes"); showBoundingBox = Boolean.getBoolean("showBoundingBox"); - orientationRasMolChime = Boolean.getBoolean("orientationRasMolChime"); + axesOrientationRasmol = Boolean.getBoolean("axesOrientationRasmol"); colorBackground = Color.getColor("colorBackground"); colorSelection = Color.getColor("colorSelection"); isLabelAtomColor = Boolean.getBoolean("isLabelAtomColor"); @@ -1110,7 +1111,7 @@ viewer.setPerspectiveDepth(perspectiveDepth); viewer.setShapeShow(JmolConstants.SHAPE_AXES, showAxes); viewer.setShapeShow(JmolConstants.SHAPE_BBCAGE, showBoundingBox); - viewer.setOrientationRasMolChime(orientationRasMolChime); + viewer.setAxesOrientationRasmol(axesOrientationRasmol); Vibrate.setAmplitudeScale(VibrateAmplitudeScale); Vibrate.setVectorScale(VibrateVectorScale); Vibrate.setNumberFrames(VibrationFrames); @@ -1188,10 +1189,10 @@ showBoundingBox = isSelected; viewer.setShapeShow(JmolConstants.SHAPE_BBCAGE, isSelected); currentProperties.put("showBoundingBox", strSelected); - } else if (key.equals("Prefs.orientationRasMolChime")) { - orientationRasMolChime = isSelected; - viewer.setOrientationRasMolChime(isSelected); - currentProperties.put("orientationRasMolChime", strSelected); + } else if (key.equals("Prefs.axesOrientationRasmol")) { + axesOrientationRasmol = isSelected; + viewer.setAxesOrientationRasmol(isSelected); + currentProperties.put("axesOrientationRasmol", strSelected); } } }; |
From: Michael T Howard <michaelthoward@us...> - 2004-02-29 21:36:14
|
Update of /cvsroot/jmol/Jmol/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27777/src Modified Files: JmolApplet.java Log Message: many color changes Index: JmolApplet.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/JmolApplet.java,v retrieving revision 1.64 retrieving revision 1.65 diff -u -r1.64 -r1.65 --- JmolApplet.java 28 Feb 2004 23:09:30 -0000 1.64 +++ JmolApplet.java 29 Feb 2004 21:17:52 -0000 1.65 @@ -65,33 +65,6 @@ "Jmol Applet. Part of the OpenScience project. " + "See jmol.sourceforge.net for more information"; - /* - - private static String[][] paramInfo = { - { "bgcolor", "color", - "Background color to HTML color name or #RRGGBB" }, - { "style", "SHADED, QUICKDRAW or WIREFRAME", - "One of the three possible rendering styles" }, - { "label", "NONE, SYMBOL or NUMBER", - "Select style for atom labels" }, - { "atomTypes", "url", "URL of custom Atomtypes file, " + - "or leave blank to use the default atom definitions" }, - { "wireframeRotation", "ON or OFF", - "Switch to wireframe during rotations for better performance" }, - { "load", "url", - "URL of the chemical data" }, - { "loadInline", "fileformat", - "Inline representation of chemical data" }, - { "script", "string", - "Inline RasMol/Chime script commands " + - "separated by newlines or semicolons" } - }; - public String[][] getParameterInfo() { - return paramInfo; - } - - */ - public void init() { htmlName = getParameter("name"); String ms = getParameter("mayscript"); @@ -205,7 +178,7 @@ } else { viewer.setJmolDefaults(); viewer.setPercentVdwAtom(getValue("vdwPercent", 20)); - viewer.setColorBackground(getValue("bgcolor", "white")); + viewer.setColorBackground(getValue("bgcolor", "snow")); viewer.setWireframeRotation(getBooleanValue("wireframeRotation", false)); viewer.setPerspectiveDepth(getBooleanValue("perspectiveDepth", true)); |
From: Michael T Howard <michaelthoward@us...> - 2004-02-29 21:36:14
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/Properties In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27777/src/org/openscience/jmol/Properties Modified Files: Jmol.properties Log Message: many color changes Index: Jmol.properties =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/Properties/Jmol.properties,v retrieving revision 1.77 retrieving revision 1.78 diff -u -r1.77 -r1.78 --- Jmol.properties 29 Jan 2004 22:20:56 -0000 1.77 +++ Jmol.properties 29 Feb 2004 21:17:52 -0000 1.78 @@ -341,7 +341,7 @@ Prefs.perspectiveDepthLabel=Perspective Depth Prefs.showAxesLabel=Axes Prefs.showBoundingBoxLabel=Bounding Box -Prefs.orientationRasMolChimeLabel=\ +Prefs.axesOrientationRasmolLabel=\ RasMol/Chime compatible axes orientation/rotations Prefs.atomColoringLabel=Default atom coloring: Prefs.aSChoice=Shaded |
From: Michael T Howard <michaelthoward@us...> - 2004-02-29 21:36:14
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27777/src/org/openscience/jmol/viewer Modified Files: JmolConstants.java JmolViewer.java Log Message: many color changes Index: JmolConstants.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/JmolConstants.java,v retrieving revision 1.49 retrieving revision 1.50 diff -u -r1.49 -r1.50 --- JmolConstants.java 29 Feb 2004 11:04:49 -0000 1.49 +++ JmolConstants.java 29 Feb 2004 21:17:53 -0000 1.50 @@ -1386,7 +1386,7 @@ "dimgray", // 696969 "dodgerblue", // 1E90FF "firebrick", // B22222 - "floralwhite", // FFFAF0 + "floralwhite", // FFFAF0 16775920 "forestgreen", // 228B22 "fuchsia", // FF00FF "gainsboro", // DCDCDC @@ -1469,7 +1469,7 @@ "skyblue", // 87CEEB "slateblue", // 6A5ACD "slategray", // 708090 - "snow", // FFFAFA + "snow", // FFFAFA 16775930 "springgreen", // 00FF7F "steelblue", // 4682B4 "tan", // D2B48C @@ -1479,7 +1479,7 @@ "turquoise", // 40E0D0 "violet", // EE82EE "wheat", // F5DEB3 - "white", // FFFFFF + "white", // FFFFFF 16777215 "whitesmoke", // F5F5F5 "yellow", // FFFF00 "yellowgreen", // 9ACD32 Index: JmolViewer.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/JmolViewer.java,v retrieving revision 1.126 retrieving revision 1.127 diff -u -r1.126 -r1.127 --- JmolViewer.java 29 Feb 2004 11:04:50 -0000 1.126 +++ JmolViewer.java 29 Feb 2004 21:17:53 -0000 1.127 @@ -400,12 +400,12 @@ refresh(); } - public void setOrientationRasMolChime(boolean orientationRasMolChime) { - transformManager.setOrientationRasMolChime(orientationRasMolChime); + public void setAxesOrientationRasmol(boolean axesOrientationRasmol) { + transformManager.setAxesOrientationRasmol(axesOrientationRasmol); refresh(); } - public boolean getOrientationRasMolChime() { - return transformManager.orientationRasMolChime; + public boolean getAxesOrientationRasmol() { + return transformManager.axesOrientationRasmol; } public boolean getPerspectiveDepth() { @@ -1521,35 +1521,37 @@ ****************************************************************/ public boolean getBooleanProperty(String key) { - if (key.equals("wireframeRotation")) + if (key.equalsIgnoreCase("wireframeRotation")) return getWireframeRotation(); - if (key.equals("perspectiveDepth")) + if (key.equalsIgnoreCase("perspectiveDepth")) return getPerspectiveDepth(); - if (key.equals("showAxes")) + if (key.equalsIgnoreCase("showAxes")) return getShapeShow(JmolConstants.SHAPE_AXES); - if (key.equals("showBoundingBox")) + if (key.equalsIgnoreCase("showBoundingBox")) return getShapeShow(JmolConstants.SHAPE_BBCAGE); - if (key.equals("showUnitcell")) + if (key.equalsIgnoreCase("showUnitcell")) return getShapeShow(JmolConstants.SHAPE_UCCAGE); - if (key.equals("showHydrogens")) + if (key.equalsIgnoreCase("showHydrogens")) return getShowHydrogens(); - if (key.equals("showVectors")) + if (key.equalsIgnoreCase("showVectors")) return getShowVectors(); - if (key.equals("showMeasurements")) + if (key.equalsIgnoreCase("showMeasurements")) return getShowMeasurements(); - if (key.equals("showSelections")) + if (key.equalsIgnoreCase("showSelections")) return getSelectionHaloEnabled(); - if (key.equals("oversampleAlways")) + if (key.equalsIgnoreCase("oversampleAlways")) return getOversampleAlwaysEnabled(); - if (key.equals("oversampleStopped")) + if (key.equalsIgnoreCase("oversampleStopped")) return getOversampleStoppedEnabled(); - if (key.equals("orientationRasMolChime")) - return getOrientationRasMolChime(); - if (key.equals("testFlag1")) + if (key.equalsIgnoreCase("axesOrientationRasmol")) + return getAxesOrientationRasmol(); + if (key.equalsIgnoreCase("zeroBasedXyzRasmol")) + return getZeroBasedXyzRasmol(); + if (key.equalsIgnoreCase("testFlag1")) return getTestFlag1(); - if (key.equals("testFlag2")) + if (key.equalsIgnoreCase("testFlag2")) return getTestFlag2(); - if (key.equals("testFlag3")) + if (key.equalsIgnoreCase("testFlag3")) return getTestFlag3(); System.out.println("viewer.getBooleanProperty(" + key + ") - unrecognized"); @@ -1558,37 +1560,39 @@ public void setBooleanProperty(String key, boolean value) { refresh(); - if (key.equals("wireframeRotation")) + if (key.equalsIgnoreCase("wireframeRotation")) { setWireframeRotation(value); return; } - if (key.equals("perspectiveDepth")) + if (key.equalsIgnoreCase("perspectiveDepth")) { setPerspectiveDepth(value); return; } - if (key.equals("showAxes")) + if (key.equalsIgnoreCase("showAxes")) { setShapeShow(JmolConstants.SHAPE_AXES, value); return; } - if (key.equals("showBoundingBox")) + if (key.equalsIgnoreCase("showBoundingBox")) { setShapeShow(JmolConstants.SHAPE_BBCAGE, value); return; } - if (key.equals("showUnitcell")) + if (key.equalsIgnoreCase("showUnitcell")) { setShapeShow(JmolConstants.SHAPE_UCCAGE, value); return; } - if (key.equals("showHydrogens")) + if (key.equalsIgnoreCase("showHydrogens")) { setShowHydrogens(value); return; } - if (key.equals("showHydrogens")) + if (key.equalsIgnoreCase("showHydrogens")) { setShowHydrogens(value); return; } - if (key.equals("showVectors")) + if (key.equalsIgnoreCase("showVectors")) { setShowVectors(value); return; } - if (key.equals("showMeasurements")) + if (key.equalsIgnoreCase("showMeasurements")) { setShowMeasurements(value); return; } - if (key.equals("showSelections")) + if (key.equalsIgnoreCase("showSelections")) { setSelectionHaloEnabled(value); return; } - if (key.equals("oversampleAlways")) + if (key.equalsIgnoreCase("oversampleAlways")) { setOversampleAlwaysEnabled(value); return; } - if (key.equals("oversampleStopped")) + if (key.equalsIgnoreCase("oversampleStopped")) { setOversampleStoppedEnabled(value); return; } - if (key.equals("orientationRasMolChime")) - { setOrientationRasMolChime(value); return; } - if (key.equals("testFlag1")) + if (key.equalsIgnoreCase("axesOrientationRasmol")) + { setAxesOrientationRasmol(value); return; } + if (key.equalsIgnoreCase("zeroBasedXyzRasmol")) + { setZeroBasedXyzRasmol(value); return; } + if (key.equalsIgnoreCase("testFlag1")) { setTestFlag1(value); return; } - if (key.equals("testFlag2")) + if (key.equalsIgnoreCase("testFlag2")) { setTestFlag2(value); return; } - if (key.equals("testFlag3")) + if (key.equalsIgnoreCase("testFlag3")) { setTestFlag3(value); return; } System.out.println("viewer.setBooleanProperty(" + key + "," + value + ") - unrecognized"); @@ -1805,6 +1809,15 @@ } + public void setZeroBasedXyzRasmol(boolean zeroBasedXyzRasmol) { + styleManager.setZeroBasedXyzRasmol(zeroBasedXyzRasmol); + } + + public boolean getZeroBasedXyzRasmol() { + return styleManager.zeroBasedXyzRasmol; + } + + /**************************************************************** * delegated to LabelManager ****************************************************************/ |
From: Michael T Howard <michaelthoward@us...> - 2004-02-29 21:36:14
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27777/src/org/openscience/jmol/ui Modified Files: JmolPopupStructure.properties JmolPopupSwing.java JmolPopupWords.properties Log Message: many color changes Index: JmolPopupStructure.properties =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/ui/JmolPopupStructure.properties,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- JmolPopupStructure.properties 26 Feb 2004 15:55:54 -0000 1.24 +++ JmolPopupStructure.properties 29 Feb 2004 21:17:53 -0000 1.25 @@ -1,7 +1,8 @@ popupMenu=selectMenu atomMenu bondMenu labelMenu - \ zoomMenu - \ axesMenu bbcageMenu uccageMenu - \ -perspectiveDepthCheckbox orientationRasMolChimeCheckbox - \ +rasmolChimeMenu - \ +perspectiveDepthCheckbox \ showHydrogensCheckbox showVectorsCheckbox showMeasurementsCheckbox - \ testFlag1Checkbox testFlag2Checkbox testFlag3Checkbox @@ -51,13 +52,6 @@ colortype= colorcharge= -animateMenu=play nextframe prevframe rewind revplay -play=animate play -nextframe=animate next -prevframe=animate prev -rewind=animate rewind -revplay=animate revplay - zoomMenu=zoom100 zoom150 zoom200 zoom400 zoom800 zoom100=zoom 100 zoom150=zoom 150 @@ -65,6 +59,13 @@ zoom400=zoom 300 zoom800=zoom 800 +rasmolChimeMenu= rasmolChimeCompatibility - \ +rasmolColors axesOrientationRasmolCheckbox zeroBasedXyzRasmolCheckbox + +rasmolChimeCompatibility=set color rasmol; set zeroBasedXyzRasmol on; \ +set axesOrientationRasmol on; select *; cpk off; wireframe +rasmolColors=set color rasmol + # axes axesMenu=axesOff axesDotted axes1 axes3 axes5 axes10 \ axes0.1 axes0.25 - \ Index: JmolPopupSwing.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/ui/JmolPopupSwing.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- JmolPopupSwing.java 18 Jan 2004 15:12:03 -0000 1.8 +++ JmolPopupSwing.java 29 Feb 2004 21:17:53 -0000 1.9 @@ -68,8 +68,8 @@ for (Enumeration keys = htCheckbox.keys(); keys.hasMoreElements(); ) { String key = (String)keys.nextElement(); JCheckBoxMenuItem jcbmi = (JCheckBoxMenuItem)htCheckbox.get(key); - // System.out.println("found:" + key); boolean b = viewer.getBooleanProperty(key); + //System.out.println("found:" + key + " & it is:" + b); jcbmi.setState(b); } show(component, x, y); @@ -85,7 +85,7 @@ class CheckboxMenuItemListener implements ItemListener { public void itemStateChanged(ItemEvent e) { - // System.out.println("CheckboxMenuItemListener() " + e.getSource()); + //System.out.println("CheckboxMenuItemListener() " + e.getSource()); JCheckBoxMenuItem jcmi = (JCheckBoxMenuItem)e.getSource(); viewer.setBooleanProperty(jcmi.getActionCommand(), jcmi.getState()); } @@ -121,6 +121,7 @@ String word = getWord(item); JMenuItem jmi; if (item.endsWith("Checkbox")) { + //System.out.println("I see a cheeckbox named:" + item); JCheckBoxMenuItem jcmi = new JCheckBoxMenuItem(word); String basename = item.substring(0, item.length() - 8); jcmi.setActionCommand(basename); Index: JmolPopupWords.properties =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/ui/JmolPopupWords.properties,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- JmolPopupWords.properties 22 Feb 2004 12:17:15 -0000 1.21 +++ JmolPopupWords.properties 29 Feb 2004 21:17:53 -0000 1.22 @@ -39,7 +39,7 @@ colortype=Type colorcharge=Charge -orientationRasMolChimeCheckbox=Axes RasMol/Chime +axesOrientationRasmolCheckbox=Axes Orientation RasMol/Chime testFlag1Checkbox=Test Flag 1 testFlag2Checkbox=Test Flag 2 |
From: Michael T Howard <michaelthoward@us...> - 2004-02-29 17:53:19
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/managers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13578/src/org/openscience/jmol/viewer/managers Modified Files: ModelManager.java Log Message: error checking when frame == null Index: ModelManager.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/managers/ModelManager.java,v retrieving revision 1.52 retrieving revision 1.53 diff -u -r1.52 -r1.53 --- ModelManager.java 27 Feb 2004 17:47:20 -0000 1.52 +++ ModelManager.java 29 Feb 2004 17:35:03 -0000 1.53 @@ -102,38 +102,41 @@ } public float getRotationRadius() { - return frame.getRotationRadius(); + return (frame == null) ? 1 : frame.getRotationRadius(); } public void increaseRotationRadius(float increaseInAngstroms) { - frame.increaseRotationRadius(increaseInAngstroms); + if (frame != null) + frame.increaseRotationRadius(increaseInAngstroms); } public Point3f getRotationCenter() { - return frame.getRotationCenter(); + return (frame == null) ? null : frame.getRotationCenter(); } public Point3f getBoundingBoxCenter() { - return frame.getBoundingBoxCenter(); + return (frame == null) ? null : frame.getBoundingBoxCenter(); } public Vector3f getBoundingBoxCornerVector() { - return frame.getBoundingBoxCornerVector(); + return (frame == null) ? null : frame.getBoundingBoxCornerVector(); } public int getModelCount() { - return frame.getModelCount(); + return (frame == null) ? 0 : frame.getModelCount(); } public int getAtomCount() { - return frame.getAtomCount(); + return (frame == null) ? 0 : frame.getAtomCount(); } public int getBondCount() { - return frame.getBondCount(); + return (frame == null) ? 0 : frame.getBondCount(); } public void setCenterAsSelected() { + if (frame == null) + return; int countSelected = 0; Point3f center = new Point3f(); // defaults to 0,00, BitSet bsSelection = viewer.getSelectionSet(); @@ -152,13 +155,15 @@ } public void setRotationCenter(Point3f center) { - frame.setRotationCenter(center); + if (frame != null) + frame.setRotationCenter(center); } public boolean autoBond = true; public void rebond() { - frame.rebond(); + if (frame != null) + frame.rebond(); } public void setAutoBond(boolean ab) { |
From: Michael T Howard <michaelthoward@us...> - 2004-02-29 11:23:24
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/datamodel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2612/src/org/openscience/jmol/viewer/datamodel Modified Files: Bond.java BondRenderer.java Cartoon.java CartoonRenderer.java DotsRenderer.java Frank.java ShapeRenderer.java Strands.java UccageRenderer.java Log Message: changed default colors to Ghemicaal/OpenBabel added set color rasmol|jmol initial support for custom colors Index: Bond.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/datamodel/Bond.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- Bond.java 12 Jan 2004 15:51:42 -0000 1.8 +++ Bond.java 29 Feb 2004 11:04:51 -0000 1.9 @@ -27,7 +27,6 @@ import org.openscience.jmol.viewer.*; import org.openscience.jmol.viewer.g3d.Graphics3D; -import org.openscience.jmol.viewer.g3d.Colix; import java.awt.Rectangle; Index: BondRenderer.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/datamodel/BondRenderer.java,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- BondRenderer.java 27 Feb 2004 17:47:20 -0000 1.33 +++ BondRenderer.java 29 Feb 2004 11:04:51 -0000 1.34 @@ -27,7 +27,6 @@ import org.openscience.jmol.viewer.*; import org.openscience.jmol.viewer.g3d.Graphics3D; -import org.openscience.jmol.viewer.g3d.Colix; import java.awt.Rectangle; Index: Cartoon.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/datamodel/Cartoon.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- Cartoon.java 15 Feb 2004 21:47:40 -0000 1.13 +++ Cartoon.java 29 Feb 2004 11:04:51 -0000 1.14 @@ -27,7 +27,6 @@ import org.openscience.jmol.viewer.*; import org.openscience.jmol.viewer.g3d.Graphics3D; -import org.openscience.jmol.viewer.g3d.Colix; import org.openscience.jmol.viewer.pdb.*; import javax.vecmath.Point3f; import java.util.BitSet; Index: CartoonRenderer.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/datamodel/CartoonRenderer.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- CartoonRenderer.java 15 Feb 2004 21:47:40 -0000 1.20 +++ CartoonRenderer.java 29 Feb 2004 11:04:51 -0000 1.21 @@ -253,7 +253,7 @@ void renderPendingSheet(Point3f pointStart, Point3f pointBeforeEnd, Point3f pointEnd, boolean tEnd) { - shadesPending = Colix.getShades(colixPending); + shadesPending = g3d.getShades(colixPending); if (tEnd) { drawArrowHeadBox(pointBeforeEnd, pointEnd); drawBox(pointStart, pointBeforeEnd); Index: DotsRenderer.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/datamodel/DotsRenderer.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- DotsRenderer.java 15 Feb 2004 21:47:40 -0000 1.29 +++ DotsRenderer.java 29 Feb 2004 11:04:51 -0000 1.30 @@ -27,8 +27,6 @@ import org.openscience.jmol.viewer.*; import org.openscience.jmol.viewer.g3d.Graphics3D; -import org.openscience.jmol.viewer.g3d.Colix; -import org.openscience.jmol.viewer.g3d.Shade3D; import java.awt.Rectangle; import java.util.Hashtable; Index: Frank.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/datamodel/Frank.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Frank.java 18 Feb 2004 01:13:14 -0000 1.1 +++ Frank.java 29 Feb 2004 11:04:51 -0000 1.2 @@ -24,10 +24,10 @@ */ package org.openscience.jmol.viewer.datamodel; -import org.openscience.jmol.viewer.g3d.Colix; +import org.openscience.jmol.viewer.g3d.Graphics3D; public class Frank extends SelectionIndependentShape { void initShape() { - colix = Colix.GRAY; + colix = Graphics3D.GRAY; } } Index: ShapeRenderer.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/datamodel/ShapeRenderer.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ShapeRenderer.java 27 Feb 2004 13:59:45 -0000 1.2 +++ ShapeRenderer.java 29 Feb 2004 11:04:51 -0000 1.3 @@ -27,8 +27,6 @@ import org.openscience.jmol.viewer.*; import org.openscience.jmol.viewer.g3d.Graphics3D; -import org.openscience.jmol.viewer.g3d.Colix; -import org.openscience.jmol.viewer.g3d.Shade3D; import java.awt.Rectangle; abstract class ShapeRenderer { Index: Strands.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/datamodel/Strands.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- Strands.java 15 Feb 2004 21:47:40 -0000 1.12 +++ Strands.java 29 Feb 2004 11:04:51 -0000 1.13 @@ -27,7 +27,6 @@ import org.openscience.jmol.viewer.*; import org.openscience.jmol.viewer.g3d.Graphics3D; -import org.openscience.jmol.viewer.g3d.Colix; import org.openscience.jmol.viewer.pdb.*; import javax.vecmath.Point3f; import javax.vecmath.Vector3f; Index: UccageRenderer.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/datamodel/UccageRenderer.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- UccageRenderer.java 21 Feb 2004 22:21:06 -0000 1.2 +++ UccageRenderer.java 29 Feb 2004 11:04:51 -0000 1.3 @@ -26,7 +26,6 @@ import org.openscience.jmol.viewer.*; import org.openscience.jmol.viewer.g3d.Graphics3D; -import org.openscience.jmol.viewer.g3d.Colix; import javax.vecmath.Point3f; |
From: Michael T Howard <michaelthoward@us...> - 2004-02-29 11:23:23
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2612/src/org/openscience/jmol/viewer Modified Files: JmolConstants.java JmolViewer.java Log Message: changed default colors to Ghemicaal/OpenBabel added set color rasmol|jmol initial support for custom colors Index: JmolConstants.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/JmolConstants.java,v retrieving revision 1.48 retrieving revision 1.49 diff -u -r1.48 -r1.49 --- JmolConstants.java 28 Feb 2004 16:51:07 -0000 1.48 +++ JmolConstants.java 29 Feb 2004 11:04:49 -0000 1.49 @@ -1055,114 +1055,146 @@ public final static int[] argbsCpk = { 0xFFFF1493, // Xx 0 0xFFFFFFFF, // H 1 - 0xFFFFC0CB, // He 2 - 0xFFB22222, // Li 3 - 0xFFC1FF00, // Be 4 - 0xFF00FF00, // B 5 - 0xFFC8C8C8, // C 6 - 0xFF8F8FFF, // N 7 - 0xFFF00000, // O 8 - 0xFFDAA520, // F 9 - 0xFFB2E2F4, // Ne 10 - 0xFF0000FF, // Na 11 - 0xFF228B22, // Mg 12 - 0xFF808090, // Al 13 - 0xFFDAA520, // Si 14 - 0xFFFFA500, // P 15 - 0xFFFFC832, // S 16 - 0xFF00FF00, // Cl 17 - 0xFF7FD1E2, // Ar 18 - 0xFF8E3FD3, // K 19 - 0xFF808090, // Ca 20 - 0xFFE5E5E5, // Sc 21 - 0xFF808090, // Ti 22 - 0xFFA5A5AA, // V 23 - 0xFF808090, // Cr 24 - 0xFF808090, // Mn 25 - 0xFFFFA500, // Fe 26 - 0xFF707AC6, // Co 27 - 0xFFA52A2A, // Ni 28 - 0xFFA52A2A, // Cu 29 - 0xFFA52A2A, // Zn 30 - 0xFFC18E8E, // Ga 31 - 0xFF668E8E, // Ge 32 - 0xFFBC7FE2, // As 33 - 0xFFFFA000, // Se 34 - 0xFFA52A2A, // Br 35 - 0xFF5BB7D1, // Kr 36 - 0xFF702DAF, // Rb 37 + 0xFFD9FFFF, // He 2 + 0xFFCC80FF, // Li 3 + 0xFFC2FF00, // Be 4 + 0xFFFFB5B5, // B 5 + 0xFF808080, // C 6 + 0xFF0D0DFF, // N 7 + 0xFFFF0D0D, // O 8 + 0xFFB3FFFF, // F 9 + 0xFFB3E3F5, // Ne 10 + 0xFFAB5CF2, // Na 11 + 0xFF8AFF00, // Mg 12 + 0xFFBFA6A6, // Al 13 + 0xFF809999, // Si 14 + 0xFFFF8000, // P 15 + 0xFFFFFF30, // S 16 + 0xFF1FF01F, // Cl 17 + 0xFF80D1E3, // Ar 18 + 0xFF8F40D4, // K 19 + 0xFF3DFF00, // Ca 20 + 0xFFE6E6E6, // Sc 21 + 0xFFBFC2C7, // Ti 22 + 0xFFA6A6AB, // V 23 + 0xFF8A99C7, // Cr 24 + 0xFF9C7AC7, // Mn 25 + 0xFF807AC7, // Fe 26 + 0xFF707AC7, // Co 27 + 0xFF5C7AC2, // Ni 28 + 0xFFFF7A61, // Cu 29 + 0xFF7D80B0, // Zn 30 + 0xFFC28F8F, // Ga 31 + 0xFF668F8F, // Ge 32 + 0xFFBD80E3, // As 33 + 0xFFFFA100, // Se 34 + 0xFFA62929, // Br 35 + 0xFF5CB8D1, // Kr 36 + 0xFF702EB0, // Rb 37 0xFF00FF00, // Sr 38 - 0xFF93FFFF, // Y 39 - 0xFF93E0E0, // Zr 40 - 0xFF72C1C9, // Nb 41 + 0xFF94FFFF, // Y 39 + 0xFF94E0E0, // Zr 40 + 0xFF73C2C9, // Nb 41 0xFF54B5B5, // Mo 42 - 0xFF3A9E9E, // Tc 43 - 0xFF238E8E, // Ru 44 - 0xFF0A7C8C, // Rh 45 - 0xFF006884, // Pd 46 - 0xFF808090, // Ag 47 - 0xFFFFD88E, // Cd 48 - 0xFFA57572, // In 49 - 0xFF667F7F, // Sn 50 + 0xFF3B9E9E, // Tc 43 + 0xFF248F8F, // Ru 44 + 0xFF0A7D8C, // Rh 45 + 0xFF006985, // Pd 46 + 0xFFE0E0FF, // Ag 47 + 0xFFFFD98F, // Cd 48 + 0xFFA67573, // In 49 + 0xFF668080, // Sn 50 0xFF9E63B5, // Sb 51 - 0xFFD37A00, // Te 52 - 0xFFA020F0, // I 53 - 0xFF429EAF, // Xe 54 - 0xFF56168E, // Cs 55 - 0xFFFFA500, // Ba 56 - 0xFF70D3FF, // La 57 - 0xFFFFFFC6, // Ce 58 - 0xFFD8FFC6, // Pr 59 - 0xFFC6FFC6, // Nd 60 - 0xFFA3FFC6, // Pm 61 - 0xFF8EFFC6, // Sm 62 - 0xFF60FFC6, // Eu 63 - 0xFF44FFC6, // Gd 64 - 0xFF30FFC6, // Tb 65 - 0xFF1EFFC6, // Dy 66 - 0xFF00FF9B, // Ho 67 - 0xFF00E575, // Er 68 - 0xFF00D351, // Tm 69 + 0xFFD47A00, // Te 52 + 0xFF940094, // I 53 + 0xFF429EB0, // Xe 54 + 0xFF57178F, // Cs 55 + 0xFF00C900, // Ba 56 + 0xFF70D4FF, // La 57 + 0xFFFFFFC7, // Ce 58 + 0xFFD9FFC7, // Pr 59 + 0xFFC7FFC7, // Nd 60 + 0xFFA3FFC7, // Pm 61 + 0xFF8FFFC7, // Sm 62 + 0xFF61FFC7, // Eu 63 + 0xFF45FFC7, // Gd 64 + 0xFF30FFC7, // Tb 65 + 0xFF1FFFC7, // Dy 66 + 0xFF00FF9C, // Ho 67 + 0xFF00E675, // Er 68 + 0xFF00D452, // Tm 69 0xFF00BF38, // Yb 70 - 0xFF00AA23, // Lu 71 - 0xFF4CC1FF, // Hf 72 - 0xFF4CA5FF, // Ta 73 - 0xFF2193D6, // W 74 - 0xFF267CAA, // Re 75 + 0xFF00AB24, // Lu 71 + 0xFF4DC2FF, // Hf 72 + 0xFF4DA6FF, // Ta 73 + 0xFF2194D6, // W 74 + 0xFF267DAB, // Re 75 0xFF266696, // Os 76 - 0xFF165487, // Ir 77 - 0xFFF4EDD1, // Pt 78 - 0xFFDAA520, // Au 79 - 0xFFB5B5C1, // Hg 80 - 0xFFA5544C, // Tl 81 - 0xFF565960, // Pb 82 + 0xFF175487, // Ir 77 + 0xFFF5EDD1, // Pt 78 + 0xFFCCD11F, // Au 79 + 0xFFB5B5C2, // Hg 80 + 0xFFA6544D, // Tl 81 + 0xFF575961, // Pb 82 0xFF9E4FB5, // Bi 83 - 0xFFAA5B00, // Po 84 - 0xFF754F44, // At 85 + 0xFFAB5C00, // Po 84 + 0xFF754F45, // At 85 0xFF428296, // Rn 86 0xFF420066, // Fr 87 - 0xFF007C00, // Ra 88 - 0xFF70AAF9, // Ac 89 + 0xFF007D00, // Ra 88 + 0xFF70ABFA, // Ac 89 0xFF00BAFF, // Th 90 - 0xFF00A0FF, // Pa 91 - 0xFF008EFF, // U 92 - 0xFF007FFF, // Np 93 + 0xFF00A1FF, // Pa 91 + 0xFF008FFF, // U 92 + 0xFF0080FF, // Np 93 0xFF006BFF, // Pu 94 - 0xFF545BF2, // Am 95 - 0xFF775BE2, // Cm 96 - 0xFF894FE2, // Bk 97 - 0xFFA035D3, // Cf 98 - 0xFFB21ED3, // Es 99 - 0xFFB21EBA, // Fm 100 - 0xFFB20CA5, // Md 101 - 0xFFBC0C87, // No 102 - 0xFFC60066, // Lr 103 + 0xFF545CF2, // Am 95 + 0xFF785CE3, // Cm 96 + 0xFF8A4FE3, // Bk 97 + 0xFFA136D4, // Cf 98 + 0xFFB31FD4, // Es 99 + 0xFFB31FBA, // Fm 100 + 0xFFB30DA6, // Md 101 + 0xFFBD0D87, // No 102 + 0xFFC70066, // Lr 103 0xFFCC0059, // Rf 104 0xFFD1004F, // Db 105 - 0xFFD80044, // Sg 106 + 0xFFD90045, // Sg 106 0xFFE00038, // Bh 107 - 0xFFE5002D, // Hs 108 - 0xFFEA0026, // Mt 109 + 0xFFE6002E, // Hs 108 + 0xFFEB0026, // Mt 109 + }; + + public final static int[] argbsCpkRasmol = { + 0x00FF1493 + ( 0 << 24), // Xx 0 + 0x00FFFFFF + ( 1 << 24), // H 1 + 0x00FFC0CB + ( 2 << 24), // He 2 + 0x00B22222 + ( 3 << 24), // Li 3 + 0x0000FF00 + ( 5 << 24), // B 5 + 0x00C8C8C8 + ( 6 << 24), // C 6 + 0x008F8FFF + ( 7 << 24), // N 7 + 0x00F00000 + ( 8 << 24), // O 8 + 0x00DAA520 + ( 9 << 24), // F 9 + 0x000000FF + (11 << 24), // Na 11 + 0x00228B22 + (12 << 24), // Mg 12 + 0x00808090 + (13 << 24), // Al 13 + 0x00DAA520 + (14 << 24), // Si 14 + 0x00FFA500 + (15 << 24), // P 15 + 0x00FFC832 + (16 << 24), // S 16 + 0x0000FF00 + (17 << 24), // Cl 17 + 0x00808090 + (20 << 24), // Ca 20 + 0x00808090 + (22 << 24), // Ti 22 + 0x00808090 + (24 << 24), // Cr 24 + 0x00808090 + (25 << 24), // Mn 25 + 0x00FFA500 + (26 << 24), // Fe 26 + 0x00A52A2A + (28 << 24), // Ni 28 + 0x00A52A2A + (29 << 24), // Cu 29 + 0x00A52A2A + (30 << 24), // Zn 30 + 0x00A52A2A + (35 << 24), // Br 35 + 0x00808090 + (47 << 24), // Ag 47 + 0x00A020F0 + (53 << 24), // I 53 + 0x00FFA500 + (56 << 24), // Ba 56 + 0x00DAA520 + (79 << 24), // Au 79 }; static { Index: JmolViewer.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/JmolViewer.java,v retrieving revision 1.125 retrieving revision 1.126 diff -u -r1.125 -r1.126 --- JmolViewer.java 28 Feb 2004 23:09:30 -0000 1.125 +++ JmolViewer.java 29 Feb 2004 11:04:50 -0000 1.126 @@ -114,7 +114,8 @@ "\nJava " + strJavaVendor + " " + strJavaVersion + " " + strOSName); - colorManager = new ColorManager(this, modelAdapter); + g3d = new Graphics3D(this); + colorManager = new ColorManager(this, g3d); transformManager = new TransformManager(this); selectionManager = new SelectionManager(this); if (jvm12orGreater) @@ -129,7 +130,6 @@ measurementManager = new MeasurementManager(this); distributionManager = new DistributionManager(this); - g3d = new Graphics3D(this); } @@ -499,7 +499,7 @@ public void setModeAtomColorProfile(byte palette) { colorManager.setPaletteDefault(palette); - distributionManager.setColixAtom(palette, Colix.NULL, + distributionManager.setColixAtom(palette, (short)0, // FIXME Colix.NULL, atomIteratorSelected()); refresh(); } @@ -508,6 +508,10 @@ return colorManager.paletteDefault; } + public void setColorScheme(String colorScheme) { + colorManager.setColorScheme(colorScheme); + } + public void setColorSelection(Color c) { colorManager.setColorSelection(c); refresh(); @@ -643,7 +647,7 @@ public void setColorBond(Color colorBond) { colorManager.setColorBond(colorBond); distributionManager - .setColix(Colix.getColix(colorBond), + .setColix(g3d.getColix(colorBond), bondIteratorSelected(JmolConstants.BOND_COVALENT)); refresh(); } @@ -1342,27 +1346,27 @@ } public void setColorAtomScript(byte palette, Color color) { - distributionManager.setColixAtom(palette, Colix.getColix(color), + distributionManager.setColixAtom(palette, g3d.getColix(color), atomIteratorSelected()); } public void setColorBondScript(Color color) { distributionManager - .setColix(Colix.getColix(color), + .setColix(g3d.getColix(color), bondIteratorSelected(JmolConstants.BOND_COVALENT)); } public void setColorSsBondScript(Color color) { colorManager.setColorSsbond(color); distributionManager - .setColix(Colix.getColix(color), + .setColix(g3d.getColix(color), bondIteratorSelected(JmolConstants.BOND_SULFUR_MASK)); } public void setColorHBondScript(Color color) { colorManager.setColorHbond(color); distributionManager - .setColix(Colix.getColix(color), + .setColix(g3d.getColix(color), bondIteratorSelected(JmolConstants.BOND_HYDROGEN)); } @@ -1409,7 +1413,7 @@ } public void setShapeColor(int shapeType, byte palette, Color color) { - getFrame().setShapeColix(shapeType, palette, Colix.getColix(color), + getFrame().setShapeColix(shapeType, palette, g3d.getColix(color), shapeType < JmolConstants.SHAPE_MIN_SELECTION_INDEPENDENT ? selectionManager.bsSelection @@ -1905,7 +1909,7 @@ } public Color getAtomColor(int i) { - return Colix.getColor(modelManager.getAtomColix(i)); + return g3d.getColor(modelManager.getAtomColix(i)); } public Point3f getBondPoint3f1(int i) { @@ -1925,10 +1929,10 @@ } public Color getBondColor1(int i) { - return Colix.getColor(modelManager.getBondColix1(i)); + return g3d.getColor(modelManager.getBondColix1(i)); } public Color getBondColor2(int i) { - return Colix.getColor(modelManager.getBondColix2(i)); + return g3d.getColor(modelManager.getBondColix2(i)); } } |
From: Michael T Howard <michaelthoward@us...> - 2004-02-29 11:22:56
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/g3d In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2612/src/org/openscience/jmol/viewer/g3d Modified Files: Awt3D.java Circle3D.java Colix.java Cylinder3D.java Graphics3D.java Hermite3D.java Platform3D.java Shade3D.java Sphere3D.java Swing3D.java Text3D.java Triangle3D.java Log Message: changed default colors to Ghemicaal/OpenBabel added set color rasmol|jmol initial support for custom colors Index: Awt3D.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/g3d/Awt3D.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- Awt3D.java 11 Oct 2003 13:17:09 -0000 1.8 +++ Awt3D.java 29 Feb 2004 11:04:51 -0000 1.9 @@ -33,24 +33,24 @@ import java.awt.image.ColorModel; import java.awt.Rectangle; -final public class Awt3D extends Platform3D implements ImageProducer { +final class Awt3D extends Platform3D implements ImageProducer { Component component; ColorModel colorModelRGB; ImageConsumer ic; - public Awt3D(Component component) { + Awt3D(Component component) { this.component = component; colorModelRGB = ColorModel.getRGBdefault(); } - public void allocatePixelBuffer() { + void allocatePixelBuffer() { pBuffer = new int[size]; imagePixelBuffer = component.createImage(this); } - public void notifyEndOfRendering() { + void notifyEndOfRendering() { if (this.ic != null) startProduction(ic); } Index: Circle3D.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/g3d/Circle3D.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Circle3D.java 6 Oct 2003 12:46:03 -0000 1.3 +++ Circle3D.java 29 Feb 2004 11:04:51 -0000 1.4 @@ -26,7 +26,7 @@ import org.openscience.jmol.viewer.*; -final public class Circle3D { +final class Circle3D { Graphics3D g3d; Index: Colix.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/g3d/Colix.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Colix.java 13 Jan 2004 18:15:07 -0000 1.5 +++ Colix.java 29 Feb 2004 11:04:51 -0000 1.6 @@ -27,7 +27,7 @@ import java.awt.Color; -public class Colix { +class Colix { /**************************************************************** * colix support @@ -35,29 +35,6 @@ * a colix is a color index stored as a short ****************************************************************/ - public final static short NULL = 0; - public final static short BLACK = 1; - public final static short ORANGE = 2; - public final static short PINK = 3; - public final static short BLUE = 4; - public final static short WHITE = 5; - public final static short AQUA = 6; - public final static short CYAN = 6; - public final static short RED = 7; - public final static short GREEN = 8; - public final static short GRAY = 9; - public final static short SILVER = 10; - public final static short LIGHTGRAY = 10; - public final static short LIME = 11; - public final static short MAROON = 12; - public final static short NAVY = 13; - public final static short OLIVE = 14; - public final static short PURPLE = 15; - public final static short TEAL = 16; - public final static short MAGENTA = 17; - public final static short FUCHSIA = 17; - public final static short YELLOW = 18; - static Color[] colorsPredefined = { Color.black, Color.orange, Color.pink, Color.blue, Color.white, Color.cyan, Color.red, new Color(0, 128, 0), @@ -66,17 +43,17 @@ new Color(0, 128, 128), Color.magenta, Color.yellow }; - static short colixMax = 1; - public static int[] argbs = new int[128]; - public static Color[] colors = new Color[128]; - static int[][] ashades = new int[128][]; + private static short colixMax = 1; + private static int[] argbs = new int[128]; + private static Color[] colors = new Color[128]; + private static int[][] ashades = new int[128][]; static { for (int i = 0; i < colorsPredefined.length; ++i) getColix(colorsPredefined[i]); } - public static short getColix(int argb) { + static short getColix(int argb) { if (argb == 0) return 0; argb |= 0xFF000000; @@ -101,7 +78,7 @@ return colixMax++; } - public static short getColix(Color color) { + static short getColix(Color color) { if (color == null) return 0; int argb = color.getRGB(); @@ -111,7 +88,7 @@ return colix; } - public static Color getColor(short colix) { + static Color getColor(short colix) { if (colix == 0) return null; Color color = colors[colix]; @@ -120,18 +97,18 @@ return colors[colix]; } - public static int getArgb(short colix) { + static int getArgb(short colix) { return argbs[colix]; } - public static int[] getShades(short colix) { + static int[] getShades(short colix) { int[] shades = ashades[colix]; if (shades == null) shades = ashades[colix] = Shade3D.getShades(argbs[colix]); return shades; } - public static void flushShades() { + static void flushShades() { for (int i = colixMax; --i >= 0; ) ashades[i] = null; } Index: Cylinder3D.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/g3d/Cylinder3D.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- Cylinder3D.java 14 Dec 2003 19:33:31 -0000 1.13 +++ Cylinder3D.java 29 Feb 2004 11:04:51 -0000 1.14 @@ -31,12 +31,12 @@ import java.awt.image.MemoryImageSource; import java.util.Hashtable; -public class Cylinder3D { +class Cylinder3D { JmolViewer viewer; Graphics3D g3d; - public Cylinder3D(JmolViewer viewer, Graphics3D g3d) { + Cylinder3D(JmolViewer viewer, Graphics3D g3d) { this.viewer = viewer; this.g3d = g3d; } @@ -59,19 +59,19 @@ int sampleCount; private float[] samples = new float[32]; - public void render(short colixA, short colixB, byte endcaps, int diameter, + void render(short colixA, short colixB, byte endcaps, int diameter, int xA, int yA, int zA, int dxB, int dyB, int dzB) { this.diameter = diameter; if (diameter <= 1) { - g3d.plotLineDelta(Colix.getArgb(colixA), Colix.getArgb(colixB), + g3d.plotLineDelta(g3d.getArgb(colixA), g3d.getArgb(colixB), xA, yA, zA, dxB, dyB, dzB); return; } this.xA = xA; this.yA = yA; this.zA = zA; this.dxB = dxB; this.dyB = dyB; this.dzB = dzB; - this.shadesA = Colix.getShades(this.colixA = colixA); - this.shadesB = Colix.getShades(this.colixB = colixB); + this.shadesA = g3d.getShades(this.colixA = colixA); + this.shadesB = g3d.getShades(this.colixB = colixB); this.endcaps = endcaps; calcArgbEndcap(true); @@ -311,14 +311,14 @@ int xTip, yTip, zTip; - public void renderCone(short colix, byte endcap, int diameter, + void renderCone(short colix, byte endcap, int diameter, int xA, int yA, int zA, int xTip, int yTip, int zTip) { dxB = (this.xTip = xTip) - (this.xA = xA); dyB = (this.yTip = yTip) - (this.yA = yA); dzB = (this.zTip = zTip) - (this.zA = zA); - shadesA = Colix.getShades(this.colixA = colix); + shadesA = g3d.getShades(this.colixA = colix); int intensityTip = viewer.calcIntensity(dxB, dyB, -dzB); g3d.plotPixelClipped(shadesA[intensityTip], xTip, yTip, zTip); Index: Graphics3D.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/g3d/Graphics3D.java,v retrieving revision 1.56 retrieving revision 1.57 diff -u -r1.56 -r1.57 --- Graphics3D.java 26 Feb 2004 21:35:22 -0000 1.56 +++ Graphics3D.java 29 Feb 2004 11:04:52 -0000 1.57 @@ -176,7 +176,7 @@ } public void setColix(short colix) { - argbCurrent = Colix.getArgb(colix); + argbCurrent = getArgb(colix); } int[] imageBuf = new int[0]; @@ -215,7 +215,7 @@ if (z < slab) return; int r = (diameter + 1) / 2; - argbCurrent = Colix.getArgb(colix); + argbCurrent = getArgb(colix); if ((x >= r && x + r < width) && (y >= r && y + r < height)) { switch (diameter) { case 2: @@ -250,7 +250,7 @@ if (diameter == 0 || z < slab) return; int r = (diameter + 1) / 2; - argbCurrent = Colix.getArgb(colixFill); + argbCurrent = getArgb(colixFill); if (x >= r && x + r < width && y >= r && y + r < height) { circle3d.plotFilledCircleCenteredUnclipped(x, y, z, diameter, true); circle3d.plotCircleCenteredUnclipped(x, y, z, diameter); @@ -265,7 +265,7 @@ if (diameter == 0 || z < slab) return; int r = (diameter + 1) / 2; - argbCurrent = Colix.getArgb(colixFill); + argbCurrent = getArgb(colixFill); if (x >= r && x + r < width && y >= r && y + r < height) { circle3d.plotFilledCircleCenteredUnclipped(x, y, z, diameter, false); } else { @@ -289,7 +289,7 @@ } public void drawRect(short colix, int x, int y, int width, int height) { - argbCurrent = Colix.getArgb(colix); + argbCurrent = getArgb(colix); int xRight = x + width; drawLine(x, y, 0, xRight, y, 0); int yBottom = y + height; @@ -302,7 +302,7 @@ int xBaseline, int yBaseline, int z) { if (z < slab) return; - argbCurrent = Colix.getArgb(colix); + argbCurrent = getArgb(colix); Text3D.plot(xBaseline, yBaseline - fontmetricsCurrent.getAscent(), z, argbCurrent, str, fontCurrent, this); } @@ -357,20 +357,20 @@ public void drawDashedLine(short colix, int run, int rise, int x1, int y1, int z1, int x2, int y2, int z2) { - int argb = Colix.getArgb(colix); + int argb = getArgb(colix); line3d.drawDashedLine(argb, argb, run, rise, x1, y1, z1, x2, y2, z2); } public void drawDottedLine(short colix, int x1, int y1, int z1, int x2, int y2, int z2) { - int argb = Colix.getArgb(colix); + int argb = getArgb(colix); line3d.drawDashedLine(argb, argb, 2, 1, x1, y1, z1, x2, y2, z2); } public void drawDashedLine(short colix1, short colix2, int run, int rise, int x1, int y1, int z1, int x2, int y2, int z2) { - line3d.drawDashedLine(Colix.getArgb(colix1), Colix.getArgb(colix2), + line3d.drawDashedLine(getArgb(colix1), getArgb(colix2), run, rise, x1, y1, z1, x2, y2, z2); } @@ -382,7 +382,7 @@ } public void drawLine(short colix, Point3i pointA, Point3i pointB) { - int argb = Colix.getArgb(colix); + int argb = getArgb(colix); line3d.drawLine(argb, argb, pointA.x, pointA.y, pointA.z, pointB.x, pointB.y, pointB.z); @@ -394,7 +394,7 @@ public void drawDashedLine(short colix, int run, int rise, Point3i pointA, Point3i pointB) { - int argb = Colix.getArgb(colix); + int argb = getArgb(colix); line3d.drawDashedLine(argb, argb, run, rise, pointA.x, pointA.y, pointA.z, pointB.x, pointB.y, pointB.z); @@ -412,13 +412,13 @@ public void drawLine(short colix, int x1, int y1, int z1, int x2, int y2, int z2) { - int argb = Colix.getArgb(colix); + int argb = getArgb(colix); line3d.drawLine(argb, argb, x1, y1, z1, x2, y2, z2); } public void drawLine(short colix1, short colix2, int x1, int y1, int z1, int x2, int y2, int z2) { - line3d.drawLine(Colix.getArgb(colix1), Colix.getArgb(colix2), + line3d.drawLine(getArgb(colix1), getArgb(colix2), x1, y1, z1, x2, y2, z2); } @@ -466,8 +466,8 @@ Point3i screenC, Point3i screenD) { fillTriangle(argb, screenA, screenB, screenC); fillTriangle(argb, screenA, screenC, screenD); - } - + } + public void fillTriangle(int argb, Point3i screenA, Point3i screenB, Point3i screenC) { argbCurrent = argb; @@ -483,17 +483,17 @@ } int intensity = 0; - + void calcSurfaceShade(short colix, Point3i screenA, Point3i screenB, Point3i screenC) { - argbCurrent = Colix.getShades(colix)[intensity]; + argbCurrent = getShades(colix)[intensity]; intensity = (intensity + 10) & 63; } public void drawfillTriangle(short colix, int xA, int yA, int zA, int xB, int yB, int zB, int xC, int yC, int zC) { - int argb = argbCurrent = Colix.getArgb(colix); + int argb = argbCurrent = getArgb(colix); line3d.drawLine(argb, argb, xA, yA, zA, xB, yB, zB); line3d.drawLine(argb, argb, xA, yA, zA, xC, yC, zC); line3d.drawLine(argb, argb, xB, yB, zB, xC, yC, zC); @@ -515,7 +515,7 @@ xB + "," + yB + "," + zB + "->" + xC + "," + yC + "," + zC); */ - argbCurrent = Colix.getArgb(colix); + argbCurrent = getArgb(colix); int[] t; t = triangle3d.ax; t[0] = xA; t[1] = xB; t[2] = xC; @@ -534,7 +534,7 @@ xB + "," + yB + "," + zB + "->" + xC + "," + yC + "," + zC); */ - int argb = Colix.getArgb(colix); + int argb = getArgb(colix); line3d.drawLine(argb, argb, xA, yA, zA, xB, yB, zB); line3d.drawLine(argb, argb, xA, yA, zA, xC, yC, zC); line3d.drawLine(argb, argb, xB, yB, zB, xC, yC, zC); @@ -669,7 +669,7 @@ int offset = y * width + x; if (z < zbuf[offset]) { zbuf[offset] = (short)z; - pbuf[offset] = Colix.getArgb(colix); + pbuf[offset] = getArgb(colix); } } @@ -845,7 +845,7 @@ } public void plotPoints(short colix, int count, int[] coordinates) { - int argb = argbCurrent = Colix.getArgb(colix); + int argb = argbCurrent = getArgb(colix); for (int i = count * 3; i > 0; ) { int z = coordinates[--i]; int y = coordinates[--i]; @@ -862,7 +862,7 @@ public void plotPoints(int count, short colix, byte[] intensities, int[] coordinates) { - int[] shades = Colix.getShades(colix); + int[] shades = getShades(colix); for (int i = count * 3, j = count-1; i > 0; --j) { int z = coordinates[--i]; int y = coordinates[--i]; @@ -872,7 +872,7 @@ int offset = y * width + x; if (z < zbuf[offset]) { zbuf[offset] = (short)z; - // pbuf[offset] = Colix.getArgb(colix); + // pbuf[offset] = getArgb(colix); pbuf[offset] = shades[intensities[j]]; } } @@ -883,4 +883,115 @@ ((argb >> 1) & 0xFF7F7F7F)) | (argb & 0xFF010101)); } + + public final static short NULL = 0; + public final static short BLACK = 1; + public final static short ORANGE = 2; + public final static short PINK = 3; + public final static short BLUE = 4; + public final static short WHITE = 5; + public final static short AQUA = 6; + public final static short CYAN = 6; + public final static short RED = 7; + public final static short GREEN = 8; + public final static short GRAY = 9; + public final static short SILVER = 10; + public final static short LIGHTGRAY = 10; + public final static short LIME = 11; + public final static short MAROON = 12; + public final static short NAVY = 13; + public final static short OLIVE = 14; + public final static short PURPLE = 15; + public final static short TEAL = 16; + public final static short MAGENTA = 17; + public final static short FUCHSIA = 17; + public final static short YELLOW = 18; + + public int getArgb(short colix) { + return Colix.getArgb(colix >= 0 ? colix : changableColixMap[-colix]); + } + + public int[] getShades(short colix) { + return Colix.getShades(colix >= 0 ? colix : changableColixMap[-colix]); + } + + public short getColix(int argb) { + return Colix.getColix(argb); + } + + public short getColix(Color color) { + return Colix.getColix(color); + } + + public Color getColor(short colix) { + return Colix.getColor(colix >= 0 ? colix : changableColixMap[-colix]); + } + + /**************************************************************** + * changable colixes + * give me a short ID and a color, and I will give you a colix + * later, you can reassign the color if you want + ****************************************************************/ + + short[] changableColixMap = new short[16]; + + public short getChangableColix(short id, int argb) { + ++id; // to deal with 0; + if (id > changableColixMap.length) { + short[] t = new short[id + 16]; + System.arraycopy(changableColixMap, 0, t, 0, changableColixMap.length); + changableColixMap = t; + } + if (changableColixMap[id] == 0) + changableColixMap[id] = getColix(argb); + return (short)-id; + } + + public void changeColixArgb(short id, int argb) { + ++id; + if (id < changableColixMap.length && changableColixMap[id] != 0) + changableColixMap[id] = getColix(argb); + } + + public void flushShadesAndImageCaches() { + Colix.flushShades(); + Sphere3D.flushImageCache(); + } + + public final static byte shadeMax = Shade3D.shadeMax; + public final static byte shadeNormal = Shade3D.shadeNormal; + public final static byte intensitySpecularSurfaceLimit = + Shade3D.intensitySpecularSurfaceLimit; + + public void setSpecular(boolean specular) { + Shade3D.setSpecular(specular); + } + + public boolean getSpecular() { + return Shade3D.getSpecular(); + } + + public void setSpecularPower(int specularPower) { + Shade3D.setSpecularPower(specularPower); + } + + public void setAmbientPercent(int ambientPercent) { + Shade3D.setAmbientPercent(ambientPercent); + } + + public void setDiffusePercent(int diffusePercent) { + Shade3D.setDiffusePercent(diffusePercent); + } + + public void setSpecularPercent(int specularPercent) { + Shade3D.setSpecularPercent(specularPercent); + } + + public void setLightsourceZ(float dist) { + Shade3D.setLightsourceZ(dist); + } + + public int calcIntensityNormalized(float x, float y, float z) { + return Shade3D.calcIntensityNormalized(x, y, z); + } } Index: Hermite3D.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/g3d/Hermite3D.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- Hermite3D.java 15 Nov 2003 09:09:55 -0000 1.8 +++ Hermite3D.java 29 Feb 2004 11:04:52 -0000 1.9 @@ -32,12 +32,12 @@ import java.util.Hashtable; import javax.vecmath.Point3i; -public class Hermite3D { +class Hermite3D { JmolViewer viewer; Graphics3D g3d; - public Hermite3D(JmolViewer viewer, Graphics3D g3d) { + Hermite3D(JmolViewer viewer, Graphics3D g3d) { this.viewer = viewer; this.g3d = g3d; } @@ -54,7 +54,7 @@ } } - public void render(boolean tFill, short colix, int tension, + void render(boolean tFill, short colix, int tension, int diameterBeg, int diameterMid, int diameterEnd, Point3i p0, Point3i p1, Point3i p2, Point3i p3) { int x1 = p1.x, y1 = p1.y, z1 = p1.z; Index: Platform3D.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/g3d/Platform3D.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Platform3D.java 9 Jan 2004 12:31:52 -0000 1.6 +++ Platform3D.java 29 Feb 2004 11:04:52 -0000 1.7 @@ -30,7 +30,7 @@ import java.awt.FontMetrics; import java.awt.Rectangle; -abstract public class Platform3D { +abstract class Platform3D { int width, height; int size; Index: Shade3D.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/g3d/Shade3D.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- Shade3D.java 13 Jan 2004 22:31:47 -0000 1.9 +++ Shade3D.java 29 Feb 2004 11:04:52 -0000 1.10 @@ -27,14 +27,14 @@ import javax.vecmath.Vector3f; -public final class Shade3D { +final class Shade3D { // there are 64 shades of a given color // 0 = ambient // 63 = brightest ... white - public static final int shadeMax = 64; + static final int shadeMax = 64; - private static byte shadeNormal = 52; + static byte shadeNormal = 52; // the light source vector static final float xLightsource = -1; @@ -64,7 +64,7 @@ // set ambient 0-100 static float ambientFraction = 0.5f; - public static int[] getShades(int rgb) { + static int[] getShades(int rgb) { int[] shades = new int[shadeMax]; int red = (rgb >> 16) & 0xFF; @@ -117,9 +117,9 @@ } */ - public final static int intensitySpecularSurfaceLimit = shadeNormal + 4; + final static byte intensitySpecularSurfaceLimit = (byte)(shadeNormal + 4); - public static int calcIntensityNormalized(float x, float y, float z) { + static int calcIntensityNormalized(float x, float y, float z) { float cosTheta = x*xLight + y*yLight + z*zLight; float intensity = 0; // ambient component if (cosTheta > 0) { @@ -142,16 +142,16 @@ return (byte)shade; } - public static void setSpecular(boolean specular) { + static void setSpecular(boolean specular) { specularOn = specular; dump(); } - public static boolean getSpecular() { + static boolean getSpecular() { return specularOn; } - public static void setLightsourceZ(float z) { + static void setLightsourceZ(float z) { zLightsource = z; magnitudeLight = (float)Math.sqrt(xLightsource * xLightsource + @@ -160,7 +160,7 @@ dump(); } - public static void setSpecularPower(int specularPower) { + static void setSpecularPower(int specularPower) { if (specularPower >= 0) intenseFraction = specularPower / 100f; else @@ -168,17 +168,17 @@ dump(); } - public static void setAmbientPercent(int ambientPercent) { + static void setAmbientPercent(int ambientPercent) { ambientFraction = ambientPercent / 100f; dump(); } - public static void setDiffusePercent(int diffusePercent) { + static void setDiffusePercent(int diffusePercent) { intensityDiffuse = diffusePercent / 100f; dump(); } - public static void setSpecularPercent(int specularPercent) { + static void setSpecularPercent(int specularPercent) { intensitySpecular = specularPercent / 100f; dump(); } Index: Sphere3D.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/g3d/Sphere3D.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Sphere3D.java 15 Nov 2003 16:37:39 -0000 1.6 +++ Sphere3D.java 29 Feb 2004 11:04:52 -0000 1.7 @@ -31,7 +31,7 @@ import java.awt.image.MemoryImageSource; import java.util.Hashtable; -public class Sphere3D { +class Sphere3D { JmolViewer viewer; Graphics3D g3d; @@ -42,7 +42,7 @@ final static int shiftDivFoo = 9; short[] heightsFoo; - public Sphere3D(JmolViewer viewer, Graphics3D g3d) { + Sphere3D(JmolViewer viewer, Graphics3D g3d) { this.viewer = viewer; this.g3d = g3d; @@ -70,10 +70,10 @@ int radius = (diameter + 1) / 2; float r = diameter / 2.0f; float radius2 = r * r; - g3d.argbCurrent = Colix.getArgb(colix); + g3d.argbCurrent = g3d.getArgb(colix); int xUL = xC - radius; int yUL = yC - radius; - int[] shades = Colix.getShades(colix); + int[] shades = g3d.getShades(colix); float yF = -radius + 0.5f; for (int i = 0; i < diameter; ++i, ++yF) { @@ -161,7 +161,7 @@ void render(short colix, int diameter, int x, int y, int z) { int radius = (diameter + 1) >> 1; - int[] shades = Colix.getShades(colix); + int[] shades = g3d.getShades(colix); if (diameter >= maxSphereCache) { if (x-radius < 0 || x+radius >= g3d.width || y-radius < 0 || y+radius >= g3d.height) @@ -334,7 +334,7 @@ return ss; } - public static void flushImageCache() { + static void flushImageCache() { sphereShapeCache = new int[maxSphereCache][]; } Index: Swing3D.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/g3d/Swing3D.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Swing3D.java 7 Oct 2003 08:57:35 -0000 1.6 +++ Swing3D.java 29 Feb 2004 11:04:52 -0000 1.7 @@ -33,7 +33,7 @@ import java.awt.Rectangle; import java.util.Arrays; -final public class Swing3D extends Platform3D { +final class Swing3D extends Platform3D { void allocatePixelBuffer() { BufferedImage bi = Index: Text3D.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/g3d/Text3D.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Text3D.java 2 Oct 2003 15:52:42 -0000 1.4 +++ Text3D.java 29 Feb 2004 11:04:52 -0000 1.5 @@ -34,7 +34,7 @@ import java.awt.image.PixelGrabber; import java.util.Hashtable; -public class Text3D { +class Text3D { /* we have a few problems here a message is probably going to vary in size with z depth @@ -58,7 +58,7 @@ int size; int[] bitmap; - public Text3D(String text, Font font, Platform3D platform) { + Text3D(String text, Font font, Platform3D platform) { calcMetrics(text, font, platform); platform.checkOffscreenSize(width, height); renderOffscreen(text, font, platform); @@ -193,8 +193,8 @@ return text3d; } - public static void plot(int x, int y, int z, int argb, - String text, Font font, Graphics3D g3d) { + static void plot(int x, int y, int z, int argb, + String text, Font font, Graphics3D g3d) { Text3D text25d = getText3D(text, font, g3d.platform); int[] bitmap = text25d.bitmap; int textWidth = text25d.width; Index: Triangle3D.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/g3d/Triangle3D.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Triangle3D.java 6 Oct 2003 12:46:03 -0000 1.6 +++ Triangle3D.java 29 Feb 2004 11:04:52 -0000 1.7 @@ -31,7 +31,7 @@ import java.awt.image.MemoryImageSource; import java.util.Hashtable; -public class Triangle3D { +class Triangle3D { JmolViewer viewer; Graphics3D g3d; @@ -40,7 +40,7 @@ int ay[] = new int[4]; int az[] = new int[4]; - public Triangle3D(JmolViewer viewer, Graphics3D g3d) { + Triangle3D(JmolViewer viewer, Graphics3D g3d) { this.viewer = viewer; this.g3d = g3d; } |
From: Michael T Howard <michaelthoward@us...> - 2004-02-29 11:22:56
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/managers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2612/src/org/openscience/jmol/viewer/managers Modified Files: ColorManager.java Log Message: changed default colors to Ghemicaal/OpenBabel added set color rasmol|jmol initial support for custom colors Index: ColorManager.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/managers/ColorManager.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- ColorManager.java 22 Feb 2004 15:18:09 -0000 1.29 +++ ColorManager.java 29 Feb 2004 11:04:52 -0000 1.30 @@ -1,3 +1,4 @@ + /* $RCSfile$ * $Author$ * $Date$ @@ -38,15 +39,39 @@ public class ColorManager { JmolViewer viewer; - JmolModelAdapter modelAdapter; + Graphics3D g3d; + int[] argbsCpk; public byte paletteDefault = JmolConstants.PALETTE_CPK; - public ColorManager(JmolViewer viewer, JmolModelAdapter modelAdapter) { + public ColorManager(JmolViewer viewer, Graphics3D g3d) { this.viewer = viewer; - this.modelAdapter = modelAdapter; - if (JmolConstants.argbsCpk.length != JmolConstants.atomicNumberMax) - System.out.println("WARNING! argbsCpk.length not consistent"); + this.g3d = g3d; + argbsCpk = JmolConstants.argbsCpk; + } + + public void setColorScheme(String colorScheme) { + System.out.println("setting color scheme to:" + colorScheme); + if (colorScheme.equals("jmol")) { + argbsCpk = JmolConstants.argbsCpk; + } else if (colorScheme.equals("rasmol")) { + int argb = JmolConstants.argbsCpkRasmol[0] | 0xFF000000; + argbsCpk = new int[JmolConstants.argbsCpk.length]; + for (int i = JmolConstants.argbsCpk.length; --i >= 0; ) + argbsCpk[i] = argb; + for (int i = JmolConstants.argbsCpkRasmol.length; --i >= 0; ) { + argb = JmolConstants.argbsCpkRasmol[i]; + int atomNo = argb >> 24; + argb |= 0xFF000000; + argbsCpk[atomNo] = argb; + g3d.changeColixArgb((short)atomNo, argb); + } + } else { + System.out.println("unrecognized color scheme"); + return; + } + for (int i = JmolConstants.argbsCpk.length; --i >= 0; ) + g3d.changeColixArgb((short)i, argbsCpk[i]); } public void setPaletteDefault(byte palette) { @@ -58,11 +83,11 @@ } public Color colorSelection = Color.orange; - public short colixSelection = Colix.ORANGE; + public short colixSelection = Graphics3D.ORANGE; public void setColorSelection(Color c) { colorSelection = c; - colixSelection = Colix.getColix(c); + colixSelection = g3d.getColix(c); } public Color getColorSelection() { @@ -74,7 +99,7 @@ } public Color colorRubberband = Color.pink; - public short colixRubberband = Colix.PINK; + public short colixRubberband = Graphics3D.PINK; public Color getColorRubberband() { return colorRubberband; } @@ -92,107 +117,107 @@ public short colixBond = 0; public void setColorBond(Color c) { colorBond = c; - colixBond = Colix.getColix(c); + colixBond = g3d.getColix(c); } public Color colorHbond = null; public short colixHbond = 0; public void setColorHbond(Color c) { colorHbond = c; - colixHbond = Colix.getColix(c); + colixHbond = g3d.getColix(c); } public Color colorSsbond = null; public short colixSsbond = 0; public void setColorSsbond(Color c) { colorSsbond = c; - colixSsbond = Colix.getColix(c); + colixSsbond = g3d.getColix(c); } public Color colorLabel = Color.black; - public short colixLabel = Colix.BLACK; + public short colixLabel = Graphics3D.BLACK; public void setColorLabel(Color color) { colorLabel = color; - colixLabel = Colix.getColix(color); + colixLabel = g3d.getColix(color); } - private final static short colixDotsConcaveDefault = Colix.GREEN; - private final static short colixDotsSaddleDefault = Colix.BLUE; + private final static short colixDotsConcaveDefault = Graphics3D.GREEN; + private final static short colixDotsSaddleDefault = Graphics3D.BLUE; public short colixDotsConvex = 0; public short colixDotsConcave = colixDotsConcaveDefault; public short colixDotsSaddle = colixDotsSaddleDefault; public void setColorDotsConvex(Color color) { - colixDotsConvex = Colix.getColix(color); + colixDotsConvex = g3d.getColix(color); } public void setColorDotsConcave(Color color) { - colixDotsConcave = Colix.getColix(color); + colixDotsConcave = g3d.getColix(color); if (colixDotsConcave == 0) colixDotsConcave = colixDotsConcaveDefault; } public void setColorDotsSaddle(Color color) { - colixDotsSaddle = Colix.getColix(color); + colixDotsSaddle = g3d.getColix(color); if (colixDotsSaddle == 0) colixDotsSaddle = colixDotsSaddleDefault; } public Color colorDistance = Color.black; - public short colixDistance = Colix.BLACK; + public short colixDistance = Graphics3D.BLACK; public void setColorDistance(Color c) { colorDistance = c; - colixDistance = Colix.getColix(c); + colixDistance = g3d.getColix(c); } public Color colorAngle = Color.black; - public short colixAngle = Colix.BLACK; + public short colixAngle = Graphics3D.BLACK; public void setColorAngle(Color c) { colorAngle = c; - colixAngle = Colix.getColix(c); + colixAngle = g3d.getColix(c); } public Color colorDihedral = Color.black; - public short colixDihedral = Colix.BLACK; + public short colixDihedral = Graphics3D.BLACK; public void setColorDihedral(Color c) { colorDihedral = c; - colixDihedral = Colix.getColix(c); + colixDihedral = g3d.getColix(c); } public void setColorMeasurement(Color c) { colorDistance = colorAngle = colorDihedral = c; - colixDistance = colixAngle = colixDihedral = Colix.getColix(c); + colixDistance = colixAngle = colixDihedral = g3d.getColix(c); } public Color colorBackground = Color.white; - public short colixBackground = Colix.WHITE; + public short colixBackground = Graphics3D.WHITE; public void setColorBackground(Color bg) { if (bg == null) colorBackground = Color.getColor("colorBackground"); else colorBackground = bg; - colixBackground = Colix.getColix(colorBackground); + colixBackground = g3d.getColix(colorBackground); } public Color colorAxes = Color.gray; - public short colixAxes = Colix.GRAY; + public short colixAxes = Graphics3D.GRAY; public void setColorAxes(Color color) { colorAxes = color; - colixAxes = Colix.getColix(color); + colixAxes = g3d.getColix(color); } public Color colorAxesText = Color.gray; - public short colixAxesText = Colix.GRAY; + public short colixAxesText = Graphics3D.GRAY; public void setColorAxesText(Color color) { colorAxesText = color; - colixAxesText = Colix.getColix(color); + colixAxesText = g3d.getColix(color); } // FIXME NEEDSWORK -- arrow vector stuff public Color colorVector = Color.black; - public short colixVector = Colix.BLACK; + public short colixVector = Graphics3D.BLACK; public void setColorVector(Color c) { colorVector = c; - colixVector = Colix.getColix(c); + colixVector = g3d.getColix(c); } public Color getColorVector() { return colorVector; @@ -262,8 +287,10 @@ PdbAtom pdbatom = atom.pdbAtom; switch (palette) { case JmolConstants.PALETTE_CPK: - argb = JmolConstants.argbsCpk[atom.atomicNumber]; - break; + // Note that CPK colors can be changed based upon user preference + // therefore, a changable colix is allocated in this case + short id = atom.atomicNumber; + return g3d.getChangableColix(id, argbsCpk[id]); case JmolConstants.PALETTE_CHARGE: int i = atom.getAtomicCharge() - JmolConstants.CHARGE_MIN; argb = JmolConstants.argbsCharge[i]; @@ -299,8 +326,8 @@ break; } if (argb == 0) - return Colix.PINK; - return Colix.getColix(argb); + return Graphics3D.PINK; + return g3d.getColix(argb); } public void flushCachedColors() { @@ -320,54 +347,53 @@ vRotated.z >= 0 ? calcIntensity(-vRotated.x, -vRotated.y, vRotated.z) : calcIntensity(vRotated.x, vRotated.y, -vRotated.z); - if (intensity > Shade3D.intensitySpecularSurfaceLimit) - intensity = Shade3D.intensitySpecularSurfaceLimit; + if (intensity > Graphics3D.intensitySpecularSurfaceLimit) + intensity = Graphics3D.intensitySpecularSurfaceLimit; return intensity; } private void flushCaches() { - Colix.flushShades(); - Sphere3D.flushImageCache(); + g3d.flushShadesAndImageCaches(); viewer.refresh(); } public void setSpecular(boolean specular) { - Shade3D.setSpecular(specular); + g3d.setSpecular(specular); flushCaches(); } public boolean getSpecular() { - return Shade3D.getSpecular(); + return g3d.getSpecular(); } public void setSpecularPower(int specularPower) { - Shade3D.setSpecularPower(specularPower); + g3d.setSpecularPower(specularPower); flushCaches(); } public void setAmbientPercent(int ambientPercent) { - Shade3D.setAmbientPercent(ambientPercent); + g3d.setAmbientPercent(ambientPercent); flushCaches(); } public void setDiffusePercent(int diffusePercent) { - Shade3D.setDiffusePercent(diffusePercent); + g3d.setDiffusePercent(diffusePercent); flushCaches(); } public void setSpecularPercent(int specularPercent) { - Shade3D.setSpecularPercent(specularPercent); + g3d.setSpecularPercent(specularPercent); flushCaches(); } public void setLightsourceZ(float dist) { - Shade3D.setLightsourceZ(dist); + g3d.setLightsourceZ(dist); flushCaches(); } public int calcIntensity(float x, float y, float z) { float magnitude = (float)Math.sqrt(x*x + y*y + z*z); - return Shade3D.calcIntensityNormalized(x/magnitude, y/magnitude, - z/magnitude); + return g3d.calcIntensityNormalized(x/magnitude, y/magnitude, + z/magnitude); } } |
From: Michael T Howard <michaelthoward@us...> - 2004-02-29 11:22:56
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/script In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2612/src/org/openscience/jmol/viewer/script Modified Files: Eval.java Token.java Log Message: changed default colors to Ghemicaal/OpenBabel added set color rasmol|jmol initial support for custom colors Index: Eval.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/script/Eval.java,v retrieving revision 1.98 retrieving revision 1.99 diff -u -r1.98 -r1.99 --- Eval.java 28 Feb 2004 15:38:53 -0000 1.98 +++ Eval.java 29 Feb 2004 11:04:53 -0000 1.99 @@ -2107,6 +2107,9 @@ case Token.boundbox: setBoundbox(); break; + case Token.color: + setColor(); + break; case Token.frank: setFrank(); break; @@ -2211,6 +2214,20 @@ getSetAxesTypeMad()); } + void setColor() throws ScriptException { + checkLength3(); + switch(statement[2].tok) { + case Token.rasmol: + case Token.jmol: + case Token.string: + case Token.identifier: + viewer.setColorScheme((String)statement[2].value); + break; + default: + invalidArgument(); + } + } + void setBondmode() throws ScriptException { checkLength3(); boolean bondmodeOr = false; Index: Token.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/script/Token.java,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- Token.java 27 Feb 2004 17:47:20 -0000 1.40 +++ Token.java 29 Feb 2004 11:04:53 -0000 1.41 @@ -108,7 +108,7 @@ final static int cartoon = command | 3 | setparam; final static int center = command | 4 | showparam | expression; final static int clipboard = command | 5; - final static int color = command | 6 | colorparam; + final static int color = command | 6 | colorparam | setparam; final static int connect = command | 7 | bool; final static int define = command | 9 | expression; final static int dots = command | 10 | bool; @@ -139,8 +139,7 @@ final static int cpk = command | 35 | setparam | bool |negativeints; final static int ssbonds = command | 36 | setparam | bool; final static int star = command | 37 | bool; - final static int stereo = command | 38 - | setspecial | bool | negativeints; + final static int stereo = command | 38 | setspecial | bool | negativeints; final static int strands = command | 39 | setparam | bool; final static int structure = command | 40; final static int trace = command | 41 | bool; @@ -304,6 +303,7 @@ final static int mode = misc | 30; final static int direction = misc | 31; final static int fps = misc | 32; + final static int jmol = misc | 33; final static int amino = predefinedset | 0; final static int hetero = predefinedset | 1 | setparam; @@ -533,6 +533,7 @@ "sidechain", new Token(sidechain, "sidechain"), "mode", new Token(mode, "mode"), "direction", new Token(direction, "direction"), + "jmol", new Token(jmol, "jmol"), }; |
From: Michael T Howard <michaelthoward@us...> - 2004-02-28 23:27:09
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/script In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25131/src/org/openscience/jmol/viewer/script Modified Files: Compiler.java Log Message: tweaks Index: Compiler.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/script/Compiler.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- Compiler.java 17 Feb 2004 09:29:11 -0000 1.25 +++ Compiler.java 28 Feb 2004 23:09:30 -0000 1.26 @@ -327,7 +327,7 @@ (ch = script.charAt(ichEnd)) != ';' && ch != '\r' && ch != '\n') { if (ch == '#' && ichFirstSharp == -1) { ichFirstSharp = ichEnd; - System.out.println("I see a first sharp @ " + ichFirstSharp); + //System.out.println("I see a first sharp @ " + ichFirstSharp); } ++ichEnd; } @@ -342,10 +342,12 @@ * comments in Jmol ****************************************************************/ + /* System.out.println("looking for #jc comment"); System.out.println("count left=" + (cchScript - ichFirstSharp) + '\n' + script.charAt(ichFirstSharp + 1) + script.charAt(ichFirstSharp + 2)); + */ if (cchScript - ichFirstSharp >= 3 && |
From: Michael T Howard <michaelthoward@us...> - 2004-02-28 23:27:09
|
Update of /cvsroot/jmol/Jmol/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25131/src Modified Files: JmolApplet.java Log Message: tweaks Index: JmolApplet.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/JmolApplet.java,v retrieving revision 1.63 retrieving revision 1.64 diff -u -r1.63 -r1.64 --- JmolApplet.java 15 Feb 2004 21:47:39 -0000 1.63 +++ JmolApplet.java 28 Feb 2004 23:09:30 -0000 1.64 @@ -215,10 +215,10 @@ load(getValue("load", null)); loadInline(getValue("loadInline", null)); - script(getValue("script", null)); - - viewer.setShapeShow(JmolConstants.SHAPE_FRANK, - getBooleanValue("frank", true)); + if (getBooleanValue("frank", true)) { + System.out.println("frank is ON"); + viewer.setShapeMad(JmolConstants.SHAPE_FRANK, (short)-1); + } animFrameCallback = getValue("AnimFrameCallback", null); loadStructCallback = getValue("LoadStructCallback", null); @@ -232,6 +232,8 @@ pauseCallback != null || pickCallback != null)) System.out.println("WARNING!! MAYSCRIPT not found"); + + script(getValue("script", null)); } viewer.popHoldRepaint(); } |
From: Michael T Howard <michaelthoward@us...> - 2004-02-28 23:27:08
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25131/src/org/openscience/jmol/viewer Modified Files: JmolViewer.java Log Message: tweaks Index: JmolViewer.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/JmolViewer.java,v retrieving revision 1.124 retrieving revision 1.125 diff -u -r1.124 -r1.125 --- JmolViewer.java 28 Feb 2004 15:38:52 -0000 1.124 +++ JmolViewer.java 28 Feb 2004 23:09:30 -0000 1.125 @@ -1405,6 +1405,7 @@ JmolConstants.SHAPE_MIN_SELECTION_INDEPENDENT ? selectionManager.bsSelection : null); + refresh(); } public void setShapeColor(int shapeType, byte palette, Color color) { |
From: Michael T Howard <michaelthoward@us...> - 2004-02-28 17:08:34
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11983/src/org/openscience/jmol/viewer Modified Files: JmolConstants.java Log Message: adopted ghemical/ob colors where there was no conflict with RasMol Index: JmolConstants.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/JmolConstants.java,v retrieving revision 1.47 retrieving revision 1.48 diff -u -r1.47 -r1.48 --- JmolConstants.java 28 Feb 2004 15:38:52 -0000 1.47 +++ JmolConstants.java 28 Feb 2004 16:51:07 -0000 1.48 @@ -1057,13 +1057,13 @@ 0xFFFFFFFF, // H 1 0xFFFFC0CB, // He 2 0xFFB22222, // Li 3 - 0xFFFF1493, // Be 4 + 0xFFC1FF00, // Be 4 0xFF00FF00, // B 5 0xFFC8C8C8, // C 6 0xFF8F8FFF, // N 7 0xFFF00000, // O 8 0xFFDAA520, // F 9 - 0xFFFF1493, // Ne 10 + 0xFFB2E2F4, // Ne 10 0xFF0000FF, // Na 11 0xFF228B22, // Mg 12 0xFF808090, // Al 13 @@ -1071,98 +1071,98 @@ 0xFFFFA500, // P 15 0xFFFFC832, // S 16 0xFF00FF00, // Cl 17 - 0xFFFF1493, // Ar 18 - 0xFFFF1493, // K 19 + 0xFF7FD1E2, // Ar 18 + 0xFF8E3FD3, // K 19 0xFF808090, // Ca 20 - 0xFFFF1493, // Sc 21 + 0xFFE5E5E5, // Sc 21 0xFF808090, // Ti 22 - 0xFFFF1493, // V 23 + 0xFFA5A5AA, // V 23 0xFF808090, // Cr 24 0xFF808090, // Mn 25 0xFFFFA500, // Fe 26 - 0xFFFF1493, // Co 27 + 0xFF707AC6, // Co 27 0xFFA52A2A, // Ni 28 0xFFA52A2A, // Cu 29 0xFFA52A2A, // Zn 30 - 0xFFFF1493, // Ga 31 - 0xFFFF1493, // Ge 32 - 0xFFFF1493, // As 33 - 0xFFFF1493, // Se 34 + 0xFFC18E8E, // Ga 31 + 0xFF668E8E, // Ge 32 + 0xFFBC7FE2, // As 33 + 0xFFFFA000, // Se 34 0xFFA52A2A, // Br 35 - 0xFFFF1493, // Kr 36 - 0xFFFF1493, // Rb 37 - 0xFFFF1493, // Sr 38 - 0xFFFF1493, // Y 39 - 0xFFFF1493, // Zr 40 - 0xFFFF1493, // Nb 41 - 0xFFFF1493, // Mo 42 - 0xFFFF1493, // Tc 43 - 0xFFFF1493, // Ru 44 - 0xFFFF1493, // Rh 45 - 0xFFFF1493, // Pd 46 + 0xFF5BB7D1, // Kr 36 + 0xFF702DAF, // Rb 37 + 0xFF00FF00, // Sr 38 + 0xFF93FFFF, // Y 39 + 0xFF93E0E0, // Zr 40 + 0xFF72C1C9, // Nb 41 + 0xFF54B5B5, // Mo 42 + 0xFF3A9E9E, // Tc 43 + 0xFF238E8E, // Ru 44 + 0xFF0A7C8C, // Rh 45 + 0xFF006884, // Pd 46 0xFF808090, // Ag 47 - 0xFFFF1493, // Cd 48 - 0xFFFF1493, // In 49 - 0xFFFF1493, // Sn 50 - 0xFFFF1493, // Sb 51 - 0xFFFF1493, // Te 52 + 0xFFFFD88E, // Cd 48 + 0xFFA57572, // In 49 + 0xFF667F7F, // Sn 50 + 0xFF9E63B5, // Sb 51 + 0xFFD37A00, // Te 52 0xFFA020F0, // I 53 - 0xFFFF1493, // Xe 54 - 0xFFFF1493, // Cs 55 + 0xFF429EAF, // Xe 54 + 0xFF56168E, // Cs 55 0xFFFFA500, // Ba 56 - 0xFFFF1493, // La 57 - 0xFFFF1493, // Ce 58 - 0xFFFF1493, // Pr 59 - 0xFFFF1493, // Nd 60 - 0xFFFF1493, // Pm 61 - 0xFFFF1493, // Sm 62 - 0xFFFF1493, // Eu 63 - 0xFFFF1493, // Gd 64 - 0xFFFF1493, // Tb 65 - 0xFFFF1493, // Dy 66 - 0xFFFF1493, // Ho 67 - 0xFFFF1493, // Er 68 - 0xFFFF1493, // Tm 69 - 0xFFFF1493, // Yb 70 - 0xFFFF1493, // Lu 71 - 0xFFFF1493, // Hf 72 - 0xFFFF1493, // Ta 73 - 0xFFFF1493, // W 74 - 0xFFFF1493, // Re 75 - 0xFFFF1493, // Os 76 - 0xFFFF1493, // Ir 77 - 0xFFFF1493, // Pt 78 + 0xFF70D3FF, // La 57 + 0xFFFFFFC6, // Ce 58 + 0xFFD8FFC6, // Pr 59 + 0xFFC6FFC6, // Nd 60 + 0xFFA3FFC6, // Pm 61 + 0xFF8EFFC6, // Sm 62 + 0xFF60FFC6, // Eu 63 + 0xFF44FFC6, // Gd 64 + 0xFF30FFC6, // Tb 65 + 0xFF1EFFC6, // Dy 66 + 0xFF00FF9B, // Ho 67 + 0xFF00E575, // Er 68 + 0xFF00D351, // Tm 69 + 0xFF00BF38, // Yb 70 + 0xFF00AA23, // Lu 71 + 0xFF4CC1FF, // Hf 72 + 0xFF4CA5FF, // Ta 73 + 0xFF2193D6, // W 74 + 0xFF267CAA, // Re 75 + 0xFF266696, // Os 76 + 0xFF165487, // Ir 77 + 0xFFF4EDD1, // Pt 78 0xFFDAA520, // Au 79 - 0xFFFF1493, // Hg 80 - 0xFFFF1493, // Tl 81 - 0xFFFF1493, // Pb 82 - 0xFFFF1493, // Bi 83 - 0xFFFF1493, // Po 84 - 0xFFFF1493, // At 85 - 0xFFFF1493, // Rn 86 - 0xFFFF1493, // Fr 87 - 0xFFFF1493, // Ra 88 - 0xFFFF1493, // Ac 89 - 0xFFFF1493, // Th 90 - 0xFFFF1493, // Pa 91 - 0xFFFF1493, // U 92 - 0xFFFF1493, // Np 93 - 0xFFFF1493, // Pu 94 - 0xFFFF1493, // Am 95 - 0xFFFF1493, // Cm 96 - 0xFFFF1493, // Bk 97 - 0xFFFF1493, // Cf 98 - 0xFFFF1493, // Es 99 - 0xFFFF1493, // Fm 100 - 0xFFFF1493, // Md 101 - 0xFFFF1493, // No 102 - 0xFFFF1493, // Lr 103 - 0xFFFF1493, // Rf 104 - 0xFFFF1493, // Db 105 - 0xFFFF1493, // Sg 106 - 0xFFFF1493, // Bh 107 - 0xFFFF1493, // Hs 108 - 0xFFFF1493, // Mt 109 + 0xFFB5B5C1, // Hg 80 + 0xFFA5544C, // Tl 81 + 0xFF565960, // Pb 82 + 0xFF9E4FB5, // Bi 83 + 0xFFAA5B00, // Po 84 + 0xFF754F44, // At 85 + 0xFF428296, // Rn 86 + 0xFF420066, // Fr 87 + 0xFF007C00, // Ra 88 + 0xFF70AAF9, // Ac 89 + 0xFF00BAFF, // Th 90 + 0xFF00A0FF, // Pa 91 + 0xFF008EFF, // U 92 + 0xFF007FFF, // Np 93 + 0xFF006BFF, // Pu 94 + 0xFF545BF2, // Am 95 + 0xFF775BE2, // Cm 96 + 0xFF894FE2, // Bk 97 + 0xFFA035D3, // Cf 98 + 0xFFB21ED3, // Es 99 + 0xFFB21EBA, // Fm 100 + 0xFFB20CA5, // Md 101 + 0xFFBC0C87, // No 102 + 0xFFC60066, // Lr 103 + 0xFFCC0059, // Rf 104 + 0xFFD1004F, // Db 105 + 0xFFD80044, // Sg 106 + 0xFFE00038, // Bh 107 + 0xFFE5002D, // Hs 108 + 0xFFEA0026, // Mt 109 }; static { |
From: Michael T Howard <michaelthoward@us...> - 2004-02-28 15:56:17
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/managers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29866/src/org/openscience/jmol/viewer/managers Modified Files: RepaintManager.java Log Message: add delay times for animations Index: RepaintManager.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/managers/RepaintManager.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- RepaintManager.java 27 Feb 2004 23:39:17 -0000 1.16 +++ RepaintManager.java 28 Feb 2004 15:38:53 -0000 1.17 @@ -98,7 +98,20 @@ // 1 = loop // 2 = palindrome public int animationReplayMode = 0; - public void setAnimationReplayMode(int animationReplayMode) { + public float leadInDelay, firstFrameDelay, lastFrameDelay; + int leadInDelayMs, firstFrameDelayMs, lastFrameDelayMs; + + public void setAnimationReplayMode(int animationReplayMode, + float leadInDelay, + float firstFrameDelay, + float lastFrameDelay) { + leadInDelayMs = + (int)((this.leadInDelay = leadInDelay > 0 ? leadInDelay : 0) * 1000); + firstFrameDelayMs = + (int)((this.firstFrameDelay = firstFrameDelay > 0 ? firstFrameDelay : 0) * 1000); + lastFrameDelayMs = + (int)((this.lastFrameDelay = lastFrameDelay > 0 ? lastFrameDelay : 0) * 1000); + if (animationReplayMode >= 0 && animationReplayMode <= 2) this.animationReplayMode = animationReplayMode; else @@ -253,7 +266,7 @@ setDisplayModelID(0); setAnimationDirection(1); setAnimationFps(10); - setAnimationReplayMode(0); + setAnimationReplayMode(0, 0, 0, 0); } public boolean animationOn = false; @@ -275,47 +288,64 @@ currentDirection = animationDirection; setDisplayModelIndex(animationDirection == 1 ? 0 : modelCount - 1); if (animationThread == null) { - animationThread = new AnimationThread(); + animationThread = new AnimationThread(modelCount); animationThread.start(); } this.animationOn = true; } class AnimationThread extends Thread implements Runnable { + final int modelCount; + final int lastModelIndex; + AnimationThread(int modelCount) { + this.modelCount = modelCount; + lastModelIndex = modelCount - 1; + } + public void run() { - int myFps = animationFps; + int accumulatedDelayTime = 0; int i = 0; - requestRepaintAndWait(); long timeBegin = System.currentTimeMillis(); - while (! isInterrupted()) { - if (myFps != animationFps) { - myFps = animationFps; - i = 0; - timeBegin = System.currentTimeMillis(); - } - if (! setAnimationNext()) { - setAnimationOn(false); - return; - } - ++i; - int targetTime = i * 1000 / myFps; - int currentTime = (int)(System.currentTimeMillis() - timeBegin); - int sleepTime = targetTime - currentTime; - if (sleepTime < 0) - continue; - refresh(); - currentTime = (int)(System.currentTimeMillis() - timeBegin); - sleepTime = targetTime - currentTime; - if (sleepTime > 0) { - try { - Thread.sleep(sleepTime); - } catch (InterruptedException e) { - // System.out.println("interrupt caught!"); - break; + int targetTime = 0; + int currentTime, sleepTime; + boolean firstTimeThrough = true; + requestRepaintAndWait(); + try { + targetTime += leadInDelayMs; + sleepTime = targetTime - (int)(System.currentTimeMillis() - timeBegin); + if (sleepTime > 0) + Thread.sleep(sleepTime); + while (! isInterrupted()) { + if (!firstTimeThrough && displayModelIndex == 0) { + targetTime += firstFrameDelayMs; + sleepTime = targetTime - (int)(System.currentTimeMillis() - timeBegin); + if (sleepTime > 0) + Thread.sleep(sleepTime); } + if (!firstTimeThrough && displayModelIndex == lastModelIndex) { + targetTime += lastFrameDelayMs; + sleepTime = targetTime - (int)(System.currentTimeMillis() - timeBegin); + if (sleepTime > 0) + Thread.sleep(sleepTime); + } + firstTimeThrough = false; + if (! setAnimationNext()) { + setAnimationOn(false); + return; + } + ++i; + targetTime += (1000 / animationFps); + sleepTime = targetTime - (int)(System.currentTimeMillis() - timeBegin); + if (sleepTime < 0) + continue; + refresh(); + sleepTime = targetTime - (int)(System.currentTimeMillis() - timeBegin); + if (sleepTime > 0) + Thread.sleep(sleepTime); } + } catch (InterruptedException ie) { + System.out.println("animation interrupted!"); } - } } } |
From: Michael T Howard <michaelthoward@us...> - 2004-02-28 15:56:16
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29866/src/org/openscience/jmol/viewer Modified Files: JmolConstants.java JmolViewer.java Log Message: add delay times for animations Index: JmolConstants.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/JmolConstants.java,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- JmolConstants.java 26 Feb 2004 14:49:30 -0000 1.46 +++ JmolConstants.java 28 Feb 2004 15:38:52 -0000 1.47 @@ -30,7 +30,7 @@ // for now, just update this by hand // perhaps use ant filter later ... but mth doesn't like it :-( - public static String version="10pre5"; + public static String version="10pre5a"; public final static String copyright="(C) 2004 The Jmol Development Team"; public final static byte LABEL_NONE = 0; Index: JmolViewer.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/JmolViewer.java,v retrieving revision 1.123 retrieving revision 1.124 diff -u -r1.123 -r1.124 --- JmolViewer.java 27 Feb 2004 23:39:17 -0000 1.123 +++ JmolViewer.java 28 Feb 2004 15:38:52 -0000 1.124 @@ -1155,11 +1155,15 @@ return repaintManager.animationFps; } - public void setAnimationReplayMode(int replay) { + public void setAnimationReplayMode(int replay, + float leadInDelay, + float firstFrameDelay, + float lastFrameDelay) { // 0 means once // 1 means loop // 2 means palindrome - repaintManager.setAnimationReplayMode(replay); + repaintManager.setAnimationReplayMode(replay, leadInDelay, + firstFrameDelay, lastFrameDelay); } public int getAnimationReplayMode() { return repaintManager.animationReplayMode; |
From: Michael T Howard <michaelthoward@us...> - 2004-02-28 15:56:16
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/script In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29866/src/org/openscience/jmol/viewer/script Modified Files: Eval.java Log Message: add delay times for animations Index: Eval.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/script/Eval.java,v retrieving revision 1.97 retrieving revision 1.98 diff -u -r1.97 -r1.98 --- Eval.java 27 Feb 2004 23:39:17 -0000 1.97 +++ Eval.java 28 Feb 2004 15:38:53 -0000 1.98 @@ -63,6 +63,7 @@ String errorMessage; Token[] statement; + int statementLength; JmolViewer viewer; Thread myThread; boolean terminationNotification; @@ -299,6 +300,7 @@ } while (!interruptExecution && pc < aatoken.length) { statement = aatoken[pc++]; + statementLength = statement.length; if (viewer.getDebugScript()) logDebugScript(); Token token = statement[0]; @@ -462,7 +464,7 @@ void logDebugScript() { strbufLog.setLength(0); strbufLog.append(statement[0].value.toString()); - for (int i = 1; i < statement.length; ++i) { + for (int i = 1; i < statementLength; ++i) { strbufLog.append(' '); Token token = statement[i]; switch (token.tok) { @@ -625,7 +627,7 @@ // as in set foo <boolean> void checkStatementLength(int length) throws ScriptException { - if (statement.length != length) + if (statementLength != length) badArgumentCount(); } @@ -1171,7 +1173,7 @@ Color getColorParam(int itoken) throws ScriptException { - if (itoken >= statement.length) + if (itoken >= statementLength) colorExpected(); if (statement[itoken].tok != Token.colorRGB) colorExpected(); @@ -1179,7 +1181,7 @@ } Color getColorOrNoneParam(int itoken) throws ScriptException { - if (itoken >= statement.length) + if (itoken >= statementLength) colorExpected(); if (statement[itoken].tok == Token.colorRGB) return new Color(statement[itoken].intValue); @@ -1198,7 +1200,7 @@ // but someplace in the rasmol doc it makes reference to the geometric // center as the default for rotations. who knows. void center() throws ScriptException { - if (statement.length == 1) { + if (statementLength == 1) { viewer.clearSelection(); } else { viewer.setSelectionSet(expression(statement, 1)); @@ -1207,7 +1209,7 @@ } void color() throws ScriptException { - if (statement.length > 3 || statement.length < 2) + if (statementLength > 3 || statementLength < 2) badArgumentCount(); int tok = statement[1].tok; switch (tok) { @@ -1355,7 +1357,7 @@ } void echo() throws ScriptException { - if (statement.length == 2 && statement[1].tok == Token.string) + if (statementLength == 2 && statement[1].tok == Token.string) viewer.scriptEcho((String)statement[1].value); else viewer.scriptEcho(""); @@ -1377,7 +1379,7 @@ ++i; if (statement[i].tok != Token.string) filenameExpected(); - if (statement.length != i + 1) + if (statementLength != i + 1) badArgumentCount(); String filename = (String)statement[i].value; viewer.openFile(filename); @@ -1389,11 +1391,11 @@ } void monitor() throws ScriptException { - if (statement.length == 1) { + if (statementLength == 1) { viewer.setShowMeasurements(true); return; } - if (statement.length == 2) { + if (statementLength == 2) { if (statement[1].tok == Token.on) viewer.setShowMeasurements(true); else if (statement[1].tok == Token.off) @@ -1402,13 +1404,13 @@ booleanExpected(); return; } - if (statement.length < 3 || statement.length > 5) + if (statementLength < 3 || statementLength > 5) badArgumentCount(); - for (int i = 1; i < statement.length; ++i) { + for (int i = 1; i < statementLength; ++i) { if (statement[i].tok != Token.integer) integerExpected(); } - int argCount = statement.length - 1; + int argCount = statementLength - 1; int numAtoms = viewer.getAtomCount(); int[] args = new int[argCount]; for (int i = 0; i < argCount; ++i) { @@ -1450,7 +1452,7 @@ } void rotate() throws ScriptException { - if (statement.length < 2) + if (statementLength < 2) axisExpected(); switch (statement[1].tok) { case Token.x: @@ -1460,7 +1462,7 @@ default: axisExpected(); } - if (statement.length != 3 || statement[2].tok != Token.integer) + if (statementLength != 3 || statement[2].tok != Token.integer) integerExpected(); int degrees = statement[2].intValue; switch (statement[1].tok) { @@ -1514,7 +1516,7 @@ void select() throws ScriptException { // NOTE this is called by restrict() - if (statement.length == 1) { + if (statementLength == 1) { viewer.selectAll(); if (!viewer.getRasmolHydrogenSetting()) viewer.excludeSelectionSet(getHydrogenSet()); @@ -1596,9 +1598,9 @@ } void move() throws ScriptException { - if (statement.length < 10 || statement.length > 12) + if (statementLength < 10 || statementLength > 12) badArgumentCount(); - for (int i = 1; i < statement.length; ++i) + for (int i = 1; i < statementLength; ++i) if (statement[i].tok != Token.integer) integerExpected(); int dRotX = statement[1].intValue; @@ -1611,9 +1613,9 @@ int dSlab = statement[8].intValue; int secondsTotal = statement[9].intValue; int fps = 30, maxAccel = 5; - if (statement.length > 10) { + if (statementLength > 10) { fps = statement[10].intValue; - if (statement.length > 11) + if (statementLength > 11) maxAccel = statement[11].intValue; } @@ -1690,10 +1692,10 @@ void cpk() throws ScriptException { short mar = 0; int tok = Token.on; - if (statement.length > 1) { + if (statementLength > 1) { tok = statement[1].tok; - if (! ((statement.length == 2) || - (statement.length == 3 && + if (! ((statementLength == 2) || + (statementLength == 3 && tok == Token.integer && statement[2].tok == Token.percent))) { badArgumentCount(); @@ -1707,7 +1709,7 @@ break; case Token.integer: int radiusRasMol = statement[1].intValue; - if (statement.length == 2) { + if (statementLength == 2) { if (radiusRasMol >= 500 || radiusRasMol < -100) numberOutOfRange(); mar = (short)radiusRasMol; @@ -1823,7 +1825,7 @@ } void animation() throws ScriptException { - if (statement.length < 2) + if (statementLength < 2) subcommandExpected(); int tok = statement[1].tok; boolean animate = false; @@ -1854,7 +1856,8 @@ } void animationMode() throws ScriptException { - checkStatementLength(3); + if (statementLength != 3 && statementLength != 6) + badArgumentCount(); int animationMode = 0; switch (statement[2].tok) { case Token.loop: @@ -1870,7 +1873,25 @@ } unrecognizedSubcommand(); } - viewer.setAnimationReplayMode(animationMode); + viewer.setAnimationReplayMode(animationMode, + getFloat(3), getFloat(4), getFloat(5)); + } + + float getFloat(int index) throws ScriptException { + float f = 0; + if (index < statementLength) { + switch (statement[index].tok) { + case Token.integer: + f = statement[index].intValue; + break; + case Token.decimal: + f = ((Float)statement[index].value).floatValue(); + break; + default: + numberExpected(); + } + } + return f; } void animationDirection() throws ScriptException { @@ -2225,7 +2246,7 @@ void setFontsize() throws ScriptException { int fontsize = 8; - if (statement.length == 3) { + if (statementLength == 3) { fontsize=getSetInteger(); if (fontsize > 72) numberOutOfRange(); @@ -2288,8 +2309,7 @@ } void setSolvent() throws ScriptException { - if (statement.length != 3) - badArgumentCount(); + checkLength3(); float probeRadius = 0; switch (statement[2].tok) { case Token.on: @@ -2313,7 +2333,7 @@ void setStrands() throws ScriptException { int strandCount = 5; - if (statement.length == 3) { + if (statementLength == 3) { if (statement[2].tok != Token.integer) integerExpected(); strandCount = statement[2].intValue; @@ -2324,8 +2344,7 @@ } void setSpecular() throws ScriptException { - if (statement.length != 3) - booleanOrNumberExpected(); + checkLength3(); if (statement[2].tok == Token.integer) viewer.setSpecularPercent(getSetInteger()); else @@ -2366,8 +2385,7 @@ } void setSsbonds() throws ScriptException { - if (statement.length != 3) - badArgumentCount(); + checkLength3(); boolean ssbondsBackbone = false; switch(statement[2].tok) { case Token.backbone: @@ -2382,8 +2400,7 @@ } void setHbonds() throws ScriptException { - if (statement.length != 3) - badArgumentCount(); + checkLength3(); boolean hbondsBackbone = false; switch(statement[2].tok) { case Token.backbone: @@ -2398,8 +2415,7 @@ } void setScale3d() throws ScriptException { - if (statement.length != 3) - badArgumentCount(); + checkLength3(); float angstromsPerInch = 0; switch (statement[2].tok) { case Token.decimal: |
From: Egon Willighagen <egonw@us...> - 2004-02-28 09:49:39
|
Update of /cvsroot/jmol/Jmol/jars In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3016 Added Files: gnujaxp-onlysax.jar Log Message: Added binary sax only GNU xml parsing library |
From: Michael T Howard <michaelthoward@us...> - 2004-02-28 08:09:24
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/adapters In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19194/src/org/openscience/jmol/adapters Modified Files: SimpleModelAdapter.java Log Message: made model adapter more flexible when receiving pdb MODEL number Index: SimpleModelAdapter.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/adapters/SimpleModelAdapter.java,v retrieving revision 1.47 retrieving revision 1.48 diff -u -r1.47 -r1.48 --- SimpleModelAdapter.java 26 Feb 2004 09:22:06 -0000 1.47 +++ SimpleModelAdapter.java 28 Feb 2004 07:52:14 -0000 1.48 @@ -521,6 +521,7 @@ class PdbModel extends Model { String line; + int lineLength; // index into atoms array + 1 // so that 0 can be used for the null value int currentModelNumber; @@ -533,6 +534,7 @@ fileHeader = ""; boolean accumulatingHeader = true; while ((line = reader.readLine()) != null) { + lineLength = line.length(); if (line.startsWith("ATOM ") || line.startsWith("HETATM")) { atom(); @@ -576,7 +578,7 @@ accumulatingHeader = false; continue; } - if (line.startsWith("HEADER") && line.length() >= 66) { + if (line.startsWith("HEADER") && lineLength >= 66) { setModelName(line.substring(62, 66)); continue; } @@ -597,7 +599,7 @@ char charAlternateLocation = line.charAt(16); if (charAlternateLocation != ' ' && charAlternateLocation != 'A') return; - int len = line.length(); + int len = lineLength; String elementSymbol = (len >= 78 ? line.substring(76, 78).trim() : ""); int cchAtomicSymbol = elementSymbol.length(); if (cchAtomicSymbol == 0 || @@ -703,7 +705,7 @@ int getTargetSerial(int i) { int offset = i * 5 + 11; int offsetEnd = offset + 5; - if (offsetEnd <= line.length()) { + if (offsetEnd <= lineLength) { String str = line.substring(offset, offsetEnd).trim(); if (str.length() > 0) { try { @@ -726,8 +728,23 @@ } void model() { + /**************************************************************** + * mth 2004 02 28 + * note that the pdb spec says: + * COLUMNS DATA TYPE FIELD DEFINITION + * ---------------------------------------------------------------------- + * 1 - 6 Record name "MODEL " + * 11 - 14 Integer serial Model serial number. + * + * but I received a file with the serial number right after the word MODEL :-( + ****************************************************************/ try { - int modelNumber = Integer.parseInt(line.substring(10, 14).trim()); + int startModelColumn = 6; // should be 10 0-based + int endModelColumn = 14; + if (endModelColumn > lineLength) + endModelColumn = lineLength; + int modelNumber = + Integer.parseInt(line.substring(startModelColumn, endModelColumn).trim()); if (modelNumber != currentModelNumber + 1) System.out.println("Model number sequence seems confused"); currentModelNumber = modelNumber; |
From: Michael T Howard <michaelthoward@us...> - 2004-02-27 23:56:12
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/script In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10155/src/org/openscience/jmol/viewer/script Modified Files: Eval.java Log Message: debugging animations when a new model is loade Index: Eval.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/script/Eval.java,v retrieving revision 1.96 retrieving revision 1.97 diff -u -r1.96 -r1.97 --- Eval.java 27 Feb 2004 23:11:24 -0000 1.96 +++ Eval.java 27 Feb 2004 23:39:17 -0000 1.97 @@ -2045,7 +2045,7 @@ switch(statement[offset].tok) { case Token.all: case Token.asterisk: - modelID = -1; + modelID = 0; case Token.none: break; case Token.integer: |
From: Michael T Howard <michaelthoward@us...> - 2004-02-27 23:56:12
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/managers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10155/src/org/openscience/jmol/viewer/managers Modified Files: RepaintManager.java Log Message: debugging animations when a new model is loade Index: RepaintManager.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/managers/RepaintManager.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- RepaintManager.java 27 Feb 2004 23:11:24 -0000 1.15 +++ RepaintManager.java 27 Feb 2004 23:39:17 -0000 1.16 @@ -77,9 +77,11 @@ } public int animationDirection = 1; + int currentDirection = 1; public void setAnimationDirection(int animationDirection) { - if (animationDirection == 1 || animationDirection == -1) - this.animationDirection = animationDirection; + if (animationDirection == 1 || animationDirection == -1) { + this.animationDirection = currentDirection = animationDirection; + } else System.out.println("invalid animationDirection:" + animationDirection); } @@ -113,7 +115,7 @@ public boolean setAnimationRelative(int direction) { if (displayModelID == 0) return false; - int modelIndexNext = displayModelIndex + direction; + int modelIndexNext = displayModelIndex + currentDirection; /* System.out.println("setAnimationRelative: displayModel=" + displayModel + " modelIndex=" + modelIndex + @@ -132,7 +134,7 @@ modelIndexNext = 0; break; case 2: - animationDirection = -1; + currentDirection = -1; modelIndexNext = modelCount - 2; } } else if (modelIndexNext < 0) { @@ -143,7 +145,7 @@ modelIndexNext = modelCount -1; break; case 2: - animationDirection = 1; + currentDirection = 1; modelIndexNext = 1; } } @@ -246,25 +248,37 @@ } + public void clearAnimation() { + setAnimationOn(false); + setDisplayModelID(0); + setAnimationDirection(1); + setAnimationFps(10); + setAnimationReplayMode(0); + } + public boolean animationOn = false; AnimationThread animationThread; public void setAnimationOn(boolean animationOn) { - int modelCount = viewer.getModelCount(); - if (modelCount <= 1) - animationOn = false; - if (animationOn) { - setDisplayModelIndex(animationDirection == 1 ? 0 : modelCount - 1); - if (animationThread == null) { - animationThread = new AnimationThread(); - animationThread.start(); - } - } else { + if (! animationOn || ! viewer.haveFrame()) { if (animationThread != null) { animationThread.interrupt(); animationThread = null; } + this.animationOn = false; + return; + } + int modelCount = viewer.getModelCount(); + if (modelCount <= 1) { + this.animationOn = false; + return; + } + currentDirection = animationDirection; + setDisplayModelIndex(animationDirection == 1 ? 0 : modelCount - 1); + if (animationThread == null) { + animationThread = new AnimationThread(); + animationThread.start(); } - this.animationOn = animationOn; + this.animationOn = true; } class AnimationThread extends Thread implements Runnable { |