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
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2019 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2021 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(13) |
Aug
(39) |
Sep
(8) |
Oct
(7) |
Nov
(25) |
Dec
(16) |
2022 |
Jan
(26) |
Feb
(30) |
Mar
(31) |
Apr
(16) |
May
(12) |
Jun
(7) |
Jul
(15) |
Aug
(24) |
Sep
(4) |
Oct
(10) |
Nov
(7) |
Dec
(5) |
2023 |
Jan
(7) |
Feb
(2) |
Mar
(4) |
Apr
(1) |
May
|
Jun
(3) |
Jul
(13) |
Aug
(14) |
Sep
(17) |
Oct
(3) |
Nov
(13) |
Dec
(6) |
2024 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael T H. <mic...@us...> - 2003-02-06 00:25:59
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol In directory sc8-pr-cvs1:/tmp/cvs-serv30597/src/org/openscience/jmol Modified Files: Atom.java ChemFrame.java Log Message: changes to get cdk initialized properly + to get it to work on msft jvm Index: Atom.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/Atom.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -r1.47 -r1.48 *** Atom.java 3 Feb 2003 21:43:57 -0000 1.47 --- Atom.java 6 Feb 2003 00:25:51 -0000 1.48 *************** *** 31,35 **** import javax.vecmath.Point3d; import javax.vecmath.Matrix4d; - import org.openscience.cdk.tools.IsotopeFactory; /** --- 31,34 ---- Index: ChemFrame.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/ChemFrame.java,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -r1.92 -r1.93 *** ChemFrame.java 5 Feb 2003 11:33:07 -0000 1.92 --- ChemFrame.java 6 Feb 2003 00:25:51 -0000 1.93 *************** *** 20,23 **** --- 20,24 ---- import org.openscience.cdk.AtomContainer; + import org.openscience.cdk.tools.AtomTypeFactory; import java.beans.PropertyChangeSupport; import java.beans.PropertyChangeListener; *************** *** 45,49 **** private int numberOfAtoms = 0; ! private org.openscience.cdk.tools.AtomTypeFactory atf = null; Point3d centerBoundingBox; --- 46,50 ---- private int numberOfAtoms = 0; ! private AtomTypeFactory atomTypeFactory = null; Point3d centerBoundingBox; *************** *** 69,79 **** atoms = new Atom[na]; this.bondsEnabled = bondsEnabled; } public ChemFrame(boolean bondsEnabled) { this(100, bondsEnabled); - try { - this.atf = new org.openscience.cdk.tools.AtomTypeFactory("org/openscience/cdk/config/jmol_atomtypes.txt"); - } catch (Exception exc) {} } --- 70,84 ---- atoms = new Atom[na]; this.bondsEnabled = bondsEnabled; + try { + System.out.println("Here we go!"); + atomTypeFactory = new AtomTypeFactory( + "org/openscience/cdk/config/jmol_atomtypes.txt"); + } catch (Exception exc) { + System.out.println("failure opening AtomTypeFactory:" + exc); + } } public ChemFrame(boolean bondsEnabled) { this(100, bondsEnabled); } *************** *** 202,207 **** atoms[i] = new Atom(type, numberOfAtoms, x, y, z, pprop); ! if (atf != null) atf.configure(atoms[i]); ! if (DisplayControl.control.getAutoBond()) { for (int j = 0; j < i; j++) { --- 207,212 ---- atoms[i] = new Atom(type, numberOfAtoms, x, y, z, pprop); ! if (atomTypeFactory != null) ! atomTypeFactory.configure(atoms[i]); if (DisplayControl.control.getAutoBond()) { for (int j = 0; j < i; j++) { |
From: Michael T H. <mic...@us...> - 2003-02-06 00:25:59
|
Update of /cvsroot/jmol/Jmol/jars In directory sc8-pr-cvs1:/tmp/cvs-serv30597/jars Modified Files: jmolcdk.jar Log Message: changes to get cdk initialized properly + to get it to work on msft jvm Index: jmolcdk.jar =================================================================== RCS file: /cvsroot/jmol/Jmol/jars/jmolcdk.jar,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 Binary files /tmp/cvsOfPy2a and /tmp/cvs2PkB7h differ |
From: Michael T H. <mic...@us...> - 2003-02-05 22:24:21
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/applet In directory sc8-pr-cvs1:/tmp/cvs-serv14792/src/org/openscience/jmol/applet Modified Files: AppletCanvas.java Removed Files: JmolApplet.java Log Message: changed applet root to simplify HTML coding. Now read AtomTypes.txt from jar. Index: AppletCanvas.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/applet/AppletCanvas.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** AppletCanvas.java 4 Feb 2003 19:19:32 -0000 1.10 --- AppletCanvas.java 5 Feb 2003 22:24:11 -0000 1.11 *************** *** 33,37 **** import java.awt.event.ComponentAdapter; ! class AppletCanvas extends Canvas { private DisplayControl control; --- 33,37 ---- import java.awt.event.ComponentAdapter; ! public class AppletCanvas extends Canvas { private DisplayControl control; --- JmolApplet.java DELETED --- |
From: Michael T H. <mic...@us...> - 2003-02-05 22:24:15
|
Update of /cvsroot/jmol/Jmol/src In directory sc8-pr-cvs1:/tmp/cvs-serv14792/src Added Files: JmolApplet.java Log Message: changed applet root to simplify HTML coding. Now read AtomTypes.txt from jar. --- NEW FILE: JmolApplet.java --- /* * Copyright 2002 The Jmol Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ import org.openscience.jmol.applet.*; import org.openscience.jmol.DisplayControl; import org.openscience.jmol.AtomTypeSet; import org.openscience.jmol.script.Eval; import java.applet.Applet; import java.awt.Canvas; import java.awt.Graphics; import java.awt.event.MouseEvent; import java.awt.event.MouseAdapter; import java.awt.event.KeyEvent; import java.awt.event.KeyAdapter; import java.awt.event.ComponentListener; import java.io.InputStream; import java.io.IOException; import java.net.URL; import org.openscience.jmol.io.ReaderProgress; import org.openscience.jmol.io.ReaderFactory; import org.openscience.jmol.StatusDisplay; import org.openscience.jmol.FortranFormat; import org.openscience.jmol.io.ChemFileReader; import org.openscience.jmol.io.CMLReader; public class JmolApplet extends Applet implements StatusDisplay { AppletCanvas canvas; DisplayControl control; private String defaultAtomTypesFileName = "Data/AtomTypes.txt"; public String getAppletInfo() { return appletInfo; } private static String appletInfo = "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" }, { "rasmolScript", "url", "URL of RasMol/Chime script" }, { "rasmolScriptInline", "string", "Inline RasMol/Chime commands separated by newlines or semicolons" } }; public String[][] getParameterInfo() { return paramInfo; } public void init() { initWindows(); initApplication(); } public void initWindows() { String strJvmVersion = System.getProperty("java.version"); canvas = new AppletCanvas(); control = new DisplayControl(strJvmVersion, canvas); canvas.setDisplayControl(control); control.setAppletDocumentBase(getDocumentBase()); setLayout(new java.awt.BorderLayout()); add(canvas, "Center"); } public void initApplication() { control.pushHoldRepaint(); { control.setShowBonds(true); control.setShowAtoms(true); control.setPercentVdwAtom(20); control.zoomToPercent(100); control.setStyleBond(DisplayControl.SHADING); control.setStyleAtom(DisplayControl.SHADING); setBackgroundColor(getParameter("bgcolor")); setStyle(getParameter("style")); setLabel(getParameter("label")); setAtomPropertiesFromFile(getParameter("atomTypes")); String wfr = getParameter("wireframeRotation"); setWireframeRotation(wfr != null && (wfr.equalsIgnoreCase("on") || wfr.equalsIgnoreCase("true"))); load(getParameter("load")); loadInline(getParameter("loadInline")); rasmolScript(getParameter("rasmolScript")); rasmolScriptInline(getParameter("rasmolScriptInline")); } control.popHoldRepaint(); } public void setStatusMessage(String statusMessage) { showStatus(statusMessage); } //METHODS FOR JAVASCRIPT /**************************************************************** * These methods are intended for use from JavaScript via LiveConnect * * Note that there are some bug in LiveConnect implementations that * place some restrictions on the names of the functions in this file. * For example, LiveConnect on Netscape 4.7 will get confused if you * overload a method name with different parameter signatures ... * ... even if one of the methods is private * mth 2003 02 ****************************************************************/ /** * <b>For Javascript:<\b> Takes the argument, reads it as a file and allocates this as the current atom types- eg radius etc. * @param atomTypesFile The filename of the properties we want. */ public void setAtomPropertiesFromFile(String atomTypesFile) { try { InputStream atis = null; if (atomTypesFile == null || atomTypesFile.length() == 0) { atis = getClass().getResourceAsStream(defaultAtomTypesFileName); atomTypesFile = defaultAtomTypesFileName + "(default)"; } else { URL atURL = new URL(getDocumentBase(), atomTypesFile); atis = atURL.openStream(); } if (atis == null) { System.err.println("Unable to open the atom types file:" + atomTypesFile); return; } AtomTypeSet ats1 = new AtomTypeSet(); ats1.load(atis); } catch (IOException e) { System.err.println("IOException reading atom properties:" + e); } } /** * <b>For Javascript:<\b> Takes the argument, reads it as a URL and allocates this as the current atom types- eg radius etc. * @param propertiesFileURL The URL of the properties we want. */ public void setAtomPropertiesFromURL(String propertiesURL) { // myBean.setAtomPropertiesFromURL(propertiesURL); } public void setBackgroundColor(String colorInHex) { if (colorInHex != null && colorInHex.length() > 0) control.setColorBackground(colorInHex); } private final String[] styleStrings = {"QUICKDRAW", "SHADED", "WIREFRAME"}; private final byte[] styles = {DisplayControl.QUICKDRAW, DisplayControl.SHADING, DisplayControl.WIREFRAME}; public void setStyle(String style) { for (int i = 0; i < styleStrings.length; ++i) { if (styleStrings[i].equalsIgnoreCase(style)) { control.setStyleAtom(styles[i]); control.setStyleBond(styles[i]); return; } } } private final String[] labelStyleStrings = {"NONE","SYMBOL","NUMBER"}; private final byte[] labelStyles = {DisplayControl.NOLABELS, DisplayControl.SYMBOLS, DisplayControl.NUMBERS}; public void setLabel(String style) { for (int i = 0; i < labelStyles.length; ++i) { if (labelStyleStrings[i].equalsIgnoreCase(style)) { control.setStyleLabel(labelStyles[i]); return; } } } public void setPerspectiveDepth(boolean perspectiveDepth) { control.setPerspectiveDepth(perspectiveDepth); } public void setWireframeRotation(boolean wireframeRotation) { control.setWireframeRotation(wireframeRotation); } public void rasmolScript(String scriptName) { String strError = control.evalFile(scriptName); setStatusMessage(strError); } public void rasmolScriptInline(String script) { String strError = control.eval(script); setStatusMessage(strError); } public void load(String modelName) { if (modelName != null) { String strError = control.openFile(modelName); setStatusMessage(strError); } } public void loadInline(String strModel) { if (strModel != null) { String strError = control.openStringInline(strModel); setStatusMessage(strError); } } } |
From: Michael T H. <mic...@us...> - 2003-02-05 22:24:15
|
Update of /cvsroot/jmol/Jmol In directory sc8-pr-cvs1:/tmp/cvs-serv14792 Modified Files: applet.classes build.xml Log Message: changed applet root to simplify HTML coding. Now read AtomTypes.txt from jar. Index: applet.classes =================================================================== RCS file: /cvsroot/jmol/Jmol/applet.classes,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -r1.21 -r1.22 *** applet.classes 5 Feb 2003 15:58:15 -0000 1.21 --- applet.classes 5 Feb 2003 22:24:09 -0000 1.22 *************** *** 1,3 **** - org/openscience/jmol/applet/JmolApplet.java org/openscience/jmol/applet/AppletCanvas.java org/openscience/jmol/applet/NonJavaSort.java --- 1,2 ---- Index: build.xml =================================================================== RCS file: /cvsroot/jmol/Jmol/build.xml,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -r1.45 -r1.46 *** build.xml 5 Feb 2003 15:58:16 -0000 1.45 --- build.xml 5 Feb 2003 22:24:10 -0000 1.46 *************** *** 187,198 **** <javac srcdir="${source.dir}" destdir="${applet.classes.dir}" debug="on" deprecation="on" target="1.1" ! includesfile="applet.classes"> ! <classpath refid="project.class.path" /> ! </javac> <copy todir="${applet.classes.dir}" > <fileset dir="${source.dir}"> - <include name="**/applet/Data/*" /> <include name="**/*.dtd" /> <include name="**/*.txt" /> </fileset> </copy> --- 187,201 ---- <javac srcdir="${source.dir}" destdir="${applet.classes.dir}" debug="on" deprecation="on" target="1.1" ! includesfile="applet.classes" classpathref="project.class.path" /> ! <javac srcdir="${source.dir}" destdir="${applet.classes.dir}" ! debug="on" deprecation="on" target="1.1" ! includes="JmolApplet.java" classpathref="project.class.path" /> <copy todir="${applet.classes.dir}" > <fileset dir="${source.dir}"> <include name="**/*.dtd" /> <include name="**/*.txt" /> + </fileset> + <fileset dir="${source.dir}/org/openscience/jmol/applet"> + <include name="Data/AtomTypes.txt" /> </fileset> </copy> |
From: Michael T H. <mic...@us...> - 2003-02-05 18:06:18
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol In directory sc8-pr-cvs1:/tmp/cvs-serv431 Modified Files: DisplayControl.java Log Message: JVM 1.1 did not have Math.toRadians() Index: DisplayControl.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/DisplayControl.java,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -r1.90 -r1.91 *** DisplayControl.java 5 Feb 2003 15:58:17 -0000 1.90 --- DisplayControl.java 5 Feb 2003 18:06:12 -0000 1.91 *************** *** 210,220 **** public void rotateToX(int angleDegrees) { ! rotateToX(Math.toRadians(angleDegrees)); } public void rotateToY(int angleDegrees) { ! rotateToY(Math.toRadians(angleDegrees)); } public void rotateToZ(int angleDegrees) { ! rotateToZ(Math.toRadians(angleDegrees)); } --- 210,220 ---- public void rotateToX(int angleDegrees) { ! rotateToX(toRadians(angleDegrees)); } public void rotateToY(int angleDegrees) { ! rotateToY(toRadians(angleDegrees)); } public void rotateToZ(int angleDegrees) { ! rotateToZ(toRadians(angleDegrees)); } *************** *** 232,242 **** } public void rotateByX(int angleDegrees) { ! rotateByX(Math.toRadians(angleDegrees)); } public void rotateByY(int angleDegrees) { ! rotateByY(Math.toRadians(angleDegrees)); } public void rotateByZ(int angleDegrees) { ! rotateByZ(Math.toRadians(angleDegrees)); } --- 232,246 ---- } public void rotateByX(int angleDegrees) { ! rotateByX(toRadians(angleDegrees)); } public void rotateByY(int angleDegrees) { ! rotateByY(toRadians(angleDegrees)); } public void rotateByZ(int angleDegrees) { ! rotateByZ(toRadians(angleDegrees)); ! } ! ! public static double toRadians(int degrees) { ! return degrees / 360.0 * 2 * Math.PI; } |
From: Michael T H. <mic...@us...> - 2003-02-05 16:35:06
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/script In directory sc8-pr-cvs1:/tmp/cvs-serv19168 Modified Files: Token.java Log Message: added hydrogens as alias for hydrogen to scripting Index: Token.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/script/Token.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** Token.java 4 Feb 2003 09:47:17 -0000 1.17 --- Token.java 5 Feb 2003 16:35:03 -0000 1.18 *************** *** 465,468 **** --- 465,469 ---- "hetero", new Token(hetero, "hetero"), "hydrogen", new Token(hydrogen, "hydrogen"), + "hydrogens", null, "selected", new Token(selected, "selected"), "solvent", new Token(solvent, "solvent"), |
From: Michael T H. <mic...@us...> - 2003-02-05 15:58:54
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/app In directory sc8-pr-cvs1:/tmp/cvs-serv3245/src/org/openscience/jmol/app Modified Files: Jmol.java Measure.java MeasurementList.java Log Message: completed separation of measures from UI Index: Jmol.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/app/Jmol.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Jmol.java 5 Feb 2003 11:33:08 -0000 1.2 --- Jmol.java 5 Feb 2003 15:58:18 -0000 1.3 *************** *** 276,280 **** meas.setMeasurementList(mlist); display.setMeasure(meas); ! control.setMeasureMouse(meas); // mlist.addMeasurementListListener(display); port.add(display); --- 276,280 ---- meas.setMeasurementList(mlist); display.setMeasure(meas); ! control.setMeasureWatcher(meas); // mlist.addMeasurementListListener(display); port.add(display); Index: Measure.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/app/Measure.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** Measure.java 4 Feb 2003 22:05:45 -0000 1.1 --- Measure.java 5 Feb 2003 15:58:19 -0000 1.2 *************** *** 26,35 **** import org.openscience.jmol.Atom; - import org.openscience.jmol.ChemFile; import org.openscience.jmol.ChemFrame; import org.openscience.jmol.DisplayControl; ! import org.openscience.jmol.render.Angle; ! import org.openscience.jmol.render.Distance; ! import org.openscience.jmol.render.Dihedral; import java.io.File; --- 26,32 ---- import org.openscience.jmol.Atom; import org.openscience.jmol.ChemFrame; import org.openscience.jmol.DisplayControl; ! import org.openscience.jmol.MeasureWatcher; import java.io.File; *************** *** 71,75 **** * @author J. Daniel Gezelter */ ! public class Measure extends JDialog { private final static int ADD = 1; --- 68,72 ---- * @author J. Daniel Gezelter */ ! public class Measure extends JDialog implements MeasureWatcher { private final static int ADD = 1; *************** *** 85,89 **** -1, -1, -1, -1 }; - private ChemFile cf; private DisplayControl control; --- 82,85 ---- Index: MeasurementList.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/app/MeasurementList.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** MeasurementList.java 5 Feb 2003 11:33:09 -0000 1.2 --- MeasurementList.java 5 Feb 2003 15:58:19 -0000 1.3 *************** *** 222,257 **** public void addDistance(int atom1, int atom2) { ! addDistance(new Distance(atom1, atom2)); ! } ! ! public void addDistance(Distance d) { ! distanceList.addElement(d); distances.update(); treeModel.reload(distances); - notifyControl(); } public void addAngle(int atom1, int atom2, int atom3) { ! addAngle(new Angle(atom1, atom2, atom3)); ! } ! ! public void addAngle(Angle a) { ! ! angleList.addElement(a); angles.update(); treeModel.reload(angles); - notifyControl(); } public void addDihedral(int atom1, int atom2, int atom3, int atom4) { ! addDihedral(new Dihedral(atom1, atom2, atom3, atom4)); ! } ! ! public void addDihedral(Dihedral d) { ! dihedralList.addElement(d); dihedrals.update(); treeModel.reload(dihedrals); - notifyControl(); } public void clear() { --- 222,242 ---- public void addDistance(int atom1, int atom2) { ! control.defineMeasure(atom1, atom2); distances.update(); treeModel.reload(distances); } public void addAngle(int atom1, int atom2, int atom3) { ! control.defineMeasure(atom1, atom2, atom3); angles.update(); treeModel.reload(angles); } public void addDihedral(int atom1, int atom2, int atom3, int atom4) { ! control.defineMeasure(atom1, atom2, atom3, atom4); dihedrals.update(); treeModel.reload(dihedrals); } + public void clear() { |
From: Michael T H. <mic...@us...> - 2003-02-05 15:58:52
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol In directory sc8-pr-cvs1:/tmp/cvs-serv3245/src/org/openscience/jmol Modified Files: DisplayControl.java ModelManager.java MouseManager.java Added Files: MeasureWatcher.java MeasurementManager.java Removed Files: Measurement.java Log Message: completed separation of measures from UI --- NEW FILE: MeasureWatcher.java --- /* * Copyright 2002 The Jmol Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package org.openscience.jmol; public interface MeasureWatcher { public void firePicked(int iatom); } --- NEW FILE: MeasurementManager.java --- /* $RCSfile: MeasurementManager.java,v $ * $Author: michaelthoward $ * $Date: 2003/02/05 15:58:17 $ * $Revision: 1.1 $ * * Copyright (C) 2003 The Jmol Development Team * * Contact: jmo...@li... * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package org.openscience.jmol; import org.openscience.jmol.Atom; import org.openscience.jmol.render.Distance; import org.openscience.jmol.render.Angle; import org.openscience.jmol.render.Dihedral; import java.util.BitSet; import java.util.Vector; import javax.vecmath.Point3d; import java.awt.Rectangle; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; public class MeasurementManager { DisplayControl control; public MeasurementManager(DisplayControl control) { this.control = control; } public Vector distanceMeasurements = new Vector(); public Vector angleMeasurements = new Vector(); public Vector dihedralMeasurements = new Vector(); public void clearMeasurements() { distanceMeasurements.removeAllElements(); angleMeasurements.removeAllElements(); dihedralMeasurements.removeAllElements(); } public void defineMeasure(int[] atoms) { switch (atoms.length) { case 2: defineMeasure(atoms[0], atoms[1]); break; case 3: defineMeasure(atoms[0], atoms[1], atoms[2]); break; case 4: defineMeasure(atoms[0], atoms[1], atoms[2], atoms[3]); break; default: control.logError("unrecognized number of args to defineMeasure"); } } public void defineMeasure(int iatom1, int iatom2) { ChemFrame cf = control.getFrame(); Distance dist = new Distance(iatom1, cf.getJmolAtomAt(iatom1), iatom2, cf.getJmolAtomAt(iatom2)); distanceMeasurements.addElement(dist); } public void defineMeasure(int iatom1, int iatom2, int iatom3) { ChemFrame cf = control.getFrame(); Angle angle = new Angle(iatom1, cf.getJmolAtomAt(iatom1), iatom2, cf.getJmolAtomAt(iatom2), iatom3, cf.getJmolAtomAt(iatom3)); angleMeasurements.addElement(angle); } public void defineMeasure(int iatom1, int iatom2, int iatom3, int iatom4) { ChemFrame cf = control.getFrame(); Dihedral dihedral = new Dihedral(iatom1, cf.getJmolAtomAt(iatom1), iatom2, cf.getJmolAtomAt(iatom2), iatom3, cf.getJmolAtomAt(iatom3), iatom4, cf.getJmolAtomAt(iatom4)); dihedralMeasurements.addElement(dihedral); } } Index: DisplayControl.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/DisplayControl.java,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -r1.89 -r1.90 *** DisplayControl.java 5 Feb 2003 11:33:08 -0000 1.89 --- DisplayControl.java 5 Feb 2003 15:58:17 -0000 1.90 *************** *** 25,30 **** package org.openscience.jmol; - import org.openscience.jmol.app.Measure; - import org.openscience.jmol.render.AtomRenderer; import org.openscience.jmol.render.BondRenderer; --- 25,28 ---- *************** *** 70,73 **** --- 68,72 ---- public LabelManager labelManager; public AxesManager axesManager; + public MeasurementManager measurementManager; public ChemFrameRenderer frameRenderer; public MeasureRenderer measureRenderer; *************** *** 101,104 **** --- 100,104 ---- labelManager = new LabelManager(this); axesManager = new AxesManager(this); + measurementManager = new MeasurementManager(this); distributor = new Distributor(this); *************** *** 698,705 **** } - public void setMeasureMouse(Measure measure) { - mouseManager.setMeasure(measure); - } - public Rectangle getRubberBandSelection() { return mouseManager.getRubberBand(); --- 698,701 ---- *************** *** 751,754 **** --- 747,751 ---- // but perhaps not if we are in the midst of executing a script? eval.clearDefinitionsAndLoadPredefined(); + clearMeasurements(); control.setStructuralChange(); control.popHoldRepaint(); *************** *** 797,800 **** --- 794,798 ---- selectAll(); recalcAxes(); + clearMeasurements(); structuralChange = true; refresh(); *************** *** 805,808 **** --- 803,807 ---- selectAll(); recalcAxes(); + clearMeasurements(); structuralChange = true; refresh(); *************** *** 817,836 **** } - public Vector getDistanceMeasurements() { - return modelManager.distanceMeasurements; - } - - public Vector getAngleMeasurements() { - return modelManager.angleMeasurements; - } - - public Vector getDihedralMeasurements() { - return modelManager.dihedralMeasurements; - } - - public void clearMeasurements() { - modelManager.clearMeasurements(); - } - public int findNearestAtomIndex(int x, int y) { return modelManager.findNearestAtomIndex(x, y); --- 816,819 ---- *************** *** 852,875 **** } - public void defineMeasure(int[] atomIndices) { - modelManager.defineMeasure(atomIndices); - refresh(); - } - - public void defineMeasure(int atom1, int atom2) { - modelManager.defineMeasure(atom1, atom2); - refresh(); - } - - public void defineMeasure(int atom1, int atom2, int atom3) { - modelManager.defineMeasure(atom1, atom2, atom3); - refresh(); - } - - public void defineMeasure(int atom1, int atom2, int atom3, int atom4) { - modelManager.defineMeasure(atom1, atom2, atom3, atom4); - refresh(); - } - public void rebond() { modelManager.rebond(); --- 835,838 ---- *************** *** 932,935 **** --- 895,948 ---- PropertyChangeListener pcl) { modelManager.removePropertyChangeListener(prop, pcl); + } + + /**************************************************************** + * delegated to MeasurementManager + ****************************************************************/ + + public Vector getDistanceMeasurements() { + return measurementManager.distanceMeasurements; + } + + public Vector getAngleMeasurements() { + return measurementManager.angleMeasurements; + } + + public Vector getDihedralMeasurements() { + return measurementManager.dihedralMeasurements; + } + + public void clearMeasurements() { + measurementManager.clearMeasurements(); + } + + public void defineMeasure(int[] atomIndices) { + measurementManager.defineMeasure(atomIndices); + refresh(); + } + + public void defineMeasure(int atom1, int atom2) { + measurementManager.defineMeasure(atom1, atom2); + refresh(); + } + + public void defineMeasure(int atom1, int atom2, int atom3) { + measurementManager.defineMeasure(atom1, atom2, atom3); + refresh(); + } + + public void defineMeasure(int atom1, int atom2, int atom3, int atom4) { + measurementManager.defineMeasure(atom1, atom2, atom3, atom4); + refresh(); + } + + MeasureWatcher measureWatcher; + public void setMeasureWatcher(MeasureWatcher measureWatcher) { + this.measureWatcher = measureWatcher; + } + + public void measureSelection(int iatom) { + if (measureWatcher != null) + measureWatcher.firePicked(iatom); } Index: ModelManager.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/ModelManager.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** ModelManager.java 5 Feb 2003 11:33:08 -0000 1.15 --- ModelManager.java 5 Feb 2003 15:58:17 -0000 1.16 *************** *** 26,30 **** import org.openscience.jmol.Atom; - import org.openscience.jmol.app.MeasurementList; import java.util.BitSet; --- 26,29 ---- *************** *** 48,52 **** public ChemFrame chemframe; public int nframes = 0; - public MeasurementList mlist = null; public PropertyChangeSupport pcs = new PropertyChangeSupport(this); --- 47,50 ---- *************** *** 56,61 **** nframes = chemfile.getNumberOfFrames(); this.chemframe = chemfile.getFrame(0); - Measurement.setChemFrame(chemframe); - clearMeasurements(); haveFile = true; pcs.firePropertyChange(DisplayControl.PROP_CHEM_FILE, --- 54,57 ---- *************** *** 102,107 **** ChemFrame chemframePrevious = this.chemframe; this.chemframe = chemframe; - Measurement.setChemFrame(chemframe); - clearMeasurements(); pcs.firePropertyChange(DisplayControl.PROP_CHEM_FRAME, chemframePrevious, chemframe); --- 98,101 ---- *************** *** 120,133 **** } - public Vector distanceMeasurements = new Vector(); - public Vector angleMeasurements = new Vector(); - public Vector dihedralMeasurements = new Vector(); - - public void clearMeasurements() { - distanceMeasurements.removeAllElements(); - angleMeasurements.removeAllElements(); - dihedralMeasurements.removeAllElements(); - } - public void setCenterAsSelected() { int numberOfAtoms = numberOfAtoms(); --- 114,117 ---- *************** *** 172,203 **** public void setAutoBond(boolean ab) { autoBond = ab; - } - - public void defineMeasure(int[] atoms) { - switch (atoms.length) { - case 2: - defineMeasure(atoms[0], atoms[1]); - break; - case 3: - defineMeasure(atoms[0], atoms[1], atoms[2]); - break; - case 4: - defineMeasure(atoms[0], atoms[1], atoms[2], atoms[3]); - break; - default: - control.logError("unrecognized number of args to defineMeasure"); - } - } - - public void defineMeasure(int atom1, int atom2) { - mlist.addDistance(atom1, atom2); - } - - public void defineMeasure(int atom1, int atom2, int atom3) { - mlist.addAngle(atom1, atom2, atom3); - } - - public void defineMeasure(int atom1, int atom2, int atom3, int atom4) { - mlist.addDihedral(atom1, atom2, atom3, atom4); } --- 156,159 ---- Index: MouseManager.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/MouseManager.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** MouseManager.java 4 Feb 2003 22:05:24 -0000 1.11 --- MouseManager.java 5 Feb 2003 15:58:17 -0000 1.12 *************** *** 1,3 **** - /* * Copyright 2002 The Jmol Development Team --- 1,2 ---- *************** *** 20,24 **** package org.openscience.jmol; - import org.openscience.jmol.app.Measure; import org.openscience.jmol.Atom; import org.openscience.jmol.DisplayControl; --- 19,22 ---- *************** *** 88,98 **** } - // FIXME -- figure out a way to get measure to work with both - // applet and app - Measure measure; - public void setMeasure(Measure measure) { - this.measure = measure; - } - public Rectangle getRubberBand() { if (!rubberbandSelectionMode) --- 86,89 ---- *************** *** 165,170 **** break; case MEASURE: ! if (atomIndex != -1 && measure != null) { ! measure.firePicked(atomIndex); } } --- 156,161 ---- break; case MEASURE: ! if (atomIndex != -1) { ! control.measureSelection(atomIndex); } } --- Measurement.java DELETED --- |
From: Michael T H. <mic...@us...> - 2003-02-05 15:58:51
|
Update of /cvsroot/jmol/Jmol In directory sc8-pr-cvs1:/tmp/cvs-serv3245 Modified Files: applet.classes build.xml Log Message: completed separation of measures from UI Index: applet.classes =================================================================== RCS file: /cvsroot/jmol/Jmol/applet.classes,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -r1.20 -r1.21 *** applet.classes 4 Feb 2003 22:50:10 -0000 1.20 --- applet.classes 5 Feb 2003 15:58:15 -0000 1.21 *************** *** 30,33 **** --- 30,34 ---- org/openscience/jmol/CrystalBox.java org/openscience/jmol/FortranFormat.java + freeware/PrintfFormat.java org/openscience/jmol/AtomTypeSet.java org/openscience/jmol/StatusDisplay.java *************** *** 36,42 **** org/openscience/jmol/NMRShielding.java org/openscience/jmol/AtomicSymbol.java ! org/openscience/jmol/Measurement.java ! org/openscience/jmol/app/MeasurementList.java ! org/openscience/jmol/app/MeasurementListEvent.java org/openscience/jmol/UseJavaSort.java org/openscience/jmol/JmolAtomIterator.java --- 37,43 ---- org/openscience/jmol/NMRShielding.java org/openscience/jmol/AtomicSymbol.java ! org/openscience/jmol/MeasurementManager.java ! org/openscience/jmol/MeasurementWatcher.java ! org/openscience/jmol/MeasurementInterface.java org/openscience/jmol/UseJavaSort.java org/openscience/jmol/JmolAtomIterator.java *************** *** 73,77 **** org/openscience/jmol/render/ArrowLine.java org/openscience/jmol/render/ChemFrameRenderer.java - org/openscience/jmol/render/MeasureRenderer.java org/openscience/jmol/render/Shape.java org/openscience/jmol/render/AtomShape.java --- 74,77 ---- *************** *** 85,88 **** --- 85,92 ---- org/openscience/jmol/render/ShadedSphereRenderer.java org/openscience/jmol/render/SphereG2D.java + org/openscience/jmol/render/Distance.java + org/openscience/jmol/render/Angle.java + org/openscience/jmol/render/Dihedral.java + org/openscience/jmol/render/MeasureRenderer.java org/openscience/jmol/script/Eval.java org/openscience/jmol/script/Token.java Index: build.xml =================================================================== RCS file: /cvsroot/jmol/Jmol/build.xml,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -r1.44 -r1.45 *** build.xml 3 Feb 2003 15:20:31 -0000 1.44 --- build.xml 5 Feb 2003 15:58:16 -0000 1.45 *************** *** 278,283 **** <jar jarfile="${lib.dir}/JmolApplet.jar" > <fileset dir="${applet.classes.dir}" > ! <exclude name="**/.*" /> ! <include name="**/jmol/**" /> </fileset> <fileset dir="${appletjars.dir}" includes="**/*"/> --- 278,282 ---- <jar jarfile="${lib.dir}/JmolApplet.jar" > <fileset dir="${applet.classes.dir}" > ! <include name="**/*" /> </fileset> <fileset dir="${appletjars.dir}" includes="**/*"/> |
From: Michael T H. <mic...@us...> - 2003-02-05 15:58:36
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/render In directory sc8-pr-cvs1:/tmp/cvs-serv3245/src/org/openscience/jmol/render Modified Files: Angle.java Dihedral.java Distance.java MeasureRenderer.java Log Message: completed separation of measures from UI Index: Angle.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/render/Angle.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** Angle.java 19 Jan 2003 18:20:55 -0000 1.6 --- Angle.java 5 Feb 2003 15:58:19 -0000 1.7 *************** *** 22,53 **** import freeware.PrintfFormat; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics; ! public class Angle extends Measurement implements MeasurementInterface { private int[] Atoms = new int[3]; private double angle; ! private boolean computed = false; ! private ChemFrame fcf; ! public Angle(int a1, int a2, int a3) { super(); Atoms[0] = a1; Atoms[1] = a2; Atoms[2] = a3; ! compute(); } ! public void paint(Graphics g, DisplayControl control, boolean showLabel, ! Atom atom1, Atom atom2, Atom atom3) throws Exception { ! paintAngleLine(g, control, atom1, atom2, atom3); if (showLabel) ! paintAngleString(g, control, atom1, atom2, atom3); } ! private void paintAngleLine(Graphics g, DisplayControl control, ! Atom atom1, Atom atom2, Atom atom3) { int x1 = atom1.getScreenX(), y1 = atom1.getScreenY(); int x2 = atom2.getScreenX(), y2 = atom2.getScreenY(); --- 22,61 ---- import freeware.PrintfFormat; + import javax.vecmath.Point3d; + import javax.vecmath.Vector3d; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics; ! public class Angle implements MeasurementInterface { private int[] Atoms = new int[3]; + Atom atom1, atom2, atom3; private double angle; ! String strAngle; ! public Angle(int a1, Atom atom1, int a2, Atom atom2, int a3, Atom atom3) { super(); Atoms[0] = a1; Atoms[1] = a2; Atoms[2] = a3; ! this.atom1 = atom1; ! this.atom2 = atom2; ! this.atom3 = atom3; ! Vector3d vector12 = new Vector3d(atom1.getPosition()); ! vector12.sub(atom2.getPosition()); ! Vector3d vector32 = new Vector3d(atom3.getPosition()); ! vector32.sub(atom2.getPosition()); ! angle = vector12.angle(vector32) * 180 / Math.PI; ! strAngle = angleFormat.sprintf(angle); } ! public void paint(Graphics g, DisplayControl control, boolean showLabel) { ! paintAngleLine(g, control); if (showLabel) ! paintAngleString(g, control); } ! private void paintAngleLine(Graphics g, DisplayControl control) { int x1 = atom1.getScreenX(), y1 = atom1.getScreenY(); int x2 = atom2.getScreenX(), y2 = atom2.getScreenY(); *************** *** 68,73 **** private static PrintfFormat angleFormat = new PrintfFormat("%0.1f\u00b0"); ! private void paintAngleString(Graphics g, DisplayControl control, ! Atom atom1, Atom atom2, Atom atom3) { int x1 = atom1.getScreenX(), y1 = atom1.getScreenY(), d1 = atom1.getScreenDiameter(); --- 76,80 ---- private static PrintfFormat angleFormat = new PrintfFormat("%0.1f\u00b0"); ! private void paintAngleString(Graphics g, DisplayControl control) { int x1 = atom1.getScreenX(), y1 = atom1.getScreenY(), d1 = atom1.getScreenDiameter(); *************** *** 81,91 **** FontMetrics fontMetrics = g.getFontMetrics(font); g.setColor(control.getColorAngle()); ! String s = angleFormat.sprintf(getAngle()); ! int j = fontMetrics.stringWidth(s); int xloc = (2 * x2 + x1 + x3) / 4; int yloc = (2 * y2 + y1 + y3) / 4; ! g.drawString(s, xloc, yloc); } --- 88,97 ---- FontMetrics fontMetrics = g.getFontMetrics(font); g.setColor(control.getColorAngle()); ! int j = fontMetrics.stringWidth(strAngle); int xloc = (2 * x2 + x1 + x3) / 4; int yloc = (2 * y2 + y1 + y3) / 4; ! g.drawString(strAngle, xloc, yloc); } *************** *** 115,178 **** public String toString() { return ("[" + Atoms[0] + "," + Atoms[1] + "," + Atoms[2] + " = " ! + getAngle() + "]"); } public double getAngle() { - if (!computed || (cf != fcf)) { - compute(); - } return angle; - } - - public void compute() { - - if (cf == null) { - return; - } - - double[] c0 = cf.getAtomCoords(Atoms[0]); - double[] c1 = cf.getAtomCoords(Atoms[1]); - double[] c2 = cf.getAtomCoords(Atoms[2]); - - - double ax = c0[0] - c1[0]; - double ay = c0[1] - c1[1]; - double az = c0[2] - c1[2]; - - double bx = c2[0] - c1[0]; - double by = c2[1] - c1[1]; - double bz = c2[2] - c1[2]; - - double ax2 = ax * ax; - double ay2 = ay * ay; - double az2 = az * az; - - double bx2 = bx * bx; - double by2 = by * by; - double bz2 = bz * bz; - - double rij2 = ax2 + ay2 + az2; - double rkj2 = bx2 + by2 + bz2; - - double riji2 = 1.0 / rij2; - double rkji2 = 1.0 / rkj2; - - double dot = ax * bx + ay * by + az * bz; - double denom = Math.sqrt(riji2 * rkji2); - double cosang = dot * denom; - if (cosang > 1.0) { - cosang = 1.0; - } - if (cosang < -1.0) { - cosang = -1.0; - } - - angle = toDegrees(Math.acos(cosang)); - fcf = cf; - computed = true; - } - - public static double toDegrees(double angrad) { - return angrad * 180.0 / Math.PI; } } --- 121,129 ---- public String toString() { return ("[" + Atoms[0] + "," + Atoms[1] + "," + Atoms[2] + " = " ! + angle + "]"); } public double getAngle() { return angle; } } Index: Dihedral.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/render/Dihedral.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** Dihedral.java 19 Jan 2003 18:20:56 -0000 1.6 --- Dihedral.java 5 Feb 2003 15:58:19 -0000 1.7 *************** *** 22,25 **** --- 22,26 ---- import freeware.PrintfFormat; + import javax.vecmath.Point3d; import java.awt.Font; import java.awt.FontMetrics; *************** *** 30,41 **** * @author J. Daniel Gezelter */ ! public class Dihedral extends Measurement implements MeasurementInterface { private int[] Atoms = new int[4]; private double dihedral; ! private boolean computed = false; ! private ChemFrame fcf; ! public Dihedral(int a1, int a2, int a3, int a4) { super(); --- 31,43 ---- * @author J. Daniel Gezelter */ ! public class Dihedral implements MeasurementInterface { private int[] Atoms = new int[4]; + Atom atom1, atom2, atom3, atom4; private double dihedral; ! String strDihedral; ! public Dihedral(int a1, Atom atom1, int a2, Atom atom2, ! int a3, Atom atom3, int a4, Atom atom4) { super(); *************** *** 44,61 **** Atoms[2] = a3; Atoms[3] = a4; compute(); } ! public void paint(Graphics g, DisplayControl control, boolean showLabel, ! Atom atom1, Atom atom2, ! Atom atom3, Atom atom4) throws Exception { ! paintDihedralLine(g, control, atom1, atom2, atom3, atom4); if (showLabel) ! paintDihedralString(g, control, atom1, atom2, atom3, atom4); } ! private void paintDihedralLine(Graphics g, DisplayControl control, ! Atom atom1, Atom atom2, ! Atom atom3, Atom atom4) { int x1 = atom1.getScreenX(), y1 = atom1.getScreenY(); int x2 = atom2.getScreenX(), y2 = atom2.getScreenY(); --- 46,62 ---- Atoms[2] = a3; Atoms[3] = a4; + this.atom1 = atom1; this.atom2 = atom2; + this.atom3 = atom3; this.atom4 = atom4; compute(); + strDihedral = dihedralFormat.sprintf(dihedral); } ! public void paint(Graphics g, DisplayControl control, boolean showLabel) { ! paintDihedralLine(g, control); if (showLabel) ! paintDihedralString(g, control); } ! private void paintDihedralLine(Graphics g, DisplayControl control) { int x1 = atom1.getScreenX(), y1 = atom1.getScreenY(); int x2 = atom2.getScreenX(), y2 = atom2.getScreenY(); *************** *** 77,83 **** private static PrintfFormat dihedralFormat = new PrintfFormat("%0.1f\u00b0"); ! private void paintDihedralString(Graphics g, DisplayControl control, ! Atom atom1, Atom atom2, ! Atom atom3, Atom atom4) { int x1 = atom1.getScreenX(), y1 = atom1.getScreenY(), d1 = atom1.getScreenDiameter(); --- 78,82 ---- private static PrintfFormat dihedralFormat = new PrintfFormat("%0.1f\u00b0"); ! private void paintDihedralString(Graphics g, DisplayControl control) { int x1 = atom1.getScreenX(), y1 = atom1.getScreenY(), d1 = atom1.getScreenDiameter(); *************** *** 93,103 **** FontMetrics fontMetrics = g.getFontMetrics(font); g.setColor(control.getColorDihedral()); ! String s = dihedralFormat.sprintf(getDihedral()); ! int j = fontMetrics.stringWidth(s); int xloc = (x1 + x2 + x3 + x4) / 4; int yloc = (y1 + y2 + y3 + y4) / 4; ! g.drawString(s, xloc, yloc); } --- 92,101 ---- FontMetrics fontMetrics = g.getFontMetrics(font); g.setColor(control.getColorDihedral()); ! int j = fontMetrics.stringWidth(strDihedral); int xloc = (x1 + x2 + x3 + x4) / 4; int yloc = (y1 + y2 + y3 + y4) / 4; ! g.drawString(strDihedral, xloc, yloc); } *************** *** 124,134 **** public String toString() { return ("[" + Atoms[0] + "," + Atoms[1] + "," + Atoms[2] + "," + Atoms[3] ! + " = " + getDihedral() + "]"); } public double getDihedral() { - if (!computed || (cf != fcf)) { - compute(); - } return dihedral; } --- 122,129 ---- public String toString() { return ("[" + Atoms[0] + "," + Atoms[1] + "," + Atoms[2] + "," + Atoms[3] ! + " = " + dihedral + "]"); } public double getDihedral() { return dihedral; } *************** *** 136,160 **** public void compute() { ! if (cf == null) { ! return; ! } ! double[] c0 = cf.getAtomCoords(Atoms[0]); ! double[] c1 = cf.getAtomCoords(Atoms[1]); ! double[] c2 = cf.getAtomCoords(Atoms[2]); ! double[] c3 = cf.getAtomCoords(Atoms[3]); ! ! ! double ijx = c0[0] - c1[0]; ! double ijy = c0[1] - c1[1]; ! double ijz = c0[2] - c1[2]; ! ! double kjx = c2[0] - c1[0]; ! double kjy = c2[1] - c1[1]; ! double kjz = c2[2] - c1[2]; ! ! double klx = c2[0] - c3[0]; ! double kly = c2[1] - c3[1]; ! double klz = c2[2] - c3[2]; double ax = ijy * kjz - ijz * kjy; --- 131,148 ---- public void compute() { ! Point3d p1 = atom1.getPosition(), p2 = atom2.getPosition(); ! Point3d p3 = atom3.getPosition(), p4 = atom4.getPosition(); ! double ijx = p1.x - p2.x; ! double ijy = p1.y - p2.y; ! double ijz = p1.z - p2.z; ! ! double kjx = p3.x - p2.x; ! double kjy = p3.y - p2.y; ! double kjz = p3.z - p2.z; ! ! double klx = p3.x - p4.x; ! double kly = p3.y - p4.y; ! double klz = p3.z - p4.z; double ax = ijy * kjz - ijz * kjy; *************** *** 184,188 **** double absDot = Math.abs(dot); dihedral = (dot/absDot > 0) ? dihedral : -dihedral; - computed = true; } --- 172,175 ---- *************** *** 191,193 **** } } - --- 178,179 ---- Index: Distance.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/render/Distance.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** Distance.java 19 Jan 2003 18:20:56 -0000 1.6 --- Distance.java 5 Feb 2003 15:58:20 -0000 1.7 *************** *** 21,24 **** --- 21,26 ---- import org.openscience.jmol.*; + import javax.vecmath.Point3d; + import freeware.PrintfFormat; import java.awt.Font; *************** *** 30,56 **** * @author J. Daniel Gezelter */ ! public class Distance extends Measurement implements MeasurementInterface { ! private int[] Atoms = new int[2]; private double distance; ! private boolean computed = false; ! private ChemFrame fcf; ! public Distance(int a1, int a2) { super(); ! Atoms[0] = a1; ! Atoms[1] = a2; ! compute(); } ! public void paint(Graphics g, DisplayControl control, boolean showLabel, ! Atom atom1, Atom atom2) throws Exception { ! paintDistLine(g, control, atom1, atom2); if (showLabel) ! paintDistString(g, control, atom1, atom2); } ! private void paintDistLine(Graphics g, DisplayControl control, ! Atom atom1, Atom atom2) { control.maybeDottedStroke(g); g.setColor(control.getColorDistance()); --- 32,60 ---- * @author J. Daniel Gezelter */ ! public class Distance implements MeasurementInterface { ! int[] iatoms = new int[2]; ! Atom atom1; ! Atom atom2; private double distance; ! private String strDistance; ! public Distance(int iatom1, Atom atom1, int iatom2, Atom atom2) { super(); ! iatoms[0] = iatom1; ! iatoms[1] = iatom2; ! this.atom1 = atom1; ! this.atom2 = atom2; ! distance = atom1.getPosition().distance(atom2.getPosition()); ! strDistance = formatDistance(distance); } ! public void paint(Graphics g, DisplayControl control, boolean showLabel) { ! paintDistLine(g, control); if (showLabel) ! paintDistString(g, control); } ! private void paintDistLine(Graphics g, DisplayControl control) { control.maybeDottedStroke(g); g.setColor(control.getColorDistance()); *************** *** 64,69 **** private static PrintfFormat distanceFormat = new PrintfFormat("%0.3f \u00c5"); ! private void paintDistString(Graphics g, DisplayControl control, ! Atom atom1, Atom atom2) { int x1 = atom1.getScreenX(), y1 = atom1.getScreenY(), d1 = atom1.getScreenDiameter(); --- 68,76 ---- private static PrintfFormat distanceFormat = new PrintfFormat("%0.3f \u00c5"); ! private String formatDistance(double dist) { ! return distanceFormat.sprintf(dist); ! } ! ! private void paintDistString(Graphics g, DisplayControl control) { int x1 = atom1.getScreenX(), y1 = atom1.getScreenY(), d1 = atom1.getScreenDiameter(); *************** *** 77,100 **** FontMetrics fontMetrics = g.getFontMetrics(font); g.setColor(control.getColorDistance()); ! String s = distanceFormat.sprintf(getDistance()); ! int j = fontMetrics.stringWidth(s); ! if (x2 == x1) { ! g.drawString(s, x1 + 1, ((y1 + y2) / 2) + 1); } else { ! g.drawString(s, (x1 + x2) / 2 - j - 1, (y1 + y2) / 2 - 1); } } public int[] getAtomList() { ! return Atoms; } public boolean sameAs(int a1, int a2) { ! if ((Atoms[0] == a1) && (Atoms[1] == a2)) { return true; } else { ! if ((Atoms[0] == a2) && (Atoms[1] == a1)) { return true; } else { --- 84,105 ---- FontMetrics fontMetrics = g.getFontMetrics(font); g.setColor(control.getColorDistance()); ! int j = fontMetrics.stringWidth(strDistance); if (x2 == x1) { ! g.drawString(strDistance, x1 + 1, ((y1 + y2) / 2) + 1); } else { ! g.drawString(strDistance, (x1 + x2) / 2 - j - 1, (y1 + y2) / 2 - 1); } } public int[] getAtomList() { ! return iatoms; } public boolean sameAs(int a1, int a2) { ! if ((iatoms[0] == a1) && (iatoms[1] == a2)) { return true; } else { ! if ((iatoms[0] == a2) && (iatoms[1] == a1)) { return true; } else { *************** *** 105,140 **** public String toString() { ! return ("[" + Atoms[0] + "," + Atoms[1] + " = " + getDistance() + "]"); ! } ! ! public double getDistance() { ! if (!computed || (cf != fcf)) { ! compute(); ! } ! return distance; ! } ! ! public void compute() { ! ! if (cf == null) { ! return; ! } ! ! double[] c0 = cf.getAtomCoords(Atoms[0]); ! double[] c1 = cf.getAtomCoords(Atoms[1]); ! ! double ax = c0[0] - c1[0]; ! double ay = c0[1] - c1[1]; ! double az = c0[2] - c1[2]; ! ! double ax2 = ax * ax; ! double ay2 = ay * ay; ! double az2 = az * az; ! ! double rij2 = ax2 + ay2 + az2; ! ! distance = Math.sqrt(rij2); ! fcf = cf; ! computed = true; } } --- 110,114 ---- public String toString() { ! return ("[" + iatoms[0] + "," + iatoms[1] + " = " + distance + "]"); } } Index: MeasureRenderer.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/render/MeasureRenderer.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** MeasureRenderer.java 5 Feb 2003 11:33:09 -0000 1.7 --- MeasureRenderer.java 5 Feb 2003 15:58:25 -0000 1.8 *************** *** 48,60 **** while (e.hasMoreElements()) { Distance d = (Distance) e.nextElement(); ! int[] al = d.getAtomList(); ! int l = al[0]; ! int j = al[1]; ! try { ! d.paint(g, control, showMeasurementLabels, ! frame.getJmolAtomAt(l), ! frame.getJmolAtomAt(j)); ! } catch (Exception ex) { ! } } --- 48,52 ---- while (e.hasMoreElements()) { Distance d = (Distance) e.nextElement(); ! d.paint(g, control, showMeasurementLabels); } *************** *** 62,76 **** while (e.hasMoreElements()) { Angle an = (Angle) e.nextElement(); ! int[] al = an.getAtomList(); ! int l = al[0]; ! int j = al[1]; ! int k = al[2]; ! try { ! an.paint(g, control, showMeasurementLabels, ! frame.getJmolAtomAt(l), ! frame.getJmolAtomAt(j), ! frame.getJmolAtomAt(k)); ! } catch (Exception ex) { ! } } --- 54,58 ---- while (e.hasMoreElements()) { Angle an = (Angle) e.nextElement(); ! an.paint(g, control, showMeasurementLabels); } *************** *** 78,94 **** while (e.hasMoreElements()) { Dihedral dh = (Dihedral) e.nextElement(); ! int[] dhl = dh.getAtomList(); ! int l = dhl[0]; ! int j = dhl[1]; ! int k = dhl[2]; ! int m = dhl[3]; ! try { ! dh.paint(g, control, showMeasurementLabels, ! frame.getJmolAtomAt(l), ! frame.getJmolAtomAt(j), ! frame.getJmolAtomAt(k), ! frame.getJmolAtomAt(m)); ! } catch (Exception ex) { ! } } } --- 60,64 ---- while (e.hasMoreElements()) { Dihedral dh = (Dihedral) e.nextElement(); ! dh.paint(g, control, showMeasurementLabels); } } |
From: Egon W. <eg...@us...> - 2003-02-05 13:25:26
|
Update of /cvsroot/jmol/Jmol/jars In directory sc8-pr-cvs1:/tmp/cvs-serv29333 Modified Files: jmolcdk.jar Log Message: Fixed configuration of atomic numbers. Index: jmolcdk.jar =================================================================== RCS file: /cvsroot/jmol/Jmol/jars/jmolcdk.jar,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 Binary files /tmp/cvsoQl2iU and /tmp/cvswFRbhG differ |
From: Michael T H. <mic...@us...> - 2003-02-05 11:33:12
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/render In directory sc8-pr-cvs1:/tmp/cvs-serv19408/src/org/openscience/jmol/render Modified Files: MeasureRenderer.java Log Message: restructuring measurements - step 1 Index: MeasureRenderer.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/render/MeasureRenderer.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** MeasureRenderer.java 19 Jan 2003 18:20:56 -0000 1.6 --- MeasureRenderer.java 5 Feb 2003 11:33:09 -0000 1.7 *************** *** 43,99 **** ChemFrame frame = control.getFrame(); boolean showMeasurementLabels = control.getShowMeasurementLabels(); ! if (frame.getDistanceMeasurements() != null) { ! Enumeration e = frame.getDistanceMeasurements().elements(); ! while (e.hasMoreElements()) { ! Distance d = (Distance) e.nextElement(); ! int[] al = d.getAtomList(); ! int l = al[0]; ! int j = al[1]; ! try { ! d.paint(g, control, showMeasurementLabels, ! frame.getJmolAtomAt(l), ! frame.getJmolAtomAt(j)); ! } catch (Exception ex) { ! } } } ! if (frame.getAngleMeasurements() != null) { ! Enumeration e = frame.getAngleMeasurements().elements(); ! while (e.hasMoreElements()) { ! Angle an = (Angle) e.nextElement(); ! int[] al = an.getAtomList(); ! int l = al[0]; ! int j = al[1]; ! int k = al[2]; ! try { ! an.paint(g, control, showMeasurementLabels, ! frame.getJmolAtomAt(l), ! frame.getJmolAtomAt(j), ! frame.getJmolAtomAt(k)); ! } catch (Exception ex) { ! } } } ! if (frame.getDihedralMeasurements() != null) { ! Enumeration e = frame.getDihedralMeasurements().elements(); ! while (e.hasMoreElements()) { ! Dihedral dh = (Dihedral) e.nextElement(); ! int[] dhl = dh.getAtomList(); ! int l = dhl[0]; ! int j = dhl[1]; ! int k = dhl[2]; ! int m = dhl[3]; ! try { ! dh.paint(g, control, showMeasurementLabels, ! frame.getJmolAtomAt(l), ! frame.getJmolAtomAt(j), ! frame.getJmolAtomAt(k), ! frame.getJmolAtomAt(m)); ! } catch (Exception ex) { ! } } } } - } --- 43,96 ---- ChemFrame frame = control.getFrame(); boolean showMeasurementLabels = control.getShowMeasurementLabels(); ! Enumeration e; ! ! e = control.getDistanceMeasurements().elements(); ! while (e.hasMoreElements()) { ! Distance d = (Distance) e.nextElement(); ! int[] al = d.getAtomList(); ! int l = al[0]; ! int j = al[1]; ! try { ! d.paint(g, control, showMeasurementLabels, ! frame.getJmolAtomAt(l), ! frame.getJmolAtomAt(j)); ! } catch (Exception ex) { } } ! ! e = control.getAngleMeasurements().elements(); ! while (e.hasMoreElements()) { ! Angle an = (Angle) e.nextElement(); ! int[] al = an.getAtomList(); ! int l = al[0]; ! int j = al[1]; ! int k = al[2]; ! try { ! an.paint(g, control, showMeasurementLabels, ! frame.getJmolAtomAt(l), ! frame.getJmolAtomAt(j), ! frame.getJmolAtomAt(k)); ! } catch (Exception ex) { } } ! ! e = control.getDihedralMeasurements().elements(); ! while (e.hasMoreElements()) { ! Dihedral dh = (Dihedral) e.nextElement(); ! int[] dhl = dh.getAtomList(); ! int l = dhl[0]; ! int j = dhl[1]; ! int k = dhl[2]; ! int m = dhl[3]; ! try { ! dh.paint(g, control, showMeasurementLabels, ! frame.getJmolAtomAt(l), ! frame.getJmolAtomAt(j), ! frame.getJmolAtomAt(k), ! frame.getJmolAtomAt(m)); ! } catch (Exception ex) { } } } } |
From: Michael T H. <mic...@us...> - 2003-02-05 11:33:12
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/app In directory sc8-pr-cvs1:/tmp/cvs-serv19408/src/org/openscience/jmol/app Modified Files: DisplayPanel.java Jmol.java MeasurementList.java Removed Files: MeasurementListEvent.java MeasurementListListener.java Log Message: restructuring measurements - step 1 Index: DisplayPanel.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/app/DisplayPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** DisplayPanel.java 4 Feb 2003 22:05:42 -0000 1.1 --- DisplayPanel.java 5 Feb 2003 11:33:08 -0000 1.2 *************** *** 45,50 **** public class DisplayPanel extends JPanel ! implements MeasurementListListener, PropertyChangeListener, ! ComponentListener { private StatusBar status; private GuiMap guimap; --- 45,49 ---- public class DisplayPanel extends JPanel ! implements PropertyChangeListener, ComponentListener { private StatusBar status; private GuiMap guimap; *************** *** 101,108 **** public ChemFrame getFrame() { return control.getFrame(); - } - - public void mlistChanged(MeasurementListEvent mle) { - control.mlistChanged(mle); } --- 100,103 ---- Index: Jmol.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/app/Jmol.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** Jmol.java 4 Feb 2003 22:05:44 -0000 1.1 --- Jmol.java 5 Feb 2003 11:33:08 -0000 1.2 *************** *** 272,281 **** splash.showStatus(resourceHandler .translate("Initializing Measurements...")); ! mlist = new MeasurementList(frame, display); meas = new Measure(frame, control); meas.setMeasurementList(mlist); display.setMeasure(meas); control.setMeasureMouse(meas); ! mlist.addMeasurementListListener(display); port.add(display); --- 272,281 ---- splash.showStatus(resourceHandler .translate("Initializing Measurements...")); ! mlist = new MeasurementList(frame, control); meas = new Measure(frame, control); meas.setMeasurementList(mlist); display.setMeasure(meas); control.setMeasureMouse(meas); ! // mlist.addMeasurementListListener(display); port.add(display); Index: MeasurementList.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/app/MeasurementList.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** MeasurementList.java 4 Feb 2003 22:05:45 -0000 1.1 --- MeasurementList.java 5 Feb 2003 11:33:09 -0000 1.2 *************** *** 20,23 **** --- 20,24 ---- package org.openscience.jmol.app; + import org.openscience.jmol.DisplayControl; import org.openscience.jmol.render.Angle; import org.openscience.jmol.render.Distance; *************** *** 54,58 **** import javax.swing.JButton; import javax.swing.AbstractButton; - import javax.swing.event.EventListenerList; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeModel; --- 55,58 ---- *************** *** 61,68 **** public class MeasurementList extends JDialog { ! /** List of listeners */ ! protected EventListenerList listenerList = new EventListenerList(); ! ! private DisplayPanel display; protected DefaultMutableTreeNode top; protected ListNode distances, angles, dihedrals; --- 61,65 ---- public class MeasurementList extends JDialog { ! private DisplayControl control; protected DefaultMutableTreeNode top; protected ListNode distances, angles, dihedrals; *************** *** 72,78 **** JmolResourceHandler.getInstance().translate("Delete Measurement")); ! private Vector distanceList = new Vector(10); ! private Vector angleList = new Vector(10); ! private Vector dihedralList = new Vector(10); // The actions: --- 69,75 ---- JmolResourceHandler.getInstance().translate("Delete Measurement")); ! private Vector distanceList; ! private Vector angleList; ! private Vector dihedralList; // The actions: *************** *** 90,98 **** * @param dp the DisplayPanel in which the animation will take place */ ! public MeasurementList(JFrame f, DisplayPanel dp) { super(f, JmolResourceHandler.getInstance() .translate("Measurement List"), false); ! this.display = dp; commands = new Hashtable(); Action[] actions = getActions(); --- 87,100 ---- * @param dp the DisplayPanel in which the animation will take place */ ! public MeasurementList(JFrame f, DisplayControl control) { super(f, JmolResourceHandler.getInstance() .translate("Measurement List"), false); ! this.control = control; ! ! distanceList = control.getDistanceMeasurements(); ! angleList = control.getAngleMeasurements(); ! dihedralList = control.getDihedralMeasurements(); ! commands = new Hashtable(); Action[] actions = getActions(); *************** *** 201,205 **** dihedrals.update(); treeModel.reload(top); ! fireMlistChanged(new MeasurementListEvent(this)); } --- 203,210 ---- dihedrals.update(); treeModel.reload(top); ! } ! ! private void notifyControl() { ! control.refresh(); } *************** *** 224,229 **** distances.update(); treeModel.reload(distances); ! fireMlistChanged(new MeasurementListEvent(this)); ! display.repaint(); } --- 229,233 ---- distances.update(); treeModel.reload(distances); ! notifyControl(); } *************** *** 237,242 **** angles.update(); treeModel.reload(angles); ! fireMlistChanged(new MeasurementListEvent(this)); ! display.repaint(); } --- 241,245 ---- angles.update(); treeModel.reload(angles); ! notifyControl(); } *************** *** 249,254 **** dihedrals.update(); treeModel.reload(dihedrals); ! fireMlistChanged(new MeasurementListEvent(this)); ! display.repaint(); } --- 252,256 ---- dihedrals.update(); treeModel.reload(dihedrals); ! notifyControl(); } *************** *** 262,266 **** dihedrals.update(); treeModel.reload(top); ! fireMlistChanged(new MeasurementListEvent(this)); } --- 264,268 ---- dihedrals.update(); treeModel.reload(top); ! notifyControl(); } *************** *** 270,275 **** distances.update(); treeModel.reload(distances); ! fireMlistChanged(new MeasurementListEvent(this)); ! display.repaint(); } --- 272,276 ---- distances.update(); treeModel.reload(distances); ! notifyControl(); } *************** *** 279,284 **** angles.update(); treeModel.reload(angles); ! fireMlistChanged(new MeasurementListEvent(this)); ! display.repaint(); } --- 280,284 ---- angles.update(); treeModel.reload(angles); ! notifyControl(); } *************** *** 288,293 **** dihedrals.update(); treeModel.reload(dihedrals); ! fireMlistChanged(new MeasurementListEvent(this)); ! display.repaint(); } --- 288,292 ---- dihedrals.update(); treeModel.reload(dihedrals); ! notifyControl(); } *************** *** 301,306 **** distances.update(); treeModel.reload(distances); ! fireMlistChanged(new MeasurementListEvent(this)); ! display.repaint(); return true; } --- 300,304 ---- distances.update(); treeModel.reload(distances); ! notifyControl(); return true; } *************** *** 320,325 **** angles.update(); treeModel.reload(angles); ! fireMlistChanged(new MeasurementListEvent(this)); ! display.repaint(); return true; } --- 318,322 ---- angles.update(); treeModel.reload(angles); ! notifyControl(); return true; } *************** *** 339,344 **** dihedrals.update(); treeModel.reload(dihedrals); ! fireMlistChanged(new MeasurementListEvent(this)); ! display.repaint(); return true; } --- 336,340 ---- dihedrals.update(); treeModel.reload(dihedrals); ! notifyControl(); return true; } *************** *** 392,444 **** boolean b = deleteMatchingDihedral(at[0], at[1], at[2], at[3]); } - } - } - } - - // - // Managing Listeners - // - - /** - * Add a listener to the list that's notified each time a change - * to the MeasurementList occurs. - * - * @param l the MeasurementListListener - */ - public void addMeasurementListListener(MeasurementListListener l) { - listenerList.add(MeasurementListListener.class, l); - } - - /** - * Remove a listener from the list that's notified each time a - * change to the MeasurementList occurs. - * - * @param l the MeasurementListListener - */ - public void removeMeasurementListListener(MeasurementListListener l) { - listenerList.remove(MeasurementListListener.class, l); - } - - // - // Fire methods - // - - /** - * Forward the given notification event to all - * MeasurementListListeners that registered themselves as - * listeners for this MeasurementList - * @see #addMeasurementListListener - * @see MeasurementListEvent - * @see EventListenerList */ - public void fireMlistChanged(MeasurementListEvent e) { - - // Guaranteed to return a non-null array - Object[] listeners = listenerList.getListenerList(); - - // Process the listeners last to first, notifying - // those that are interested in this event - for (int i = listeners.length - 2; i >= 0; i -= 2) { - if (listeners[i] == MeasurementListListener.class) { - ((MeasurementListListener) listeners[i + 1]).mlistChanged(e); } } --- 388,391 ---- --- MeasurementListEvent.java DELETED --- --- MeasurementListListener.java DELETED --- |
From: Michael T H. <mic...@us...> - 2003-02-05 11:33:12
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol In directory sc8-pr-cvs1:/tmp/cvs-serv19408/src/org/openscience/jmol Modified Files: ChemFrame.java DisplayControl.java ModelManager.java Log Message: restructuring measurements - step 1 Index: ChemFrame.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/ChemFrame.java,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -r1.91 -r1.92 *** ChemFrame.java 3 Feb 2003 17:15:56 -0000 1.91 --- ChemFrame.java 5 Feb 2003 11:33:07 -0000 1.92 *************** *** 47,86 **** private org.openscience.cdk.tools.AtomTypeFactory atf = null; - /** - * Returns the list of distance measurements. - */ - public Vector getDistanceMeasurements() { - return dlist; - } - - /** - * List of distance measurements. - */ - private Vector dlist; - - /** - * Returns the list of angle measurements. - */ - public Vector getAngleMeasurements() { - return alist; - } - - /** - * List of angle measurements. - */ - private Vector alist; - - /** - * Returns the list of dihedral measurements. - */ - public Vector getDihedralMeasurements() { - return dhlist; - } - - /** - * List of dihedral measurements. - */ - private Vector dhlist; - Point3d centerBoundingBox; Point3d cornerBoundingBox; --- 47,50 ---- *************** *** 184,193 **** public void setInfo(String info) { this.info = info; - } - - public void updateMlists(Vector dlist, Vector alist, Vector dhlist) { - this.dlist = dlist; - this.alist = alist; - this.dhlist = dhlist; } --- 148,151 ---- Index: DisplayControl.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/DisplayControl.java,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -r1.88 -r1.89 *** DisplayControl.java 4 Feb 2003 22:05:11 -0000 1.88 --- DisplayControl.java 5 Feb 2003 11:33:08 -0000 1.89 *************** *** 26,30 **** import org.openscience.jmol.app.Measure; - import org.openscience.jmol.app.MeasurementListEvent; import org.openscience.jmol.render.AtomRenderer; --- 26,29 ---- *************** *** 46,49 **** --- 45,49 ---- import java.awt.Component; import java.util.Hashtable; + import java.util.Vector; import java.util.BitSet; import javax.vecmath.Point3d; *************** *** 817,822 **** } ! public void mlistChanged(MeasurementListEvent mle) { ! modelManager.mlistChanged(mle); } --- 817,834 ---- } ! public Vector getDistanceMeasurements() { ! return modelManager.distanceMeasurements; ! } ! ! public Vector getAngleMeasurements() { ! return modelManager.angleMeasurements; ! } ! ! public Vector getDihedralMeasurements() { ! return modelManager.dihedralMeasurements; ! } ! ! public void clearMeasurements() { ! modelManager.clearMeasurements(); } Index: ModelManager.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/ModelManager.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** ModelManager.java 4 Feb 2003 22:05:24 -0000 1.14 --- ModelManager.java 5 Feb 2003 11:33:08 -0000 1.15 *************** *** 27,33 **** import org.openscience.jmol.Atom; import org.openscience.jmol.app.MeasurementList; - import org.openscience.jmol.app.MeasurementListEvent; import java.util.BitSet; import javax.vecmath.Point3d; import java.awt.Rectangle; --- 27,33 ---- import org.openscience.jmol.Atom; import org.openscience.jmol.app.MeasurementList; import java.util.BitSet; + import java.util.Vector; import javax.vecmath.Point3d; import java.awt.Rectangle; *************** *** 49,53 **** public int nframes = 0; public MeasurementList mlist = null; - public PropertyChangeSupport pcs = new PropertyChangeSupport(this); --- 49,52 ---- *************** *** 58,64 **** this.chemframe = chemfile.getFrame(0); Measurement.setChemFrame(chemframe); ! if (mlist != null) { ! mlistChanged(new MeasurementListEvent(mlist)); ! } haveFile = true; pcs.firePropertyChange(DisplayControl.PROP_CHEM_FILE, --- 57,61 ---- this.chemframe = chemfile.getFrame(0); Measurement.setChemFrame(chemframe); ! clearMeasurements(); haveFile = true; pcs.firePropertyChange(DisplayControl.PROP_CHEM_FILE, *************** *** 106,112 **** this.chemframe = chemframe; Measurement.setChemFrame(chemframe); ! if (mlist != null) { ! mlistChanged(new MeasurementListEvent(mlist)); ! } pcs.firePropertyChange(DisplayControl.PROP_CHEM_FRAME, chemframePrevious, chemframe); --- 103,107 ---- this.chemframe = chemframe; Measurement.setChemFrame(chemframe); ! clearMeasurements(); pcs.firePropertyChange(DisplayControl.PROP_CHEM_FRAME, chemframePrevious, chemframe); *************** *** 125,136 **** } ! public void mlistChanged(MeasurementListEvent mle) { ! MeasurementList source = (MeasurementList) mle.getSource(); ! mlist = source; ! chemframe.updateMlists(mlist.getDistanceList(), ! mlist.getAngleList(), ! mlist.getDihedralList()); } - public void setCenterAsSelected() { --- 120,132 ---- } ! public Vector distanceMeasurements = new Vector(); ! public Vector angleMeasurements = new Vector(); ! public Vector dihedralMeasurements = new Vector(); ! ! public void clearMeasurements() { ! distanceMeasurements.removeAllElements(); ! angleMeasurements.removeAllElements(); ! dihedralMeasurements.removeAllElements(); } public void setCenterAsSelected() { |
From: Michael T H. <mic...@us...> - 2003-02-05 09:01:52
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/io In directory sc8-pr-cvs1:/tmp/cvs-serv28694/io Modified Files: Gaussian94Reader.java Gaussian98Reader.java Log Message: moved NMRShielding back to core Index: Gaussian94Reader.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/io/Gaussian94Reader.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** Gaussian94Reader.java 4 Feb 2003 22:05:48 -0000 1.4 --- Gaussian94Reader.java 5 Feb 2003 09:01:48 -0000 1.5 *************** *** 22,26 **** import org.openscience.jmol.ChemFile; import org.openscience.jmol.ChemFrame; ! import org.openscience.jmol.app.NMRShielding; import org.openscience.jmol.Vibration; import java.util.Vector; --- 22,26 ---- import org.openscience.jmol.ChemFile; import org.openscience.jmol.ChemFrame; ! import org.openscience.jmol.NMRShielding; import org.openscience.jmol.Vibration; import java.util.Vector; Index: Gaussian98Reader.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/io/Gaussian98Reader.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** Gaussian98Reader.java 4 Feb 2003 22:05:49 -0000 1.4 --- Gaussian98Reader.java 5 Feb 2003 09:01:49 -0000 1.5 *************** *** 22,26 **** import org.openscience.jmol.ChemFile; import org.openscience.jmol.ChemFrame; ! import org.openscience.jmol.app.NMRShielding; import org.openscience.jmol.Vibration; import java.io.IOException; --- 22,26 ---- import org.openscience.jmol.ChemFile; import org.openscience.jmol.ChemFrame; ! import org.openscience.jmol.NMRShielding; import org.openscience.jmol.Vibration; import java.io.IOException; |
From: Michael T H. <mic...@us...> - 2003-02-05 09:01:51
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol In directory sc8-pr-cvs1:/tmp/cvs-serv28694 Added Files: NMRShielding.java Log Message: moved NMRShielding back to core |
From: Michael T H. <mic...@us...> - 2003-02-05 09:01:51
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/app In directory sc8-pr-cvs1:/tmp/cvs-serv28694/app Removed Files: NMRShielding.java Log Message: moved NMRShielding back to core --- NMRShielding.java DELETED --- |
From: Michael T H. <mic...@us...> - 2003-02-04 23:20:19
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/app In directory sc8-pr-cvs1:/tmp/cvs-serv7888a/src/org/openscience/jmol/app Added Files: AtomPropsMenu.java BandPlot.java BandPlotEPSRenderer.java BandPlotG2DRenderer.java BandPlotPanel.java BandPlotRenderer.java ConsoleTextArea.java ImageTyper.java JmolFileFilter.java PropertyGraph.java SelectSharcReference.java Splash.java Log Message: moved more app files --- NEW FILE: AtomPropsMenu.java --- /* * Copyright 2002 The Jmol Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package org.openscience.jmol.app; import org.openscience.jmol.*; import java.util.Vector; import java.awt.Component; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import javax.swing.AbstractButton; import javax.swing.JRadioButtonMenuItem; import javax.swing.JMenu; import javax.swing.ButtonGroup; /** * Extends the basic popup menu so that we can modify it in response * to new physical properties in a chemical model */ public class AtomPropsMenu extends JMenu { ButtonGroup bg; Vector list = new Vector(); DisplayControl control; public AtomPropsMenu(String name, DisplayControl control) { super(name); this.control = control; bg = new ButtonGroup(); JRadioButtonMenuItem mi = new JRadioButtonMenuItem("None"); list.addElement(mi); add(mi); bg.add(mi); mi.setSelected(true); mi.addItemListener(propsListener); } public void replaceList(Vector propsList) { JRadioButtonMenuItem mi = (JRadioButtonMenuItem) list.elementAt(0); mi.setSelected(true); for (int i = list.size() - 1; i > 0; i--) { JRadioButtonMenuItem mi2 = (JRadioButtonMenuItem) list.elementAt(i); mi2.removeItemListener(propsListener); bg.remove(mi2); remove(mi2); list.removeElementAt(i); } for (int i = 0; i < propsList.size(); i++) { String propertyName = (String) propsList.elementAt(i); JRadioButtonMenuItem mi3 = new JRadioButtonMenuItem(propertyName); list.addElement(mi3); add(mi3); bg.add(mi3); mi3.addItemListener(propsListener); } } ItemListener propsListener = new ItemListener() { Component c; AbstractButton b; public void itemStateChanged(ItemEvent e) { JRadioButtonMenuItem rbmi = (JRadioButtonMenuItem) e.getSource(); String mode = rbmi.getText(); if (mode.equals("None")) { control.setPropertyStyleString(""); } else { control.setPropertyStyleString(rbmi.getText()); } } }; } --- NEW FILE: BandPlot.java --- /* * Copyright 2002 The Jmol Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package org.openscience.jmol.app; import org.openscience.jmol.util.*; import org.openscience.jmol.*; import java.util.StringTokenizer; import java.util.Vector; import javax.swing.JOptionPane; import java.io.File; public class BandPlot { EnergyBand energyBand; Vector bandPlotSections = new Vector(0); // a BandPlotSection vector String plotDef; int energyUnits; double conversionFactor; double fontsize1; // x (in pixel) double fontsize2; // y (in pixel) double fontsize3; // y label (in pixel) double ticSize; // (in pixel) // Y coordinate. We use an *absolute* behavior double minE; double maxE; double fermiE; int nvtics; int nhtics; String yLabel; //if true, rounds energies according to the number // of decimal figures. If false rounds energies according to // the number of significative figures int roundScheme=0; int nRound=2; int bigSepNumber=0; //Number of big separations in the plot. double bigSepSize; // String line; // To generate PostScript public BandPlot(EnergyBand energyBand, String plotDef, int energyUnits, double minE, double maxE, double fermiE, int nRound, int roundScheme, int nvtics, int nhtics, int ticSize, double fontsize1, double fontsize2, double fontsize3, double bigSepSize, String yLabel) throws ParseErrorException { this.energyBand = energyBand; this.plotDef = plotDef; this.energyUnits = energyUnits; conversionFactor = (double)Units.getConversionFactor (energyBand.getEnergyUnits(), energyUnits); this.nRound = nRound; this.roundScheme = roundScheme; this.nvtics = nvtics; this.nhtics = nhtics; this.ticSize = ticSize; this.fontsize1 = fontsize1; this.fontsize2 = fontsize2; this.fontsize3 = fontsize3; this.minE = minE; this.maxE = maxE; this.fermiE= fermiE; this.bigSepSize = bigSepSize; this.yLabel = yLabel; parse(); } public class ParseErrorException extends Exception { public ParseErrorException(int index) { //super("Parse Error. Position: " + index); } } private void parse() throws ParseErrorException { StringTokenizer st = new StringTokenizer(plotDef, "[],;-{}", true); String s=""; boolean isInt; boolean reverse=false; int value = 0; EnergyBand.KLine kLine=null; BandPlotSection section=null; final int WAIT_LINEINDEX = 0; final int WAIT_FIRSTINDEX = 1; final int WAIT_SECONDINDEX = 2; final int WAIT_LABEL = 3; final int WAIT_SEP = 4; int flag = WAIT_LINEINDEX; String sepString = ""; boolean isFirstIndex = true; boolean sepFound; int lineIndex; int parseIndex=0; //use to generate a ParseError try { while (st.hasMoreTokens()) { s = st.nextToken(); parseIndex = parseIndex+ s.length(); isInt = true; try { value = Integer.parseInt(s); } catch (NumberFormatException e){ isInt = false; } switch (flag) { case WAIT_SEP: sepFound= false; for (int i=0; i<sepString.length(); i++) { if (s.charAt(0) == (sepString.charAt(i))) { switch (s.charAt(0)) { case ',': flag = WAIT_LINEINDEX; section.endDelimiter = VLINE; reverse=false; break; case ';': flag = WAIT_LINEINDEX; section.endDelimiter = BIGSEP; bigSepNumber++; reverse=false; break; case '[': flag = WAIT_FIRSTINDEX; break; case '-': flag = WAIT_SECONDINDEX; break; case '{': flag = WAIT_LABEL; break; case ']': flag = WAIT_SEP; sepString=",;"; break; case '}': flag = WAIT_SEP; if (isFirstIndex) { sepString="-"; } else { sepString="]"; } break; } sepFound= true; } } if (sepFound == false) { throw new ParseErrorException(parseIndex); } break; case WAIT_LINEINDEX: if (s.equals("-")) { reverse = true; } else if (isInt) { lineIndex = value; section = new BandPlotSection(lineIndex, reverse); kLine = energyBand.getKLine(lineIndex); bandPlotSections.addElement(section); flag = WAIT_SEP; sepString=",;["; } else { throw new ParseErrorException(parseIndex); } break; case WAIT_FIRSTINDEX: section.origName=""; section.endName=""; if (isInt) { if (reverse) { section.endIndex = value; if (value == 0) { section.endName = kLine.getOriginName(); } else if (value == kLine.getNumberOfkPoints()-1){ section.endName = kLine.getEndName(); } } else { section.origIndex = value; if (value == 0) { section.origName = kLine.getOriginName(); } else if (value == kLine.getNumberOfkPoints()-1){ section.origName = kLine.getEndName(); } } flag = WAIT_SEP; sepString="{-"; isFirstIndex = true; } else { throw new ParseErrorException(parseIndex); } break; case WAIT_SECONDINDEX: if (isInt) { if (reverse) { section.origIndex = value; if (value == 0) { section.origName = kLine.getOriginName(); } else if (value == kLine.getNumberOfkPoints()-1){ section.origName = kLine.getEndName(); } } else { section.endIndex = value; if (value == 0) { section.endName = kLine.getOriginName(); } else if (value == kLine.getNumberOfkPoints()-1){ section.endName = kLine.getEndName(); } } flag = WAIT_SEP; sepString="{]"; isFirstIndex = false; } else { throw new ParseErrorException(parseIndex); } break; case WAIT_LABEL: if (isFirstIndex) { if (reverse) { section.endName = s; } else { section.origName = s; } } else { if (reverse) { section.origName = s; } else { section.endName = s; } } flag = WAIT_SEP; sepString="}"; break; } //end swith } //end while } catch (ParseErrorException parseError) { JOptionPane.showMessageDialog(null, plotDef + " !!Error at position "+ (parseIndex-1), "Parse Error", JOptionPane.ERROR_MESSAGE); throw new ParseErrorException(parseIndex); } } //end parse final static int NONE = 0; final static int VLINE = 1; final static int BIGSEP = 2; class BandPlotSection { int lineIndex; int origIndex; String origName; int endIndex; String endName; int endDelimiter; BandPlotSection(int lineIndex, boolean reverse) { this.lineIndex = lineIndex; //default value if (reverse) { origIndex = energyBand.getKLine(lineIndex).getNumberOfkPoints()-1; origName = energyBand.getKLine(lineIndex).getEndName(); endIndex = 0; endName = energyBand.getKLine(lineIndex).getOriginName(); } else { origIndex = 0; origName = energyBand.getKLine(lineIndex).getOriginName(); endIndex = energyBand.getKLine(lineIndex).getNumberOfkPoints()-1; endName = energyBand.getKLine(lineIndex).getEndName(); } } } //end class BandPlotSection } //end class BandPlot --- NEW FILE: BandPlotEPSRenderer.java --- package org.openscience.jmol.app; import java.io.IOException; import org.openscience.jmol.util.*; import java.io.OutputStreamWriter; import java.io.BufferedWriter; import java.io.OutputStream; import java.io.FileOutputStream; import java.io.File; import java.io.FileNotFoundException; import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.awt.geom.*; import java.util.*; public class BandPlotEPSRenderer extends BandPlotRenderer { FileOutputStream file; BufferedWriter w; public BandPlotEPSRenderer(BandPlot bandPlot, double scalex, double ratio, File file) throws FileNotFoundException { super(bandPlot, scalex, ratio); //ebp = energyBandPlot; try { this.file = new FileOutputStream(file); } catch (IOException ioe) { throw new FileNotFoundException("" + file); } w = new BufferedWriter(new OutputStreamWriter(this.file), 1024); } public void generateEPS() throws IOException { //Generate Encapsulated PostScript Header writeLine("%!PS-Adobe-2.0 EPSF-2.0"); writeLine("%%Title: Energy Band plot"); writeLine("%%Creator: Jmol"); writeLine("%%CreationDate: Mon Nov 11 11:26:46 2002"); //FIX writeLine("%%For: fabian@sandy (Fabian Dortu,,,)"); //FIX writeLine("%%BoundingBox: 0 0 " //Needed for EPS!!!! + plotLength + " " + plotHeight); //Generate core render(); // Finalize w.flush(); w.close(); file.flush(); file.close(); } //end render private void writeLine(String line) { try { w.write(line, 0, line.length()); w.newLine(); } catch (IOException ioe) { } } double getX() { return xorigin + x*scalex; } double getX(double x) { return xorigin + x*scalex; } double getY() { return yorigin + (y-ebp.minE)*scaley; } double getY(double y) { return yorigin + (y-ebp.minE)*scaley; } void setFont(String name, int size) { } void setLineWidth(int width) { } void drawLineR(double xorig, double yorig, double xend, double yend, int thickness) { String psLine=" gsave newpath " + thickness + " setlinewidth "; psLine = psLine + getX(xorig) + " " + getY(yorig) + " moveto "; psLine = psLine + getX(xend) + " " + getY(yend) + " lineto stroke"; psLine = psLine + " grestore "; writeLine(psLine); } void drawLineA(double xorig, double yorig, double xend, double yend, int thickness) { String psLine=" gsave newpath " + thickness + " setlinewidth "; psLine = psLine + xorig + " " + yorig + " moveto "; psLine = psLine + xend + " " + yend + " lineto stroke"; psLine = psLine + " grestore "; writeLine(psLine); } // Draw a vertical separation at the current x void drawVerticalSeparation(int linewidth) { drawLineR(x, ebp.minE, x, ebp.maxE, linewidth); } //Draw a horizontal separation at the current y void drawHorizontalSeparation(int linewidth, double orig, double end) { drawLineR(orig, y, end, y, linewidth); } //Draw vertical tics at current x to the left(right) direction //if direction is true(false) void drawVerticalTics(int ntics, boolean direction, int linewidth) { double step = (ebp.maxE - ebp.minE)/ntics; for (int i=0; i<= ntics ;i++) { if (direction) { drawLineA(getX(x), getY(ebp.minE + i*step), getX(x) - ebp.ticSize, getY(ebp.minE + i*step), linewidth); } else { drawLineA(getX(x), getY(ebp.minE + i*step), getX(x) + ebp.ticSize, getY(ebp.minE + i*step), linewidth); } } } void drawVerticalTicsLabels(int ntics, int fontsize) { String value; double step = (ebp.maxE - ebp.minE)/ntics; for (int i=0; i<= ntics ;i++) { value = Rounder.rounds((ebp.minE + i*step ), ebp.nRound, ebp.roundScheme); drawText(value, fontsize, getX() , getY(ebp.minE + i*step) - fontsize /3, 2, //Align right 0.0); //No rotation } } void drawHorizontalTics(int ntics, double orig, double end, int linewidth) { double step = (end-orig)/ntics; for (int i=0; i < ntics; i++){ drawLineA(getX(orig + i*step), getY(y), getX(orig + i*step), getY(y) + ebp.ticSize, linewidth); } } void drawHorizontalTicsLabel(double pos, String line, int fontsize) { drawText(line, fontsize, getX(pos), fontsize * .15f, 1, 0.0f); } void drawVerticalAxisLabel(String label, int fontsize) { drawText(label, fontsize, getMaxFontHeight("Times-Roman", fontsize), yorigin + (ebp.maxE-ebp.minE)/2 *scaley, 1, 90.0f); } void drawText(String text,int fontsize, double x, double y, int align, double rotation) { final int ALIGN_LEFT = 0; final int ALIGN_CENTER = 1; final int ALIGN_RIGHT = 2; FormatedText fText = new FormatedText(text, fontsize); double width = (double)fText.getWidth(); Vector textDef = fText.getTextDef(); Object token; String tokenPS; Font f = new Font("Times-Roman", Font.PLAIN, fontsize); String fontPS = "Times-Roman"; int sizePS = fontsize; double dx=0; double dy=0; switch(align) { case ALIGN_LEFT: dx=0; break; case ALIGN_CENTER: dx=-width/2.0; break; case ALIGN_RIGHT: dx=-width; break; } String psLine=" gsave "; psLine = psLine + x + " " + y + " translate " + rotation + " rotate 0 0 moveto "; for (Enumeration e = textDef.elements() ; e.hasMoreElements() ;) { token = e.nextElement(); if(token instanceof Integer) { switch (((Integer)token).intValue()) { case FormatedText.FONT_NORMAL: f = new Font("Times-Roman", Font.PLAIN, fontsize); fontPS = "Times-Roman"; sizePS = fontsize; break; case FormatedText.FONT_SYMBOL: f = new Font("Greek Poly Plain", Font.PLAIN, fontsize); fontPS = "Symbol"; sizePS = fontsize; break; case FormatedText.POS_NORMAL: f = new Font(f.getName(), Font.PLAIN, fontsize); sizePS = fontsize; dy=-dy; break; case FormatedText.POS_EXP: dy = (double)fontsize *2/3; f = new Font(f.getName(), Font.PLAIN, (int)((double)fontsize *1/2)); sizePS = (int)((double)fontsize *1/2); break; } } else if (token instanceof String) { FontMetrics fm = dummyFrame.getFontMetrics(f); // "(" and ")" must be "escaped" with "\(" and "\)" // because have PostScrip signification. // The regexp seems complicated // because: // *the escape character must escaped in both // java and in the regexp itself. // *the paranthesis must be escaped in regexp. tokenPS=(String)token; /* replaceAll is only available in JVM 1.4 and greater see substitute routine below I have not tested this, so please confirm that it works properly tokenPS=tokenPS.replaceAll("\\(","\\\\("); tokenPS=tokenPS.replaceAll("\\)","\\\\)"); */ tokenPS=replaceCharString(tokenPS, '(', "\\("); tokenPS=replaceCharString(tokenPS, ')', "\\)"); psLine=psLine + "/" + fontPS + " findfont " + sizePS + " scalefont setfont " + dx + " " + dy + " rmoveto " + "(" + tokenPS + ")" + " show "; dx=0; // PostScript automaticaly increments its position } } //for on textDef elements psLine = psLine + " grestore "; writeLine(psLine); } String replaceCharString(String strOld, char charOld, String substrNew) { // FIXME - mth 2003 01 07 - confirm that this works // I wrote this as a replacement for the replaceAll code because // replaceAll is only available on JVM >= 1.4 // I have not tested this code to convirm that it works String strNew = ""; int ichStart = 0; int ichMatch; while ((ichMatch = strOld.indexOf(charOld, ichStart)) != -1) { strNew += strOld.substring(ichStart, ichMatch) + substrNew; ++ichStart; } strNew += strOld.substring(ichStart); return strNew; } } --- NEW FILE: BandPlotG2DRenderer.java --- package org.openscience.jmol.app; import org.openscience.jmol.util.*; import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.awt.geom.*; import java.lang.Integer; import java.util.*; import java.lang.reflect.Array; public class BandPlotG2DRenderer extends BandPlotRenderer { Graphics2D g2; JPanel bandPlotPanel; public BandPlotG2DRenderer(BandPlot bandPlot, double scalex, double ratio) { super(bandPlot, scalex, ratio); bandPlotPanel = new BandPlotPanel(this); } public JPanel getJPanel() { return bandPlotPanel; } void setGraphics2D(Graphics2D g2) { this.g2 = g2; } double getX() { return xorigin + x*scalex; } double getX(double x) { return xorigin + x*scalex; } double getY() { return (plotHeight - (yorigin + (y-ebp.minE)*scaley)); } double getY(double y) { return (plotHeight - (yorigin + (y-ebp.minE)*scaley)); } void setFont(String name, int size) { g2.setFont(new Font(name, Font.PLAIN, size)); } void setLineWidth(int width) { } //Draw line in relative coordinate. void drawLineR(double xorig, double yorig, double xend, double yend, int thickness) { g2.drawLine((int)getX(xorig), (int)getY(yorig), (int)getX(xend), (int)getY(yend)); } //Draw line in absolute coordinate. void drawLineA(double xorig, double yorig, double xend, double yend, int thickness) { g2.drawLine((int)xorig, (int)yorig, (int)xend, (int)yend); } // Draw a vertical separation at the current x void drawVerticalSeparation(int linewidth) { drawLineR(x, ebp.minE, x, ebp.maxE, linewidth); } //Draw a horizontal separation at the current y void drawHorizontalSeparation(int linewidth, double orig, double end) { drawLineR(orig, y, end, y, linewidth); } //Draw vertical tics at current x to the left(right) direction //if direction is true(false) void drawVerticalTics(int ntics, boolean direction, int linewidth) { double step = (ebp.maxE - ebp.minE)/ntics; for (int i=0; i<= ntics ;i++) { if (direction) { drawLineA(getX(x), getY(ebp.minE + i*step), getX(x) - ebp.ticSize, getY(ebp.minE + i*step), linewidth); } else { drawLineA(getX(x), getY(ebp.minE + i*step), getX(x) + ebp.ticSize, getY(ebp.minE + i*step), linewidth); } } } void drawVerticalTicsLabels(int ntics, int fontsize) { String value; double width; g2.setFont(new Font("Times-Roman", Font.PLAIN, fontsize)); double step = (ebp.maxE - ebp.minE)/ntics; for (int i=0; i<= ntics ;i++) { value = Rounder.rounds((ebp.minE + i*step ), ebp.nRound, ebp.roundScheme); width = getStringWidth(value, g2.getFont().getFontName(), g2.getFont().getSize()); g2.drawString(value, (int)(getX() - width), (int)(getY(ebp.minE + i*step) + ebp.fontsize2 /2)); } } void drawHorizontalTics(int ntics, double orig, double end, int linewidth) { double step = (end-orig)/ntics; for (int i=0; i < ntics; i++){ drawLineA(getX(orig + i*step), getY(y), getX(orig + i*step), getY(y) - ebp.ticSize, linewidth); } } void drawHorizontalTicsLabel(double pos, String label, int fontsize) { drawText(label, fontsize, (int)getX(pos), (int)(plotHeight), 1, //Align center); 0); } void drawVerticalAxisLabel(String label, int fontsize) { //The label is centered around the middle of the energy axis drawText(label, fontsize, getMaxFontHeight("Times-Roman", fontsize), (int)(plotHeight - (yorigin + (ebp.maxE-ebp.minE)/2 *scaley)) ,1 //Align center ,-90.0); } void drawText(String text,int fontsize, double x, double y, int align, double rotation) { final int ALIGN_LEFT = 0; final int ALIGN_CENTER = 1; final int ALIGN_RIGHT = 2; FormatedText fText = new FormatedText(text, fontsize); double width = (double)fText.getWidth(); Vector textDef = fText.getTextDef(); Object token; Font f = new Font("Times-Roman", Font.PLAIN, fontsize); double dx=0; double dy=0; switch(align) { case ALIGN_LEFT: dx=0; break; case ALIGN_CENTER: dx=-width/2.0; break; case ALIGN_RIGHT: dx=-width; break; } AffineTransform saveXform = g2.getTransform(); AffineTransform at = new AffineTransform(); at.rotate(Math.toRadians(rotation), x, y); g2.transform(at); for (Enumeration e = textDef.elements() ; e.hasMoreElements() ;) { token = e.nextElement(); if(token instanceof Integer) { switch (((Integer)token).intValue()) { case FormatedText.FONT_NORMAL: f = new Font("Times-Roman", Font.PLAIN, fontsize); g2.setFont(f); break; case FormatedText.FONT_SYMBOL: f = new Font("Greek Poly Plain", Font.PLAIN, fontsize); g2.setFont(f); break; case FormatedText.POS_NORMAL: f = new Font(f.getName(), Font.PLAIN, fontsize); dy=0; g2.setFont(f); break; case FormatedText.POS_EXP: dy=-(double)fontsize *2/3; f = new Font(f.getName(), Font.PLAIN, (int)((double)fontsize *1/2)); g2.setFont(f); break; } } else if (token instanceof String) { FontMetrics fm = g2.getFontMetrics(f); g2.drawString((String)token,(int)(x + dx), (int)(y + dy)); dx = dx + fm.stringWidth((String)token); } } //for on textDef elements g2.setTransform(saveXform); // DUBUG: Print font list //GraphicsEnvironment ge // = GraphicsEnvironment.getLocalGraphicsEnvironment(); //Font[] allFonts = ge.getAllFonts(); //for (int i=0; i < Array.getLength(allFonts); i++) { //System.out.println("Font "+ i +" : "+ allFonts[i].getFontName()); //} } } --- NEW FILE: BandPlotPanel.java --- package org.openscience.jmol.app; import javax.swing.*; import java.awt.*; public class BandPlotPanel extends JPanel { BandPlotG2DRenderer bpg2r; public BandPlotPanel(BandPlotG2DRenderer bpg2r) { this.bpg2r = bpg2r; } public void paint(Graphics g) { Graphics2D g2 = (Graphics2D) g; bpg2r.setGraphics2D(g2); super.paintComponent(g2); //paint background setBackground(Color.white); bpg2r.render(); } } --- NEW FILE: BandPlotRenderer.java --- package org.openscience.jmol.app; import org.openscience.jmol.util.*; import org.openscience.jmol.*; import javax.swing.*; import java.awt.*; import java.awt.event.*; abstract class BandPlotRenderer { BandPlot ebp; JFrame dummyFrame = new JFrame(); //dummy Frame to compute string width. //coordinates: (0,0) is loxer left // x increase right // y increase up double x; double y; double xorigin; //origin of the plot (the band diagram) axis. double yorigin; //minimum energy position. Labels are below double plotLength; double plotHeight; double scalex; double scaley; double ratio; public BandPlotRenderer(BandPlot ebp, double scalex, double ratio) { this.ebp = ebp; this.scalex = scalex; this.ratio = ratio; // Set xorigin. Depends on width of the units label if ((Rounder.rounds(ebp.maxE, ebp.nRound, ebp.roundScheme)).length() > (Rounder.rounds(ebp.minE, ebp.nRound, ebp.roundScheme)).length()) { xorigin = 1.4*getStringWidth ((Rounder.rounds(ebp.maxE, ebp.nRound, ebp.roundScheme)), "Times-Roman", (int)ebp.fontsize2) + getMaxFontHeight("Times-Roman",(int)ebp.fontsize3); } else { xorigin = 1.4*getStringWidth ((Rounder.rounds(ebp.minE, ebp.nRound, ebp.roundScheme)), "Times-Roman" , (int)ebp.fontsize2) + getMaxFontHeight("Times-Roman",(int)ebp.fontsize3); } yorigin=getMaxFontHeight("Times-Roman",(int)ebp.fontsize1); plotLength = getPlotLength(); scaley = ratio / (ebp.maxE-ebp.minE) * scalex; plotHeight = getPlotHeight(); } public void render() { double xold; int sepFlag=0; BandPlot.BandPlotSection plotSection; boolean ticsLabel=true; x=0; // Be careful if modifying variable x (side effects bc relative behavior) // Variable y can be modified (absolute behavior) for (int i=0; i< ebp.bandPlotSections.size() ;i++) { ticsLabel = true; // Draw a thick vertical line if // *it is the first section // *a big separation has been done if (i==0 || sepFlag ==1) { sepFlag = 0; drawVerticalSeparation(2); drawVerticalTics(ebp.nvtics,false,1); if (i==0) { drawVerticalTicsLabels(ebp.nvtics, (int)ebp.fontsize2); } } plotSection = (BandPlot.BandPlotSection)ebp.bandPlotSections.elementAt(i); EnergyBand.KLine kLine = ebp.energyBand.getKLine(plotSection.lineIndex); xold = x; for (int eindex=0; eindex < kLine.getNumberOfBands(); eindex++) { x = xold; drawSectionLine(plotSection, kLine, eindex, ticsLabel); //x is modified ticsLabel = false; } //end for eindex y = ebp.minE; drawHorizontalSeparation(2, xold, x); drawHorizontalTics(ebp.nhtics, xold, x, 1); y = ebp.maxE; drawHorizontalSeparation(2, xold, x); y = ebp.fermiE; drawHorizontalSeparation(1, xold, x); switch (plotSection.endDelimiter) { case BandPlot.NONE: break; case BandPlot.VLINE: drawVerticalSeparation(1); break; case BandPlot.BIGSEP: sepFlag=1; drawVerticalSeparation(2); drawVerticalTics(ebp.nvtics,true,1); x = x + ebp.bigSepSize; break; } } //end for bandSection drawVerticalSeparation(2); drawVerticalTics(ebp.nvtics,true,1); drawVerticalAxisLabel(ebp.yLabel,(int)ebp.fontsize3); } //end render /** * draw the energy curve of the line kLine with index eindex * according to plotSection specifications. */ public void drawSectionLine(BandPlot.BandPlotSection plotSection, EnergyBand.KLine kLine, int eindex, boolean ticsLabel) { double energie; int kindexOld = plotSection.origIndex; double xtmp=0; double ytmp=0; if (plotSection.origIndex < plotSection.endIndex) { for (int kindex = plotSection.origIndex; kindex <= plotSection.endIndex; kindex++) { energie = kLine.getEnergies(kindex)[eindex] * ebp.conversionFactor; x = x+ kLine.getDistance(kindex, kindexOld); y = energie; if (kindex != kindexOld) { drawLineR(xtmp, ytmp, x, y, 0); } if (ticsLabel){ // draw only once if (kindex==plotSection.origIndex) { drawHorizontalTicsLabel(x, plotSection.origName, (int)ebp.fontsize1); } else if (kindex==plotSection.endIndex) { drawHorizontalTicsLabel(x, plotSection.endName, (int)ebp.fontsize1); } } kindexOld = kindex; xtmp = x; ytmp = y; } //end kindex } else { for (int kindex = plotSection.origIndex; kindex >= plotSection.endIndex; kindex--) { energie = kLine.getEnergies(kindex)[eindex] * ebp.conversionFactor; x = x+ kLine.getDistance(kindex, kindexOld); y = energie; if (kindex != kindexOld) { drawLineR(xtmp, ytmp, x, y, 0); } if (ticsLabel){ // draw only once if (kindex==plotSection.origIndex) { drawHorizontalTicsLabel(x, plotSection.origName, (int)ebp.fontsize1); } else if (kindex==plotSection.endIndex) { drawHorizontalTicsLabel(x, plotSection.endName, (int)ebp.fontsize1); } } kindexOld = kindex; xtmp = x; ytmp = y; } //end kindex } } public double getPlotLength() { BandPlot.BandPlotSection plotSection; double plotLength=0; for (int i=0; i< ebp.bandPlotSections.size() ;i++) { plotSection = (BandPlot.BandPlotSection)ebp.bandPlotSections.elementAt(i); EnergyBand.KLine kLine = ebp.energyBand.getKLine(plotSection.lineIndex); plotLength = plotLength + kLine.getDistance(plotSection.origIndex, plotSection.endIndex); } plotLength = plotLength*scalex + xorigin; plotLength = plotLength + (ebp.bigSepNumber*ebp.bigSepSize)*scalex; plotLength = plotLength + (double)getStringWidth("M","Times-Roman" , (int)ebp.fontsize1) /2 ; return plotLength; } public double getPlotHeight() { return (yorigin + (ebp.maxE - ebp.minE)*scaley + (double)getMaxFontHeight("Times-Roaman",(int)ebp.fontsize2) /2); } abstract double getX(); abstract double getX(double x); abstract double getY(); abstract double getY(double y); abstract void drawLineR(double xorig, double yorig, double xend, double yend, int thickness); abstract void drawLineA(double xorig, double yorig, double xend, double yend, int thickness); // Draw a vertical separation at the current x abstract void drawVerticalSeparation(int linewidth); //Draw a horizontal separation at the current y abstract void drawHorizontalSeparation(int linewidth, double orig, double end); //Draw vertical tics at current x to the left(right) direction //if direction is true(false) abstract void drawVerticalTics(int ntics, boolean direction, int linewidth); abstract void drawVerticalTicsLabels(int ntics, int fontsize); abstract void drawHorizontalTics(int ntics, double orig, double end, int linewidth); abstract void drawHorizontalTicsLabel(double pos, String label, int fontsize); abstract void drawVerticalAxisLabel(String label, int fontsize); abstract void setFont(String name, int size); abstract void setLineWidth(int width); //Alignment markers public final static int ALIGN_LEFT=0; public final static int ALIGN_RIGHT=1; public final static int ALIGN_CENTER=2; abstract void drawText(String text,int fontsize, double x, double y, int align, double rotation); public double getStringWidth(String string, String name, int size){ Font f = new Font(name, Font.PLAIN, size); FontMetrics fm = dummyFrame.getFontMetrics(f); return (double)fm.stringWidth(string); } public double getMaxFontHeight(String name, int size){ Font f = new Font(name, Font.PLAIN, size); FontMetrics fm = dummyFrame.getFontMetrics(f); return ((double)fm.getHeight())*1.1; } } //end class BandPlotRenderer --- NEW FILE: ConsoleTextArea.java --- /* * Copyright 2002 The Jmol Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package org.openscience.jmol.app; import org.openscience.jmol.*; import java.io.InputStream; import java.io.PrintStream; import java.io.InputStreamReader; import java.io.BufferedReader; import java.io.IOException; import javax.swing.JTextArea; import javax.swing.JOptionPane; import javax.swing.text.JTextComponent; import javax.swing.text.Document; public class ConsoleTextArea extends JTextArea { public ConsoleTextArea(InputStream[] inStreams) { for (int i = 0; i < inStreams.length; ++i) { startConsoleReaderThread(inStreams[i]); } } // ConsoleTextArea() public ConsoleTextArea() throws IOException { final LoopedStreams ls = new LoopedStreams(); // Redirect System.out & System.err. PrintStream ps = new PrintStream(ls.getOutputStream()); System.setOut(ps); System.setErr(ps); startConsoleReaderThread(ls.getInputStream()); } // ConsoleTextArea() private void startConsoleReaderThread(InputStream inStream) { final BufferedReader br = new BufferedReader(new InputStreamReader(inStream)); new Thread(new Runnable() { public void run() { StringBuffer sb = new StringBuffer(); try { String s; Document doc = getDocument(); s = br.readLine(); while (s != null) { boolean caretAtEnd = false; caretAtEnd = (getCaretPosition() == doc.getLength()); sb.setLength(0); append(sb.append(s).append('\n').toString()); if (caretAtEnd) { setCaretPosition(doc.getLength()); } s = br.readLine(); } } catch (IOException e) { JOptionPane.showMessageDialog(null, "Error reading from BufferedReader: " + e); System.exit(1); } } }).start(); } } --- NEW FILE: ImageTyper.java --- /* * Copyright 2002 The Jmol Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package org.openscience.jmol.app; import java.io.File; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import javax.swing.JFileChooser; import javax.swing.JComponent; import javax.swing.SwingConstants; import javax.swing.JSlider; import javax.swing.JPanel; import javax.swing.JComboBox; import javax.swing.border.TitledBorder; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.Container; import java.awt.BorderLayout; import java.awt.FlowLayout; public class ImageTyper extends JPanel { private String[] Choices = { "BMP", "GIF", "JPEG", "PNG", "PPM" }; private int def = 0; private String result = Choices[def]; private int JpegQuality; private JSlider qSlider; private JComboBox cb; /** * A simple panel with a combo box for allowing the user to choose * the input file type. * * @param fc the file chooser */ public ImageTyper(JFileChooser fc) { setLayout(new BorderLayout()); JPanel cbPanel = new JPanel(); cbPanel.setLayout(new FlowLayout()); cbPanel.setBorder(new TitledBorder("Image Type")); cb = new JComboBox(); for (int i = 0; i < Choices.length; i++) { cb.addItem(Choices[i]); } cbPanel.add(cb); cb.setSelectedIndex(def); cb.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { JComboBox source = (JComboBox) e.getSource(); result = (String) source.getSelectedItem(); if (result.equals("JPEG")) { qSlider.setEnabled(true); } else { qSlider.setEnabled(false); } } }); add(cbPanel, BorderLayout.NORTH); JPanel qPanel = new JPanel(); qPanel.setLayout(new BorderLayout()); qPanel.setBorder(new TitledBorder("JPEG Quality")); qSlider = new JSlider(JSlider.HORIZONTAL, 0, 10, 8); qSlider.putClientProperty("JSlider.isFilled", Boolean.TRUE); qSlider.setPaintTicks(true); qSlider.setMajorTickSpacing(1); qSlider.setPaintLabels(true); qSlider.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { JSlider source = (JSlider) e.getSource(); JpegQuality = source.getValue(); } }); // by default, disabled. Can be turned on with choice of JPEG. qSlider.setEnabled(false); qPanel.add(qSlider, BorderLayout.SOUTH); add(qPanel, BorderLayout.SOUTH); } /** * returns the file type which contains the user's choice */ public String getType() { return result; } /** * returns the quality (on a scale from 0 to 10) of the JPEG * image that is to be generated. Returns -1 if choice was not JPEG. */ public int getQuality() { int qual = -1; if (result.equals("JPEG")) { qual = JpegQuality; } return qual; } /** * removes the GIF entry for those times when we have > 8 bit images */ public void disableGIF() { for (int i = 0; i < cb.getItemCount(); i++) { if (((String) cb.getItemAt(i)).equals("GIF")) { cb.removeItemAt(i); } } } } --- NEW FILE: JmolFileFilter.java --- /* * Copyright 2002 The Jmol Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package org.openscience.jmol.app; import java.io.File; public class JmolFileFilter extends javax.swing.filechooser.FileFilter { private String endMask = "."; private String name = ""; private boolean acceptNoDots = false; /**Creates a filter which will accept only files ending in * mask. If acceptNoDot is true then files without an extension * are also accepted. * @param mask String in which accepted files will end * @param typeName Name of this type and colon, eg "Xmol", use null none for none * @param acceptNoDot If true then files without dots (eg Unix files) will be accepted. **/ public JmolFileFilter(String mask, String typeName, boolean acceptNoDot) { endMask = mask.toLowerCase(); if (typeName != null) { name = typeName + " (" + "*" + endMask + ")"; } else { name = "*" + endMask; } acceptNoDots = acceptNoDot; } /**Overrides accept() in * javax.swing.filechooser.FileFilter. Always accepts * directories. **/ public boolean accept(File f) { String fname = f.getName(); if (f.isDirectory()) { return true; } else if (fname.indexOf(".") == -1) { return acceptNoDots; } else { return (fname.toLowerCase().endsWith(endMask)); } } /**Overrides getDescription() in * javax.swing.filechooser.FileFilter. Returns the current * mask.**/ public String getDescription() { return (name); } } --- NEW FILE: PropertyGraph.java --- /* * Copyright 2002 The Jmol Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package org.openscience.jmol.app; import org.openscience.jmol.*; import jas.hist.ScatterPlotSource; import jas.hist.ScatterEnumeration; import jas.hist.JASHistData; import jas.hist.JASHist; import jas.hist.DataSource; import java.awt.Container; import java.awt.Component; import java.awt.Toolkit; import java.awt.GridLayout; import java.awt.Dimension; import java.awt.Window; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.Vector; import java.util.Enumeration; import javax.swing.Action; import javax.swing.AbstractAction; import javax.swing.JFrame; import javax.swing.JDialog; import javax.swing.JPanel; public class PropertyGraph extends JDialog implements PropertyChangeListener, ActionListener { /** * Creates a dialog. * * @param f the parent frame */ public PropertyGraph(JFrame f) { super(f, "Property Graph", false); makeNewGraph(); } /** * Instantiates a new content JPanel for this JDialog. * Called when loading a new file. */ private void makeNewGraph() { gl = new GridLayout(1, 0); panel = new JPanel(gl); dataFound = false; // see findData() setContentPane(panel); setSize(500, 500); addWindowListener(new GraphWindowListener()); pack(); centerDialog(); } /** * Set ChemFile from which the Frame Properties will be loaded. * If no Frame Properties are found, the PropertyGraph action will * be disabled; otherwise, it will be enabled. * * @param inputFile the ChemFile containing potentially graphable data */ private void setChemFile(ChemFile inputFile) { if (isVisible()) { setVisible(false); } restoreConflictingActions(); hasGraphableProperties = false; GPs = new Vector(); this.inputFile = inputFile; // Check for graphable properties Vector filePL = inputFile.getFramePropertyList(); for (int j = 0; j < filePL.size(); j++) { System.out.println(filePL.elementAt(j)); if (GPs.indexOf(filePL.elementAt(j)) < 0) { System.out.println("Found one"); if (filePL.elementAt(j).equals("Energy")) { GPs.addElement(filePL.elementAt(j)); hasGraphableProperties = true; } } } if (hasGraphableProperties) { graphAction.setEnabled(true); dataFound = false; // data must be redisplayed. see findData() makeNewGraph(); // generate new (empty) JPanel. } else { graphAction.setEnabled(false); } } public void findData() { if (!dataFound) { if (hasGraphableProperties) { int nGraphs = GPs.size(); int nPoints = inputFile.getNumberOfFrames(); gl.setRows(nGraphs); double[][] data = new double[nGraphs][nPoints]; String[] titles = new String[nGraphs]; JASHist[] graphs = new JASHist[nGraphs]; for (int j = 0; j < nGraphs; j++) { String desc = (String) GPs.elementAt(j); titles[j] = new String(desc); graphs[j] = new JASHist(); for (int i = 0; i < nPoints; i++) { Vector fp = inputFile.getFrame(i).getFrameProperties(); Enumeration ef = fp.elements(); while (ef.hasMoreElements()) { PhysicalProperty pf = (PhysicalProperty) ef.nextElement(); if (pf.getDescriptor().equals(desc)) { data[j][i] = ((Double)pf.getProperty()).doubleValue(); } } } } for (int j = 0; j < nGraphs; j++) { graphs[j].addData(new ArrayDataSource(data[j], titles[j])).show(true); panel.add(graphs[j]); } dataFound = true; } } } /** * Shows or hides this component depending on the value of * parameter b. * * @param b If true, shows this component; otherwise, hides * this component. */ public void setVisible(boolean b) { if (b) { graphAction.setEnabled(false); disableConflictingActions(); } else { graphAction.setEnabled(true); restoreConflictingActions(); } super.setVisible(b); } /** * Returns the preferred size of the Graph dialog. * * @return the Dimension preferred by the dialog */ public Dimension getPreferredSize() { return new Dimension(500, 500); } public void actionPerformed(ActionEvent evt) { } /** * Centers the dialog on the screen. */ protected void centerDialog() { Dimension screenSize = this.getToolkit().getScreenSize(); Dimension size = this.getSize(); screenSize.height = screenSize.height / 2; screenSize.width = screenSize.width / 2; size.height = size.height / 2; size.width = size.width / 2; int y = screenSize.height - size.height; int x = screenSize.width - size.width; this.setLocation(x, y); } /** * The action used to activate this dialog. */ class GraphAction extends AbstractAction { /** * Create the action. */ public GraphAction() { super("graph"); this.setEnabled(false); } /** * Shows the Property Graph dialog when an action occurs. */ public void actionPerformed(ActionEvent e) { findData(); setVisible(true); } } /** * Returns the actions available from the Property Graph dialog. * * @return the actions for the PropertyGraph dialog */ public Action[] getActions() { return new Action[] { graphAction }; } /** * Gets the Vibrate action identified by the string given. * * @param cmd key for the desired action * @return the action associated with cmd, or null if not found */ public Action getAction(String cmd) { if (cmd.equals(graphAction.getValue(Action.NAME))) { return graphAction; } return null; } /** * Add a action to be disabled when this dialog is shown. * * @param a1 a conflicting action */ public void addConflictingAction(Action a1) { conflictingActions.addElement(a1); } /** * Disables conflicting actions. Saves action enabled * states for restoration. */ private void disableConflictingActions() { actionStates = new Vector(); Enumeration iter = conflictingActions.elements(); while (iter.hasMoreElements()) { Action a1 = (Action) iter.nextElement(); actionStates.addElement(new Boolean(a1.isEnabled())); a1.setEnabled(false); } } /** * Restores conflicting actions to saved state. */ private void restoreConflictingActions() { if (actionStates != null) { Enumeration iter = conflictingActions.elements(); Enumeration stateIter = actionStates.elements(); while (iter.hasMoreElements() && stateIter.hasMoreElements()) { Action a1 = (Action) iter.nextElement(); boolean state = ((Boolean) stateIter.nextElement()).booleanValue(); a1.setEnabled(state); } actionStates = null; } } /** * Listener for responding to dialog window events. */ class GraphWindowListener extends WindowAdapter { /** * Closes the dialog when window closing event occurs. */ public void windowClosing(WindowEvent e) { setVisible(false); } } private JPanel panel; private GridLayout gl; /** * Does the dialog have any vibration data. */ private boolean hasGraphableProperties; /** * Have the properties been added to the JPanel yet? */ private boolean dataFound; /* * The Vector containing the list of Graphable Properties. */ private Vector GPs = new Vector(); /** * The ChemFile containing frames with graphable data. */ private ChemFile inputFile; /** * The action used to activate this dialog. */ private GraphAction graphAction = new GraphAction(); /** * List of actions which will interfere with the operation of this * dialog. */ private Vector conflictingActions = new Vector(); /** * Enabled states of conficting actions which are disabled * during the operation of this dialog. Used to restore states * when the dialog is closed. */ private Vector actionStates = null; public void propertyChange(PropertyChangeEvent event) { if (event.getPropertyName().equals(DisplayControl.PROP_CHEM_FILE)) { setChemFile((ChemFile) event.getNewValue()); } } class ArrayDataSource implements ScatterPlotSource { ArrayDataSource(double[] xData, double[] yData, String title) { this.xData = xData; this.yData = yData; this.title = title; init(); } ArrayDataSource(double[] yData, String title) { xData = new double[yData.length]; for (int i = 0; i < yData.length; i++) { xData[i] = (new Double(i)).doubleValue(); } this.yData = yData; this.title = title; init(); } private void init() { xAxisType = DOUBLE; yAxisType = DOUBLE; xmin = xData[0]; xmax = xmin; ymin = yData[0]; ymax = ymin; for (int i = 1; i < xData.length; i++) { if (xData[i] < xmin) { xmin = xData[i]; } if (xData[i] > xmax) { xmax = xData[i]; } if (yData[i] < ymin) { ymin = yData[i]; } if (yData[i] > ymax) { ymax = yData[i]; } } } public double getXMin() { return xmin; } public double getXMax() { return xmax; } public double getYMin() { return ymin; } public double getYMax() { return ymax; } public int getXAxisType() { return xAxisType; } public int getYAxisType() { return yAxisType; } public java.lang.String getTitle() { if (title != null) { return title; } return null; } public ScatterEnumeration startEnumeration(double xMin, double xMax, double yMin, double yMax) { return new FixedEnumeration(xData, yData, xMin, xMax, yMin, yMax); } public ScatterEnumeration startEnumeration() { return new FixedEnumeration(xData, yData); } private double xmin; private double xmax; private double ymin; private double ymax; private int xAxisType; private int yAxisType; private String title; private double[] xData; private double[] yData; private class FixedEnumeration implements ScatterEnumeration { public FixedEnumeration(double[] xdata, double[] ydata) { this.xdata = xdata; this.ydata = ydata; selectAll = true; } public FixedEnumeration(double[] xdata, double[] ydata, double xMin, double xMax, double yMin, double yMax) { this.xdata = xdata; this.ydata = ydata; selectAll = false; m_xmin = xMin; m_xmax = xMax; m_ymin = yMin; m_ymax = yMax; } public boolean getNextPoint(double[] a) { if (selectAll) { if (pos < (xdata.length - 1)) { a[0] = xdata[pos]; a[1] = ydata[pos++]; return true; } else { return false; } } else { while (!((xdata[pos] >= m_xmin) && (xdata[pos] <= m_xmax) && (ydata[pos] >= m_ymin) && (ydata[pos] <= m_ymax))) { //skip points that don't satisfy the conditions pos++; if (pos > (xdata.length - 1)) { // if no more points left (don't want to overstep // bounds) return false; } } // okay, if we're here the point satisfies the min // and max conditions a[0] = xdata[pos]; a[1] = ydata[pos++]; return true; } } public void resetEndPoint() { //what does this do? //(it seems like Gauss2D.java doesn't know what to do here either) } public void restart() { pos = 0; } private int pos = 0; private double[] xdata; private double[] ydata; private boolean selectAll; private double m_xmin; private double m_xmax; private double m_ymin; private double m_ymax; } } } --- NEW FILE: SelectSharcReference.java --- /* * Copyright 2002 The Jmol Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package org.openscience.jmol.app; /** * */ public class SelectSharcReference extends javax.swing.JDialog implements java.awt.event.ActionListener { private javax.swing.JPanel buttonPanel; private javax.swing.JButton okButton; private javax.swing.JButton cancelButton; private javax.swing.JScrollPane listScrollPane; private javax.swing.JList list; private javax.swing.JLabel messageLabel; /** * Creates new form SelectSharcReference */ public SelectSharcReference(java.awt.Frame parent, Object[] values, boolean modal) { super(parent, modal); initComponents(values); pack(); setVisible(false); } /** * This method is called from within the constructor to * initialize the form. */ private void initComponents(Object[] values) { buttonPanel = new javax.swing.JPanel(); okButton = new javax.swing.JButton(); okButton.addActionListener(this); cancelButton = new javax.swing.JButton(); cancelButton.addActionListener(this); listScrollPane = new javax.swing.JScrollPane(); list = new javax.swing.JList(values); list.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); messageLabel = new javax.swing.JLabel(); setTitle("Select SHARC reference."); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { closeDialog(); } }); okButton.setText("jButton2"); okButton.setText("OK"); buttonPanel.add(okButton); cancelButton.setText("jButton3"); cancelButton.setText("Cancel"); buttonPanel.add(cancelButton); getContentPane().add(buttonPanel, java.awt.BorderLayout.SOUTH); listScrollPane.setViewportView(list); getContentPane().add(listScrollPane, java.awt.BorderLayout.CENTER); messageLabel.setText("Please select the NMR reference level of theory."); getContentPane().add(messageLabel, java.awt.BorderLayout.NORTH); } public Object getValue() { return list.getSelectedValue(); } /** * Closes the dialog */ private void closeDialog() { setVisible(false); dispose(); } /** * @param args the command line arguments */ public static void main(String args[]) { new SelectSharcReference(new javax.swing.JFrame(), new String[] { "a", "RHF/6-31G*", "foo" }, true).show(); } public void actionPerformed(java.awt.event.ActionEvent ev) { if (cancelButton == ev.getSource()) { list.clearSelection(); } closeDialog(); } } --- NEW FILE: Splash.java --- /* * Copyright 2002 The Jmol Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package org.openscience.jmol.app; import javax.swing.Timer; import javax.swing.ImageIcon; import java.awt.Color; import java.awt.Component; import java.awt.Toolkit; import java.awt.Dimension; import java.awt.Image; import java.awt.Frame; import java.awt.Window; import java.awt.Graphics; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; public class Splash extends Window { private Image splashImage; private int imgWidth, imgHeight; private static final int BORDERSIZE = 10; private static final Color BORDERCOLOR = Color.blue; private String status = "Loading..."; private int textY; private int statusTop; p... [truncated message content] |
From: Michael T H. <mic...@us...> - 2003-02-04 23:20:18
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol In directory sc8-pr-cvs1:/tmp/cvs-serv7888a/src/org/openscience/jmol Modified Files: AtomType.java Removed Files: AtomPropsMenu.java BandPlot.java BandPlotEPSRenderer.java BandPlotG2DRenderer.java BandPlotPanel.java BandPlotRenderer.java ConsoleTextArea.java ImageTyper.java JmolFileFilter.java PropertyGraph.java SelectSharcReference.java Splash.java Log Message: moved more app files Index: AtomType.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/AtomType.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -r1.20 -r1.21 *** AtomType.java 2 Dec 2002 15:41:58 -0000 1.20 --- AtomType.java 4 Feb 2003 23:20:12 -0000 1.21 *************** *** 34,39 **** import java.awt.Component; - //import javax.swing.*; - public class AtomType { --- 34,37 ---- --- AtomPropsMenu.java DELETED --- --- BandPlot.java DELETED --- --- BandPlotEPSRenderer.java DELETED --- --- BandPlotG2DRenderer.java DELETED --- --- BandPlotPanel.java DELETED --- --- BandPlotRenderer.java DELETED --- --- ConsoleTextArea.java DELETED --- --- ImageTyper.java DELETED --- --- JmolFileFilter.java DELETED --- --- PropertyGraph.java DELETED --- --- SelectSharcReference.java DELETED --- --- Splash.java DELETED --- |
From: Michael T H. <mic...@us...> - 2003-02-04 22:50:15
|
Update of /cvsroot/jmol/Jmol In directory sc8-pr-cvs1:/tmp/cvs-serv26987 Modified Files: applet.classes jmol Log Message: added app to class path Index: applet.classes =================================================================== RCS file: /cvsroot/jmol/Jmol/applet.classes,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** applet.classes 2 Feb 2003 15:42:44 -0000 1.19 --- applet.classes 4 Feb 2003 22:50:10 -0000 1.20 *************** *** 37,42 **** org/openscience/jmol/AtomicSymbol.java org/openscience/jmol/Measurement.java ! org/openscience/jmol/MeasurementList.java ! org/openscience/jmol/MeasurementListEvent.java org/openscience/jmol/UseJavaSort.java org/openscience/jmol/JmolAtomIterator.java --- 37,42 ---- org/openscience/jmol/AtomicSymbol.java org/openscience/jmol/Measurement.java ! org/openscience/jmol/app/MeasurementList.java ! org/openscience/jmol/app/MeasurementListEvent.java org/openscience/jmol/UseJavaSort.java org/openscience/jmol/JmolAtomIterator.java Index: jmol =================================================================== RCS file: /cvsroot/jmol/Jmol/jmol,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** jmol 22 May 2001 03:37:37 -0000 1.16 --- jmol 4 Feb 2003 22:50:10 -0000 1.17 *************** *** 37,39 **** fi ! exec $command -Djmol.home="$JMOL_HOME" -cp $libDir/jmol.jar org.openscience.jmol.Jmol "$@" --- 37,39 ---- fi ! exec $command -Djmol.home="$JMOL_HOME" -cp $libDir/jmol.jar org.openscience.jmol.app.Jmol "$@" |
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol In directory sc8-pr-cvs1:/tmp/cvs-serv7851 Modified Files: DisplayControl.java ModelManager.java MouseManager.java PhysicalProperty.java Removed Files: AboutDialog.java Animate.java AtomTypeTable.java AtomTypesModel.java CalculateChemicalShifts.java CrystalPropertiesDialog.java DecimalNumberField.java DisplayPanel.java FileTyper.java GuiMap.java HelpDialog.java HistoryFile.java Jmol.java JmolException.java JmolResourceHandler.java ListNode.java ListeningTableModel.java MakeCrystal.java Measure.java MeasurementList.java MeasurementListEvent.java MeasurementListListener.java MultiLineHeaderRenderer.java NMRShielding.java PovrayDialog.java PreferenceChangeEvent.java PreferenceChangeListener.java Preferences.java PreferencesDialog.java RecentFilesDialog.java SortedTableModel.java StatusBar.java TransformDialog.java Vibrate.java WhatsNewDialog.java WholeNumberField.java Log Message: moved application-specific classes to app subdirectory Index: DisplayControl.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/DisplayControl.java,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -r1.87 -r1.88 *** DisplayControl.java 4 Feb 2003 19:19:20 -0000 1.87 --- DisplayControl.java 4 Feb 2003 22:05:11 -0000 1.88 *************** *** 25,28 **** --- 25,31 ---- package org.openscience.jmol; + import org.openscience.jmol.app.Measure; + import org.openscience.jmol.app.MeasurementListEvent; + import org.openscience.jmol.render.AtomRenderer; import org.openscience.jmol.render.BondRenderer; Index: ModelManager.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/ModelManager.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** ModelManager.java 29 Jan 2003 18:48:54 -0000 1.13 --- ModelManager.java 4 Feb 2003 22:05:24 -0000 1.14 *************** *** 26,29 **** --- 26,31 ---- import org.openscience.jmol.Atom; + import org.openscience.jmol.app.MeasurementList; + import org.openscience.jmol.app.MeasurementListEvent; import java.util.BitSet; Index: MouseManager.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/MouseManager.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** MouseManager.java 26 Jan 2003 21:39:37 -0000 1.10 --- MouseManager.java 4 Feb 2003 22:05:24 -0000 1.11 *************** *** 20,23 **** --- 20,24 ---- package org.openscience.jmol; + import org.openscience.jmol.app.Measure; import org.openscience.jmol.Atom; import org.openscience.jmol.DisplayControl; Index: PhysicalProperty.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/PhysicalProperty.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** PhysicalProperty.java 8 Nov 2002 15:12:09 -0000 1.5 --- PhysicalProperty.java 4 Feb 2003 22:05:27 -0000 1.6 *************** *** 29,34 **** public class PhysicalProperty { ! String descriptor; ! Object property; public PhysicalProperty(String descriptor, Object property) { --- 29,34 ---- public class PhysicalProperty { ! public String descriptor; ! public Object property; public PhysicalProperty(String descriptor, Object property) { --- AboutDialog.java DELETED --- --- Animate.java DELETED --- --- AtomTypeTable.java DELETED --- --- AtomTypesModel.java DELETED --- --- CalculateChemicalShifts.java DELETED --- --- CrystalPropertiesDialog.java DELETED --- --- DecimalNumberField.java DELETED --- --- DisplayPanel.java DELETED --- --- FileTyper.java DELETED --- --- GuiMap.java DELETED --- --- HelpDialog.java DELETED --- --- HistoryFile.java DELETED --- --- Jmol.java DELETED --- --- JmolException.java DELETED --- --- JmolResourceHandler.java DELETED --- --- ListNode.java DELETED --- --- ListeningTableModel.java DELETED --- --- MakeCrystal.java DELETED --- --- Measure.java DELETED --- --- MeasurementList.java DELETED --- --- MeasurementListEvent.java DELETED --- --- MeasurementListListener.java DELETED --- --- MultiLineHeaderRenderer.java DELETED --- --- NMRShielding.java DELETED --- --- PovrayDialog.java DELETED --- --- PreferenceChangeEvent.java DELETED --- --- PreferenceChangeListener.java DELETED --- --- Preferences.java DELETED --- --- PreferencesDialog.java DELETED --- --- RecentFilesDialog.java DELETED --- --- SortedTableModel.java DELETED --- --- StatusBar.java DELETED --- --- TransformDialog.java DELETED --- --- Vibrate.java DELETED --- --- WhatsNewDialog.java DELETED --- --- WholeNumberField.java DELETED --- |
From: Michael T H. <mic...@us...> - 2003-02-04 22:05:53
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/script In directory sc8-pr-cvs1:/tmp/cvs-serv7851/script Modified Files: ScriptException.java Log Message: moved application-specific classes to app subdirectory Index: ScriptException.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/script/ScriptException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ScriptException.java 6 Jan 2003 23:34:54 -0000 1.2 --- ScriptException.java 4 Feb 2003 22:05:50 -0000 1.3 *************** *** 19,25 **** package org.openscience.jmol.script; ! import org.openscience.jmol.JmolException; ! ! public class ScriptException extends JmolException { String message; --- 19,23 ---- package org.openscience.jmol.script; ! public class ScriptException extends Exception { String message; *************** *** 30,34 **** public ScriptException(String message, String line, String filename, int linenumber) { - super("ScriptException:", message); this.message = message; this.line = line; --- 28,31 ---- |
From: Michael T H. <mic...@us...> - 2003-02-04 22:05:53
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/io In directory sc8-pr-cvs1:/tmp/cvs-serv7851/io Modified Files: Gaussian94Reader.java Gaussian98Reader.java Log Message: moved application-specific classes to app subdirectory Index: Gaussian94Reader.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/io/Gaussian94Reader.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** Gaussian94Reader.java 7 Jan 2003 20:56:49 -0000 1.3 --- Gaussian94Reader.java 4 Feb 2003 22:05:48 -0000 1.4 *************** *** 22,26 **** import org.openscience.jmol.ChemFile; import org.openscience.jmol.ChemFrame; ! import org.openscience.jmol.NMRShielding; import org.openscience.jmol.Vibration; import java.util.Vector; --- 22,26 ---- import org.openscience.jmol.ChemFile; import org.openscience.jmol.ChemFrame; ! import org.openscience.jmol.app.NMRShielding; import org.openscience.jmol.Vibration; import java.util.Vector; Index: Gaussian98Reader.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/io/Gaussian98Reader.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** Gaussian98Reader.java 7 Jan 2003 20:56:53 -0000 1.3 --- Gaussian98Reader.java 4 Feb 2003 22:05:49 -0000 1.4 *************** *** 22,26 **** import org.openscience.jmol.ChemFile; import org.openscience.jmol.ChemFrame; ! import org.openscience.jmol.NMRShielding; import org.openscience.jmol.Vibration; import java.io.IOException; --- 22,26 ---- import org.openscience.jmol.ChemFile; import org.openscience.jmol.ChemFrame; ! import org.openscience.jmol.app.NMRShielding; import org.openscience.jmol.Vibration; import java.io.IOException; |
From: Michael T H. <mic...@us...> - 2003-02-04 21:56:07
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/app In directory sc8-pr-cvs1:/tmp/cvs-serv4292/app Log Message: Directory /cvsroot/jmol/Jmol/src/org/openscience/jmol/app added to the repository |