Author: scooter
Date: 2010-12-23 17:25:38 -0800 (Thu, 23 Dec 2010)
New Revision: 23267

Modified:
   csplugins/trunk/ucsf/scooter/structureViz/resources/plugin.props
   
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/actions/CyChimera.java
   
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/actions/OpenTask.java
   
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/model/Structure.java
   
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/ui/StructureVizMenuHandler.java
   
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/ui/StructureVizMenuListener.java
Log:
Updated version number and fixed some annoying bugs in preparation for
release.


Modified: csplugins/trunk/ucsf/scooter/structureViz/resources/plugin.props
===================================================================
--- csplugins/trunk/ucsf/scooter/structureViz/resources/plugin.props    
2010-12-23 10:08:57 UTC (rev 23266)
+++ csplugins/trunk/ucsf/scooter/structureViz/resources/plugin.props    
2010-12-24 01:25:38 UTC (rev 23267)
@@ -13,10 +13,10 @@
 pluginDescription=This plugin provides an interface to UCSF Chimera from 
within Cytoscape, providing a linkage between the network view and the 
structural view.
 
 # Plugin version number, this must be two numbers separated by a decimlal.  
Ex. 0.2, 14.03
-pluginVersion=1.4
+pluginVersion=1.9
 
 # Compatible Cytoscape version
-cytoscapeVersion=2.6.1,2.6.2
+cytoscapeVersion=2.8
 
 # Category, use one of the categories listed on the website or create your own
 pluginCategory=Analysis
@@ -24,11 +24,11 @@
 # -- The following properties are OPTIONAL -- #
 
 # URL to a website that gives more information about your plugin, Ex. 
http://my-lab-site.org
-projectURL=http://www.rbvi.ucsf.edu/Research/cytoscape/structureViz.html
+projectURL=http://www.rbvi.ucsf.edu/cytoscape/structureViz/index.html
 
 # List of authors.  Note each author and institution pair are separated by a : 
(colon)
 # each additional author institution pair must be separated from other pairs 
bye a ; (semicolon)
 pluginAuthorsIntsitutions=John "Scooter" Morris:UCSF
 
 # Date this plugin/plugin version was released
-releaseDate=November 7, 2008
+releaseDate=December 28, 2010

Modified: 
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/actions/CyChimera.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/actions/CyChimera.java
   2010-12-23 10:08:57 UTC (rev 23266)
+++ 
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/actions/CyChimera.java
   2010-12-24 01:25:38 UTC (rev 23267)
@@ -46,12 +46,14 @@
 // Cytoscape imports
 import cytoscape.*;
 import cytoscape.CytoscapeInit;
+import cytoscape.logger.CyLogger;
 import cytoscape.view.CytoscapeDesktop;
 import cytoscape.view.CyNetworkView;
 import cytoscape.data.CyAttributes;
 import cytoscape.util.CytoscapeAction;
 
 // structureViz imports
+import structureViz.StructureViz;
 import structureViz.actions.Chimera;
 import structureViz.model.Structure;
 import structureViz.model.Sequence;
@@ -70,10 +72,11 @@
        public static final String[] residueKeys = 
{"FunctionalResidues","ResidueList",null};
        public static final String[] sequenceKeys = {"sequence",null};
        private static CyAttributes cyAttributes;
+       private static CyLogger logger = null;
 
        static List selectedList = null;
 
-  public CyChimera() { 
+  static { 
                String structureAttribute = getProperty("structureAttribute");
                if (structureAttribute != null) {
                        structureKeys[structureKeys.length-1] = 
structureAttribute;
@@ -86,6 +89,7 @@
                if (residueAttribute != null) {
                        residueKeys[residueKeys.length-1] = residueAttribute;
                }
+               logger = CyLogger.getLogger(StructureViz.class);
        }
 
        /**
@@ -151,7 +155,6 @@
                                }
                        } else if (structure != null) {
                                Structure s = new Structure(structure,node, 
Structure.StructureType.PDB_MODEL);
-                               // System.out.println("Setting residue list for 
"+s);
                                s.setResidueList(residues);
         structureList.add(s);
                        }

Modified: 
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/actions/OpenTask.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/actions/OpenTask.java
    2010-12-23 10:08:57 UTC (rev 23266)
+++ 
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/actions/OpenTask.java
    2010-12-24 01:25:38 UTC (rev 23267)
@@ -62,8 +62,6 @@
                // Get the list of structures we already have open
                List<Structure>openStructs = chimera.getOpenStructs();
 
-               List<Structure>newList = new ArrayList();
-
     // Send initial commands
     for (Structure structure: structList) {
                        boolean open = false;
@@ -72,17 +70,13 @@
                                if (structureName.equals(openStructure.name())) 
{
                                        // Map the model numbers
                                        
structure.setModelNumber(openStructure.modelNumber());
-                                       newList.add(structure);
                                        open = true;
                                        break;
                                }
                        }
                        if (open == false) {
                                chimera.open(structure);
-                               newList.add(structure);
                        }
                }
-
-               userData = newList;
        }
 }

Modified: 
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/model/Structure.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/model/Structure.java 
    2010-12-23 10:08:57 UTC (rev 23266)
+++ 
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/model/Structure.java 
    2010-12-24 01:25:38 UTC (rev 23267)
@@ -166,7 +166,9 @@
                        String residue = "";
                        // Parse out the structure, if there is one
                        String[] components = list[i].split("#");
-                       if (components.length > 1 && 
structureName.equals(components[0])) {
+                       if (components.length > 1 && 
!structureName.equals(components[0])) {
+                               continue;
+                       } else if (components.length > 1) {
                                residue = components[1];
                        } else if (components.length == 1) {
                                residue = components[0];

Modified: 
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/ui/StructureVizMenuHandler.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/ui/StructureVizMenuHandler.java
  2010-12-23 10:08:57 UTC (rev 23266)
+++ 
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/ui/StructureVizMenuHandler.java
  2010-12-24 01:25:38 UTC (rev 23267)
@@ -73,7 +73,6 @@
 
        private static final long serialVersionUID = 1;
        private static Chimera chimera = null;
-       private static ModelNavigatorDialog mnDialog = null;
        private static AlignStructuresDialog alDialog = null;
        private int command;
        private static boolean showModelWarning = true;
@@ -93,7 +92,7 @@
    public void actionPerformed(ActionEvent ae) {
                String label = ae.getActionCommand();
                if (command == StructureViz.OPEN) {
-                       openAction(label);
+                       openAction(label, null, false);
                } else if (command == StructureViz.EXIT) {
                        exitAction();
                } else if (command == StructureViz.ALIGN) {
@@ -133,7 +132,7 @@
 
                // Bring up the dialog
                alDialog = 
-                                                       new 
AlignStructuresDialog(mnDialog, chimera, structures);
+                                                       new 
AlignStructuresDialog(chimera.getDialog(), chimera, structures);
                alDialog.pack();
                alDialog.setLocationRelativeTo(Cytoscape.getDesktop());
                alDialog.setVisible(true);
@@ -169,7 +168,7 @@
                                                                             
JOptionPane.DEFAULT_OPTION,
                                                                             
null, 
                                                                             
options);
-                                       JDialog jd = 
dialog.createDialog(mnDialog, "Modelled Structure Warning");
+                                       JDialog jd = 
dialog.createDialog(chimera.getDialog(), "Modelled Structure Warning");
                                        jd.pack();
                                        jd.setVisible(true);
                                }
@@ -180,7 +179,7 @@
                        ident = ident.substring(2);
                Structure struct = new Structure(ident, node, 
Structure.StructureType.MODBASE_MODEL);
                userData = struct;
-               openAction(ident);
+               openAction(ident, null, false);
        }
 
        public void itemStateChanged(ItemEvent e) {
@@ -198,15 +197,20 @@
         * structures.
         */
        private void selectResiduesAction() {
-               // Open all of the structures
-               openAction("all");
-               List<Structure>structuresList = (List<Structure>)userData;
+               List<Structure> structuresList = (List<Structure>)userData;
 
                String command = "select ";
                for (Structure structure: structuresList) {
                        // Select the residues
                        List<String> residueL = structure.getResidueList();
-                       if (residueL == null) return;
+                       if (residueL == null || residueL.size() == 0) continue;
+
+                       // OK, we have a residue list, make sure the structure 
is open
+                       int model = structure.modelNumber();
+                       if (chimera == null || chimera.getChimeraModel(model) 
== null) {
+                               openAction(structure.name(), structure, true);
+                       }
+
                        // The residue list is of the form RRRnnn,RRRnnn.  We 
want
                        // to reformat this to nnn,nnn
                        String residues = new String();
@@ -214,7 +218,7 @@
                                residues = residues.concat(residue+",");
                        }
                        residues = residues.substring(0,residues.length()-1);
-                       // System.out.println("structure: "+structure+" 
residues: "+residues);
+                       logger.debug("selectResiduesAction: structure: 
"+structure+" residues: "+residues);
 
                        command = command.concat(" 
#"+structure.modelNumber()+":"+residues);
                }
@@ -264,13 +268,13 @@
                                iter.remove();
                        }
                }
-               if (mnDialog != null) mnDialog.modelChanged();
+               if (chimera.getDialog() != null) 
chimera.getDialog().modelChanged();
        }
 
        /**
         * Open a pdb model in Chimera
         */
-       private void openAction(String commandLabel) {
+       private void openAction(String commandLabel, Object dataOverride, 
boolean wait) {
                // Make sure chimera is launched
                if (chimera == null || !chimera.isLaunched())
                        chimera = launchChimera();
@@ -278,16 +282,26 @@
                if (chimera == null) 
                        return;
 
-               if (openTask == null) {
-                       openTask = new OpenTask(commandLabel, chimera, 
userData);
+               if (dataOverride == null) {
+                       if (openTask == null) {
+                               logger.debug("Opening structure: 
"+commandLabel);
+                               openTask = new OpenTask(commandLabel, chimera, 
userData);
+                       }
+               } else {
+                       logger.debug("Opening structure: "+commandLabel);
+                       openTask = new OpenTask(commandLabel, chimera, 
dataOverride);
                }
 
-               if (chimera.getDialog() == null)
+               if (chimera.getDialog() == null) {
                        
ModelNavigatorDialog.LaunchModelNavigator(Cytoscape.getDesktop(), chimera);
+               }
 
                chimera.getDialog().setVisible(true);
 
-               new Thread(openTask).start();
+               if (!wait)
+                       new Thread(openTask).start();
+               else
+                       openTask.run();
 
        }
 

Modified: 
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/ui/StructureVizMenuListener.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/ui/StructureVizMenuListener.java
 2010-12-23 10:08:57 UTC (rev 23266)
+++ 
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/ui/StructureVizMenuListener.java
 2010-12-24 01:25:38 UTC (rev 23267)
@@ -124,6 +124,7 @@
                {
                        if (overNode != null) {
                                String residueList = 
CyChimera.getResidueList((CyNode)overNode.getNode());
+                               logger.debug("Found residueList: "+residueList);
                                if (residueList != null) {
                                        // Get the structures for this node
                                        List<Structure>structures =  
CyChimera.getSelectedStructures(overNode, 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