From: <ha...@us...> - 2010-05-25 04:27:53
|
Revision: 13206 http://jmol.svn.sourceforge.net/jmol/?rev=13206&view=rev Author: hansonr Date: 2010-05-25 04:27:46 +0000 (Tue, 25 May 2010) Log Message: ----------- version=12.0.RC15_dev # new feature: set picking assignAtom_+/- changed to assignAtom_Plus/Minus # new feature: set picking assignBond_+/- changed to assignBond_Plus/Minus # new feature: set modelkitMode # -- establishes three context menus -- atom, bond, and modelkit # -- allows extensive and easy modification of structures # TRIAL CHANGE: JmolApplet.jar and JmolAppletSigned.jar do not contain translations # for translations, use JmolApplet0.jar and JmolAppletSigned0.jar # this saves almost 30% in file size. Otherwise all the translations for # all languages are included in every download to every browser. # Point being that one should not use JmolApplet.jar or JmolAppletSigned.jar # in "production" mode -- they are just too big! # bug fix: after deleting atoms, connections can be found to deleted atoms Modified Paths: -------------- trunk/Jmol/src/org/jmol/modelset/BondCollection.java trunk/Jmol/src/org/jmol/modelset/Model.java trunk/Jmol/src/org/jmol/modelset/ModelCollection.java trunk/Jmol/src/org/jmol/popup/MainPopupResourceBundle.java trunk/Jmol/src/org/jmol/popup/SimplePopup.java trunk/Jmol/src/org/jmol/viewer/ActionManager.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties trunk/Jmol/src/org/jmol/viewer/Viewer.java Modified: trunk/Jmol/src/org/jmol/modelset/BondCollection.java =================================================================== --- trunk/Jmol/src/org/jmol/modelset/BondCollection.java 2010-05-25 03:47:10 UTC (rev 13205) +++ trunk/Jmol/src/org/jmol/modelset/BondCollection.java 2010-05-25 04:27:46 UTC (rev 13206) @@ -400,9 +400,11 @@ } public void deleteBonds(BitSet bsBond, boolean isFullModel) { + int iDst = bsBond.nextSetBit(0); + if (iDst < 0) + return; molecules = null; moleculeCount = 0; - int iDst = bsBond.nextSetBit(0); int modelIndexLast = -1; int n = bsBond.cardinality(); for (int iSrc = iDst; iSrc < bondCount; ++iSrc) { @@ -793,10 +795,10 @@ case '2': case '3': break; - case '+': - case '-': + case 'p': + case 'm': bondOrder = JmolConstants.getBondOrderNumberFromOrder(bond.getCovalentOrder()).charAt(0) - - '0' + (type == '+' ? 1 : -1); + - '0' + (type == 'p' ? 1 : -1); if (bondOrder > 3) bondOrder = 1; else if (bondOrder < 0) Modified: trunk/Jmol/src/org/jmol/modelset/Model.java =================================================================== --- trunk/Jmol/src/org/jmol/modelset/Model.java 2010-05-25 03:47:10 UTC (rev 13205) +++ trunk/Jmol/src/org/jmol/modelset/Model.java 2010-05-25 04:27:46 UTC (rev 13206) @@ -97,6 +97,10 @@ int hydrogenCount; boolean isPDB; + public boolean isPDB() { + return isPDB; + } + boolean isTrajectory; int trajectoryBaseIndex; int selectedTrajectory = -1; Modified: trunk/Jmol/src/org/jmol/modelset/ModelCollection.java =================================================================== --- trunk/Jmol/src/org/jmol/modelset/ModelCollection.java 2010-05-25 03:47:10 UTC (rev 13205) +++ trunk/Jmol/src/org/jmol/modelset/ModelCollection.java 2010-05-25 04:27:46 UTC (rev 13206) @@ -3627,9 +3627,9 @@ RadiusData rd = new RadiusData(); setElement(atom, atomicNumber, rd); setAtomName(atomIndex, type + atom.getAtomNumber()); - } else if (type.equals("+")) { + } else if (type.equals("Pl")) { atom.setFormalCharge(atom.getFormalCharge() + 1); - } else if (type.equals("-")) { + } else if (type.equals("Mi")) { atom.setFormalCharge(atom.getFormalCharge() - 1); } else if (type.equals("X")) { isDelete = true; Modified: trunk/Jmol/src/org/jmol/popup/MainPopupResourceBundle.java =================================================================== --- trunk/Jmol/src/org/jmol/popup/MainPopupResourceBundle.java 2010-05-25 03:47:10 UTC (rev 13205) +++ trunk/Jmol/src/org/jmol/popup/MainPopupResourceBundle.java 2010-05-25 04:27:46 UTC (rev 13206) @@ -180,7 +180,7 @@ + "pickMolecule pickElement PDBpickChain PDBpickGroup SYMMETRYpickSite pickSpin" }, { "computationMenu", - "minimize" + "minimize modelkit!PDB!FRAMES" /* calculateVolume*/ }, @@ -484,6 +484,7 @@ { "extractMOL", "console on;getproperty extractModel \"visible\" " }, { "minimize", "minimize" }, + { "modelkit!PDB!FRAMES", "set modelkitmode" }, // { "calculateVolume", "console on;print \"Volume = \" + {*}.volume() + \" Ang^3\"" }, { "surfDots", "dots on" }, @@ -873,6 +874,7 @@ "computationMenu", GT._("Computation"), "minimize", GT._("Optimize structure"), + "modelkit!PDB!FRAMES", GT._("Model kit"), //"calculateVolume", GT._("Molecular volume"), "UNITCELLshow", GT._("Unit cell"), Modified: trunk/Jmol/src/org/jmol/popup/SimplePopup.java =================================================================== --- trunk/Jmol/src/org/jmol/popup/SimplePopup.java 2010-05-25 03:47:10 UTC (rev 13205) +++ trunk/Jmol/src/org/jmol/popup/SimplePopup.java 2010-05-25 04:27:46 UTC (rev 13206) @@ -67,8 +67,10 @@ protected JPopupMenu frankPopup; protected Hashtable htMenus = new Hashtable(); + protected Vector NotPDB = new Vector(); protected Vector PDBOnly = new Vector(); protected Vector UnitcellOnly = new Vector(); + protected Vector SingleModelOnly = new Vector(); protected Vector FramesOnly = new Vector(); protected Vector VibrationOnly = new Vector(); protected Vector SymmetryOnly = new Vector(); @@ -183,12 +185,18 @@ } void updateFileTypeDependentMenus() { + for (int i = 0; i < NotPDB.size(); i++) + enableMenu(NotPDB.get(i), !isPDB); for (int i = 0; i < PDBOnly.size(); i++) enableMenu(PDBOnly.get(i), isPDB); for (int i = 0; i < UnitcellOnly.size(); i++) enableMenu(UnitcellOnly.get(i), isUnitCell); for (int i = 0; i < FramesOnly.size(); i++) enableMenu(FramesOnly.get(i), isMultiFrame); + for (int i = 0; i < SingleModelOnly.size(); i++) + enableMenu(SingleModelOnly.get(i), !isMultiFrame); + for (int i = 0; i < FramesOnly.size(); i++) + enableMenu(FramesOnly.get(i), isMultiFrame); for (int i = 0; i < VibrationOnly.size(); i++) enableMenu(VibrationOnly.get(i), isVibration); for (int i = 0; i < SymmetryOnly.size(); i++) @@ -258,9 +266,12 @@ if (item.indexOf("VARIABLE") >= 0) htMenus.put(item, newMenu); // menus or menu items: - if (item.indexOf("PDB") >= 0) { + if (item.indexOf("!PDB") >= 0) { + NotPDB.add(newMenu); + } else if (item.indexOf("PDB") >= 0) { PDBOnly.add(newMenu); - } else if (item.indexOf("URL") >= 0) { + } + if (item.indexOf("URL") >= 0) { AppletOnly.add(newMenu); } else if (item.indexOf("CHARGE") >= 0) { ChargesOnly.add(newMenu); @@ -268,9 +279,15 @@ TemperatureOnly.add(newMenu); } else if (item.indexOf("UNITCELL") >= 0) { UnitcellOnly.add(newMenu); + } + + if (item.indexOf("!FRAMES") >= 0) { + SingleModelOnly.add(newMenu); } else if (item.indexOf("FRAMES") >= 0) { FramesOnly.add(newMenu); - } else if (item.indexOf("VIBRATION") >= 0) { + } + + if (item.indexOf("VIBRATION") >= 0) { VibrationOnly.add(newMenu); } else if (item.indexOf("SYMMETRY") >= 0) { SymmetryOnly.add(newMenu); Modified: trunk/Jmol/src/org/jmol/viewer/ActionManager.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/ActionManager.java 2010-05-25 03:47:10 UTC (rev 13205) +++ trunk/Jmol/src/org/jmol/viewer/ActionManager.java 2010-05-25 04:27:46 UTC (rev 13206) @@ -1364,7 +1364,7 @@ private int pickingStyleMeasure = JmolConstants.PICKINGSTYLE_MEASURE_OFF; private int rootPickingStyle = JmolConstants.PICKINGSTYLE_SELECT_JMOL; private String pickAtomAssignType = "C"; - private char pickBondAssignType = '+'; + private char pickBondAssignType = 'p'; private int bondPickingMode; private boolean isPickAtomAssignCharge; @@ -1411,7 +1411,7 @@ switch (atomPickingMode) { case JmolConstants.PICKING_ASSIGN_ATOM: pickAtomAssignType = option; - isPickAtomAssignCharge = ("+-".indexOf(pickAtomAssignType) >= 0); + isPickAtomAssignCharge = (pickAtomAssignType.equals("Pl") || pickAtomAssignType.equals("Mi")); break; } } Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2010-05-25 03:47:10 UTC (rev 13205) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2010-05-25 04:27:46 UTC (rev 13206) @@ -3,6 +3,8 @@ version=12.0.RC15_dev +# new feature: set picking assignAtom_+/- changed to assignAtom_Plus/Minus +# new feature: set picking assignBond_+/- changed to assignBond_Plus/Minus # new feature: set modelkitMode # -- establishes three context menus -- atom, bond, and modelkit # -- allows extensive and easy modification of structures Modified: trunk/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Viewer.java 2010-05-25 03:47:10 UTC (rev 13205) +++ trunk/Jmol/src/org/jmol/viewer/Viewer.java 2010-05-25 04:27:46 UTC (rev 13206) @@ -2153,6 +2153,10 @@ } if (!isAppend) initializeModel(); + if (global.modelkitMode && + (modelSet.getModelCount() > 1 || modelSet.getModels()[0].isPDB())) + setBooleanProperty("modelkitmode", false); + } catch (Error er) { handleError(er, true); String errMsg = getShapeErrorState(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |