Author: scooter
Date: 2011-01-13 17:41:48 -0800 (Thu, 13 Jan 2011)
New Revision: 23452

Modified:
   csplugins/trunk/ucsf/scooter/structureViz/resources/plugin.props
   
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/actions/ListenerThreads.java
   
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/ui/ActionPopupMenu.java
   
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/ui/ModelNavigatorDialog.java
   
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/ui/StructureVizMenuHandler.java
Log:
1.9 release complete.


Modified: csplugins/trunk/ucsf/scooter/structureViz/resources/plugin.props
===================================================================
--- csplugins/trunk/ucsf/scooter/structureViz/resources/plugin.props    
2011-01-13 23:53:33 UTC (rev 23451)
+++ csplugins/trunk/ucsf/scooter/structureViz/resources/plugin.props    
2011-01-14 01:41:48 UTC (rev 23452)
@@ -31,4 +31,4 @@
 pluginAuthorsIntsitutions=John "Scooter" Morris:UCSF
 
 # Date this plugin/plugin version was released
-releaseDate=December 28, 2010
+releaseDate=January 15, 2011

Modified: 
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/actions/ListenerThreads.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/actions/ListenerThreads.java
     2011-01-13 23:53:33 UTC (rev 23451)
+++ 
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/actions/ListenerThreads.java
     2011-01-14 01:41:48 UTC (rev 23452)
