Author: neildhruva
Date: 2012-06-20 06:01:46 -0700 (Wed, 20 Jun 2012)
New Revision: 29637

Modified:
   
csplugins/trunk/soc/neildhruva/PrintTable/src/main/java/org/cytoscape/sample/internal/CytoChart.java
   
csplugins/trunk/soc/neildhruva/PrintTable/src/main/java/org/cytoscape/sample/internal/TableAddedEvent.java
   
csplugins/trunk/soc/neildhruva/PrintTable/src/main/java/org/cytoscape/sample/internal/TableDestroyedEvent.java
Log:
Implemented the clearing of the Table View panel when a network is destroyed. 
Also added some comments and documentation.

Modified: 
csplugins/trunk/soc/neildhruva/PrintTable/src/main/java/org/cytoscape/sample/internal/CytoChart.java
===================================================================
--- 
csplugins/trunk/soc/neildhruva/PrintTable/src/main/java/org/cytoscape/sample/internal/CytoChart.java
        2012-06-20 08:24:23 UTC (rev 29636)
+++ 
csplugins/trunk/soc/neildhruva/PrintTable/src/main/java/org/cytoscape/sample/internal/CytoChart.java
        2012-06-20 13:01:46 UTC (rev 29637)
@@ -17,6 +17,11 @@
                dataset = new DefaultCategoryDataset();                 
        }
        
+       /**
+        * Creates a chart/graph and puts it in a chart panel.
+        * 
+        * @return The <code>ChartPanel</code> that contains the newly created 
chart.
+        */
        public ChartPanel createChart(){
                dataset.setValue(6, "Profit", "Jane");
                dataset.setValue(7, "Profit", "Tom");

Modified: 
csplugins/trunk/soc/neildhruva/PrintTable/src/main/java/org/cytoscape/sample/internal/TableAddedEvent.java
===================================================================
--- 
csplugins/trunk/soc/neildhruva/PrintTable/src/main/java/org/cytoscape/sample/internal/TableAddedEvent.java
  2012-06-20 08:24:23 UTC (rev 29636)
+++ 
csplugins/trunk/soc/neildhruva/PrintTable/src/main/java/org/cytoscape/sample/internal/TableAddedEvent.java
  2012-06-20 13:01:46 UTC (rev 29637)
@@ -28,6 +28,9 @@
        
        @Override
        public void handleEvent(SetCurrentNetworkEvent e) {
+               //If this method was called immediately following a network 
destroyed event, which it by default does,
+               //then such a current network event should not be implemented 
because the pointer doesn't point to 
+               //a particular network at that time.
                if(!networkDestroyed){  
                        cytable = e.getNetwork().getDefaultNodeTable();
                        if(cytable!=null)

Modified: 
csplugins/trunk/soc/neildhruva/PrintTable/src/main/java/org/cytoscape/sample/internal/TableDestroyedEvent.java
===================================================================
--- 
csplugins/trunk/soc/neildhruva/PrintTable/src/main/java/org/cytoscape/sample/internal/TableDestroyedEvent.java
      2012-06-20 08:24:23 UTC (rev 29636)
+++ 
csplugins/trunk/soc/neildhruva/PrintTable/src/main/java/org/cytoscape/sample/internal/TableDestroyedEvent.java
      2012-06-20 13:01:46 UTC (rev 29637)
@@ -21,6 +21,12 @@
                panelComponentMap = TableAddedEvent.getPanelComponentMap();
                
panelComponentMap.remove(e.getNetwork().getDefaultNodeTable().getTitle());
                
+               //Clear the Table View Panel
+               myCytoPanel.removeAll();
+               myCytoPanel.repaint();
+               
+               //Set networkDestroyed to true in order to keep from 
implementing the code in TableAddedEvent.java
                TableAddedEvent.networkDestroyed = 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