From: Bob H. <ha...@st...> - 2007-04-26 18:31:33
|
Well, I did it. I just refactored Jmol completely. I'm eager to hear if I should commit this or not, and if so, how. Perhaps I should just create a new branch, because it's a LOT of major reorganizing. The last day and a half I have put all the excellent refactoring capabilities of Eclipse to the test. Take a look: http://www.stolaf.edu/academics/chemapps/jmol/docs/misc/jmol11_2_packages.txt Basically, what is left in org.jmol.viewer is just the following: | +---viewer | | ColorManager.java | | Compiler.java | | Eval.java | | FileManager.java | | FrameExportJmolAdapter.java | | FrameRenderer.java | | JmolConstants.java | | Measurement.java | | MouseManager.java | | MouseManager10.java | | MouseManager11.java | | MouseManager14.java | | MouseWrapper11.java | | MouseWrapper14.java | | PendingMeasurement.java | | PickingManager.java | | PropertyManager.java | | RepaintManager.java | | ScriptManager.java | | SelectionManager.java | | StateManager.java | | StatusManager.java | | Token.java | | TransformManager.java | | TransformManager10.java | | TransformManager11.java | | Viewer.java Notice no shapes and only one renderer. This seems to me to be really what the Viewer is all about -- not calculating shapes. org.jmol.viewer is a coordinator/manager class. So where did it all go? Four new packages: ---modelframe (atoms, bonds, dipoles, polymers, model, frame, mmset, etc.) ---shape (balls, sticks, stars, echo, etc.) ---shapebio (monomers, bioPolymers, mps, cartoons, etc.) ---shapespecial (draw, isosurface, pmesh, polyhedra, lcao, mo) I've taken care to only make public what needed to be public. In many cases I wrote new get methods. Now, I suppose Miguel is going to tell me that there was a distinct reason all 200+ files were in a single package (something about public/private/protected classes, I think.) But I suggest that this is an improvement. Is there a downside to what I have done? Was it a good idea or a misguided one to do this? My goal is to make JmolApplet5 optional: <jar destfile="${jmol.applet.build.dir}/JmolApplet5.jar" manifest="manifest/applet5.txt" > <fileset dir="${applet.classes.dir}"> <include name="org/openscience/jmol/**" /> <include name="org/jmol/smiles/**" /> <include name="org/jmol/quantum/**" /> <include name="org/jmol/jvxl/**" /> <include name="org/jmol/shapebio/**" /> <include name="org/jmol/shapespecial/**" /> </fileset> </jar> This jar file constitutes 183K -- about 20% of the full package. I think it's very easy from where I am now to isolate all functionality relating to those classes so that they don't have to be there. How should I proceed? Bob |