@@ -154,7 +154,7 @@
 
                synchronized (replyLog) {
                        while ((line = lineReader.readLine()) != null) {
-                               // System.out.println("From Chimera (CMD) 
-->"+line);
+                               // System.out.println("From Chimera 
("+command+") -->"+line);
                                if (line.startsWith("CMD")) {
                                        logger.error("Got unexpected command 
from Chimera: "+line);
 
@@ -189,6 +189,7 @@
                        public ModelUpdater() {}
 
                        public void run() {
+                               // System.out.println("Model updated");
                                chimeraObject.refresh();
                                chimeraObject.modelChanged();
                                // Now update our selection from Chimera

Modified: 
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/ui/ActionPopupMenu.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/ui/ActionPopupMenu.java
  2011-01-13 23:53:33 UTC (rev 23451)
+++ 
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/ui/ActionPopupMenu.java
  2011-01-14 01:41:48 UTC (rev 23452)
@@ -126,9 +126,7 @@
                {
                        addItem(submenu, "All", "disp %sel",0);
                        addItem(submenu, "Backbone only", "~disp %sel; disp 
%sel & @n,ca,c",0);
-                       if (modelList.size() > 0 || chainList.size() > 0) {
-                               addItem(submenu, "Sequence", "sequence %sel",0);
-                       }
+                       addItem(submenu, "Sequence", "sequence %sel",0);
                }
                add(submenu);
                // Hide
@@ -219,12 +217,12 @@
                addItem(selectMenu, "Ligand", "select %sel & ligand", 
PopupActionListener.MODEL_SELECTION);
                addItem(selectMenu, "Ions", "select %sel & ions", 
PopupActionListener.MODEL_SELECTION);
                addItem(selectMenu, "Solvent", "select %sel & solvent", 
PopupActionListener.MODEL_SELECTION);
-               addItem(selectMenu, "Functional Residues", null, 
PopupActionListener.FUNCTIONAL_RESIDUES);
                JMenu secondaryMenu = new JMenu("Secondary Structure");
                addItem(secondaryMenu, "Helix", "select %sel & helix", 
PopupActionListener.MODEL_SELECTION);
                addItem(secondaryMenu, "Strand", "select %sel & strand", 
PopupActionListener.MODEL_SELECTION);
                addItem(secondaryMenu, "Coil", "select %sel & coil", 
PopupActionListener.MODEL_SELECTION);
                selectMenu.add(secondaryMenu);
+               addItem(selectMenu, "Functional Residues", null, 
PopupActionListener.FUNCTIONAL_RESIDUES);
                add(selectMenu);
                return; 
        }
@@ -307,8 +305,9 @@
                JMenu colorMenu = new JMenu(text);
                JMenuItem colorItem;
                if (addByElement) {
-                       addItem(colorMenu, "By element", "color byelement 
%sel",0);
-                       addItem(colorMenu, "By heteroatom", "color byhetero 
%sel",0);
+                       addItem(colorMenu, "By element", "color byelement 
%sel,a",0);
+                       // addItem(colorMenu, "By heteroatom", "color byhetero 
%sel",0);
+                       addItem(colorMenu, "By heteroatom", "~color %sel,a; 
color byhetero %sel,a",0);
                }
                for (int color=0; color < colorList.length; color++) {
                        colorItem = addItem(colorMenu, colorList[color], 
prefix+colorList[color]+suffix,0);
@@ -465,7 +464,7 @@
                                        
chimeraObject.chimeraSend(commandList[i]);
                        }
                        if (postCommand == CLEAR_SELECTION) {
-                               navTree.clearSelection();
+                               
navTree.removeSelectionPaths(navTree.getSelectionPaths());
                        } else if (postCommand == CLOSE) {
                                // Get the object
                                for (ChimeraStructuralObject obj: objectList) {

Modified: 
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/ui/ModelNavigatorDialog.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/ui/ModelNavigatorDialog.java
     2011-01-13 23:53:33 UTC (rev 23451)
+++ 
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/ui/ModelNavigatorDialog.java
     2011-01-14 01:41:48 UTC (rev 23452)
@@ -93,6 +93,8 @@
        private static final int FINDHBOND = 17;
        private static final int FUNCTIONALRESIDUES = 18;
        private static final int COLLAPSEALL = 19;
+       private static final int EXPANDMODELS = 20;
+       private static final int EXPANDCHAINS = 21;
        private boolean ignoreSelection = false;
        private int residueDisplay = ChimeraResidue.THREE_LETTER;
        private boolean isCollapsing = false;
@@ -308,16 +310,13 @@
         */
        public void updateSelection(List<ChimeraStructuralObject> 
selectionList) {
                // System.out.println("Model Navigator Panel: updateSelection 
("+selectionList+")");
-               TreePath path = null;
+               List<TreePath> pathList = new ArrayList<TreePath>();
                this.ignoreSelection = true;
-               // Need to clear currently selected objects
-               clearSelectionState();
-               navigationTree.clearSelection();
                for (ChimeraStructuralObject selectedObject: selectionList) {
-                       path = (TreePath)selectedObject.getUserData();
-                       navigationTree.addSelectionPath(path);
-                       navigationTree.makeVisible(path);
+                       pathList.add((TreePath)selectedObject.getUserData());
                }
+               // Need to clear currently selected objects
+               resetSelectionState(pathList);
                int row = navigationTree.getMaxSelectionRow();
                navigationTree.scrollRowToVisible(row);
                this.ignoreSelection = false;
@@ -329,7 +328,8 @@
         * iterating over all models and recursively decending
         * through the chains to the residues.
         */
-       private void clearSelectionState() {
+       private void resetSelectionState(List<TreePath> setPaths) {
+               
navigationTree.removeSelectionPaths(navigationTree.getSelectionPaths());
                List<ChimeraModel>models = chimeraObject.getChimeraModels();
                if (models == null) return;
                for (ChimeraModel m: models) {
@@ -341,10 +341,15 @@
                                Collection<ChimeraResidue>residues = 
c.getResidues();
                                if (residues == null ) continue;
                                for (ChimeraResidue r: residues) {
-                                       if (r != null) r.setSelected(false);
+                                       if (r != null) {
+                                               r.setSelected(false);
+                                       }
                                }
                        }
                }
+               // navigationTree.removeSelectionPaths(clearPaths.toArray(new 
TreePath[1]));
+               if (setPaths != null && setPaths.size() > 0)
+                       navigationTree.addSelectionPaths(setPaths.toArray(new 
TreePath[1]));
        }
 
        /**
@@ -436,13 +441,13 @@
 
                // View menu
                JMenu viewMenu = new JMenu("View");
-               // addMenuItem(viewMenu, "Collapse Model Tree", COLLAPSEALL, 
null);
-               // addMenuItem(viewMenu, "Expand Models", COLLAPSEALL, null);
-               // addMenuItem(viewMenu, "Expand Chains", COLLAPSEALL, null);
+               addMenuItem(viewMenu, "Collapse model tree", COLLAPSEALL, null);
+               addMenuItem(viewMenu, "Expand all models", EXPANDMODELS, null);
+               addMenuItem(viewMenu, "Expand all chains", EXPANDCHAINS, null);
 
                addMenuItem(viewMenu, "Refresh model tree", REFRESH, null);
 
-               JMenu viewResidues = new JMenu("Residues as..");
+               JMenu viewResidues = new JMenu("Show residues as..");
                addMenuItem(viewResidues, "single letter", 
                                                                
ChimeraResidue.SINGLE_LETTER, null);
                addMenuItem(viewResidues, "three letters", 
@@ -540,6 +545,37 @@
                return true;
        }
 
+       private void collapseAll() {
+               int row = navigationTree.getRowCount() - 1;
+               while (row >= 1) {
+                       navigationTree.collapseRow(row);
+                       row--;
+               }
+               return;
+       }
+
+       private void expandModels() {
+               expandTree(2);
+               return;
+       }
+
+       private void expandChains() {
+               expandTree(3);
+               return;
+       }
+
+       private void expandTree(int depth) {
+               int row = navigationTree.getRowCount() - 1;
+               while (row >= 1) {
+                       TreePath path = navigationTree.getPathForRow(row);
+                       Object[] objArray = path.getPath();
+                       if (objArray.length == depth)
+                               navigationTree.expandRow(row);
+                       row--;
+               }
+               return;
+       }
+
        // Embedded classes
 
        /**
@@ -576,14 +612,12 @@
                                chimeraObject.select(command);
                        } else if (type == CLEAR) {
                                chimeraObject.select("~select");
-                               navigationTree.clearSelection();
-                               clearSelectionState();
+                               
navigationTree.removeSelectionPaths(navigationTree.getSelectionPaths());
                        } else if (type == EXIT) {
                                chimeraObject.exit();
                                setVisible(false);
                                if (chimeraObject.getAlignDialog() != null)
                                        
chimeraObject.getAlignDialog().setVisible(false);
-                               return;
                        } else if (type == FUNCTIONALRESIDUES) {
                                String command = null;
                                // For all open structures, select the 
functional residues
@@ -596,6 +630,8 @@
                                        for (String residue: residueL) {
                                                residues = 
residues.concat(residue+",");
                                        }
+                                       if (residues.length() == 0)
+                                               return;
                                        residues = 
residues.substring(0,residues.length()-1);
                                        if (command == null)
                                                command = "select 
#"+structure.modelNumber()+":"+residues;
@@ -607,17 +643,18 @@
                        } else if (type == REFRESH) {
                                chimeraObject.refresh();
                        } else if (type == COLLAPSEALL) {
-                               // TODO: for some reason, this doesn't work!
-                               int row = navigationTree.getRowCount() - 1;
-                               while (row >= 1) {
-                                       navigationTree.collapseRow(row);
-                                       row--;
-                               }
-                               navigationTree.treeDidChange();
+                               collapseAll();
+                       } else if (type == EXPANDMODELS) {
+                               expandModels();
+                       } else if (type == EXPANDCHAINS) {
+                               expandModels();
+                               expandChains();
                        } else if (type == ALIGNBYMODEL) {
                                launchAlignDialog(false);
+                               chimeraObject.modelChanged();
                        } else if (type == ALIGNBYCHAIN) {
                                launchAlignDialog(true);
+                               chimeraObject.modelChanged();
                        } else if (type == FINDCLASH) {
                                if (selectedObjects.size() > 0) {
                                        chimeraObject.select(command);
@@ -635,8 +672,8 @@
                        } else {
                                residueDisplay = type;
                                treeModel.setResidueDisplay(type);
+                               chimeraObject.modelChanged();
                        }
-                       modelChanged();
                }
 
                /**

Modified: 
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/ui/StructureVizMenuHandler.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/ui/StructureVizMenuHandler.java
  2011-01-13 23:53:33 UTC (rev 23451)
+++ 
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/ui/StructureVizMenuHandler.java
  2011-01-14 01:41:48 UTC (rev 23452)
@@ -148,8 +148,8 @@
        }
 
        /**
-        * Search modbase for modelled structures that correspond to this 
identifier.
-        * Since modelled structures can be somewhat misleading, popup a 
warning dialog
+        * Search modbase for modeled structures that correspond to this 
identifier.
+        * Since modeled structures can be somewhat misleading, popup a warning 
dialog
         * while we do the fetch.
         */
        private void findModelsAction() {
@@ -160,7 +160,7 @@
                if (showModelWarning) {
                        SwingUtilities.invokeLater(new Runnable() {
                                public void run() {
-                                       String message = "<html><b>Warning</b>: 
Modelled structures are predictions, not experimental data.<br>";
+                                       String message = "<html><b>Warning</b>: 
Modeled structures are predictions, not experimental data.<br>";
                                        message += "These structures are from 
the ModBase web service at <a 
href=\"http://modbase.salilab.org\";>http://modbase.salilab.org/</a><br>";
                                        message += "Measures of model 
reliability, or likelihood of correctness, are provided in the<br>";
                                        message += "Chimera ModBase Model 
List.</html>";
@@ -176,7 +176,7 @@
                                                                             
JOptionPane.DEFAULT_OPTION,
                                                                             
null, 
                                                                             
options);
-                                       JDialog jd = 
dialog.createDialog(chimera.getDialog(), "Modelled Structure Warning");
+                                       JDialog jd = 
dialog.createDialog(chimera.getDialog(), "Modeled Structure Warning");
                                        jd.pack();
                                        jd.setVisible(true);
                                }

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to