Author: mes
Date: 2012-08-08 14:43:37 -0700 (Wed, 08 Aug 2012)
New Revision: 30134

Modified:
   
csplugins/trunk/ucsd/mes/cy3-shared-local-tables/impl/model-impl/impl/src/main/java/org/cytoscape/model/internal/AbstractTableFacade.java
   
csplugins/trunk/ucsd/mes/cy3-shared-local-tables/impl/model-impl/impl/src/main/java/org/cytoscape/model/internal/LocalTableFacade.java
   
csplugins/trunk/ucsd/mes/cy3-shared-local-tables/impl/model-impl/impl/src/main/java/org/cytoscape/model/internal/LocalTableFacade.java.with_abstract
   
csplugins/trunk/ucsd/mes/cy3-shared-local-tables/impl/model-impl/impl/src/main/java/org/cytoscape/model/internal/SharedTableFacade.java
Log:
updates to table facades

Modified: 
csplugins/trunk/ucsd/mes/cy3-shared-local-tables/impl/model-impl/impl/src/main/java/org/cytoscape/model/internal/AbstractTableFacade.java
===================================================================
--- 
csplugins/trunk/ucsd/mes/cy3-shared-local-tables/impl/model-impl/impl/src/main/java/org/cytoscape/model/internal/AbstractTableFacade.java
   2012-08-08 21:42:52 UTC (rev 30133)
+++ 
csplugins/trunk/ucsd/mes/cy3-shared-local-tables/impl/model-impl/impl/src/main/java/org/cytoscape/model/internal/AbstractTableFacade.java
   2012-08-08 21:43:37 UTC (rev 30134)
@@ -201,26 +201,46 @@
 
                @Override
                public void set(String attributeName, Object value) {
+                       if ( value != null && attributeName != null && 
attributeName.equals("edges.SUID") ) {
+                               System.out.println("facade set (" + 
Long.toString(actualRow.get("SUID",Long.class)) + " - " + table.getTitle() + ") 
" + attributeName + " " + value.toString());
+                               Thread.dumpStack();
+                       }
                        actualRow.set(attributeName,value);
                }
 
                @Override
                public <T> T get(String attributeName, Class<? extends T> c) {
+                       if ( attributeName != null && c != null && 
attributeName.equals("edges.SUID")) {
+                               System.out.println("facade GET (" + 
Long.toString(actualRow.get("SUID",Long.class)) + " - " + table.getTitle() + ") 
" + attributeName + " = " + (actualRow.get(attributeName, c)));
+                               Thread.dumpStack();
+                       }
                        return actualRow.get(attributeName, c);
                }
 
                @Override
                public <T> T get(String attributeName, Class<? extends T> c, T 
defValue) {
+                       if ( attributeName != null && c != null && 
attributeName.equals("edges.SUID")) {
+                               System.out.println("facade GET (" + 
Long.toString(actualRow.get("SUID",Long.class)) + " - " + table.getTitle() + ") 
" + attributeName + " = " + (actualRow.get(attributeName, c, 
defValue)).toString());
+                               Thread.dumpStack();
+                       }
                        return actualRow.get(attributeName, c, defValue);
                }
 
                @Override
                public <T> List<T> getList(String attributeName, Class<T> c) {
+                       if ( attributeName != null && c != null && 
attributeName.equals("edges.SUID")) {
+                               System.out.println("facade GET LIST (" + 
Long.toString(actualRow.get("SUID",Long.class)) + " - " + table.getTitle() + ") 
" + attributeName + " = " + (actualRow.getList(attributeName, c)).toString());
+                               Thread.dumpStack();
+                       }
                        return actualRow.getList(attributeName, c);
                }
 
                @Override
                public <T> List<T> getList(String attributeName, Class<T> c, 
List<T> defValue) {
+                       if ( attributeName != null && c != null && 
attributeName.equals("edges.SUID")) {
+                               System.out.println("facade GET LIST (" + 
Long.toString(actualRow.get("SUID",Long.class)) + " - " + table.getTitle() + ") 
" + attributeName + " = " + (actualRow.getList(attributeName, c, 
defValue)).toString());
+                               Thread.dumpStack();
+                       }
                        return actualRow.getList( attributeName, c, defValue);
                }
 

Modified: 
csplugins/trunk/ucsd/mes/cy3-shared-local-tables/impl/model-impl/impl/src/main/java/org/cytoscape/model/internal/LocalTableFacade.java
===================================================================
--- 
csplugins/trunk/ucsd/mes/cy3-shared-local-tables/impl/model-impl/impl/src/main/java/org/cytoscape/model/internal/LocalTableFacade.java
      2012-08-08 21:42:52 UTC (rev 30133)
+++ 
csplugins/trunk/ucsd/mes/cy3-shared-local-tables/impl/model-impl/impl/src/main/java/org/cytoscape/model/internal/LocalTableFacade.java
      2012-08-08 21:43:37 UTC (rev 30134)
@@ -74,18 +74,17 @@
  * new column in the local table.  All virtual column methods create virtual 
  * columns in both the shared and local tables. 
  */
-public final class LocalTableFacade implements CyTable {
+public final class LocalTableFacade extends AbstractTableFacade implements 
CyTable {
        
        
        private static final Logger logger = 
LoggerFactory.getLogger(LocalTableFacade.class);
        private final CyTable shared;
        private final CyTable local;
-       private final Long suid;
 
        public LocalTableFacade(CyTable local, SharedTableFacade shared) {
+               super(local);
                this.local = local;
                this.shared = shared;
-               this.suid = Long.valueOf(SUIDFactory.getNextSUID()); 
 
                // this adds virtual columns for any existing columns already 
in the shared table
                local.addVirtualColumns(shared.getActualTable(), 
CyIdentifiable.SUID, true);
@@ -95,47 +94,6 @@
                return local;
        }
 
-       public Long getSUID() {
-               return suid;    
-       }
-
-       public boolean isPublic() {
-               return local.isPublic();
-       }
-       
-       public void setPublic (boolean isPublic) {
-               local.setPublic(isPublic);      
-       }
-
-       public CyTable.Mutability getMutability() {
-               return local.getMutability();
-       }
-
-       public String getTitle() {
-               return local.getTitle();
-       }
-
-       public void setTitle(String title) {
-               local.setTitle(title);
-       }
-
-       public CyColumn getPrimaryKey() {
-               return local.getPrimaryKey();
-       }
-
-       public CyColumn getColumn(String columnName) {
-               return local.getColumn(columnName);
-       }
-
-       public Collection<CyColumn> getColumns() {
-               return local.getColumns();
-       }
-
-       public void deleteColumn(String columnName) {
-               local.deleteColumn(columnName);
-                       
-       }
-
        public <T> void createColumn(String columnName, Class<?extends T> type, 
boolean isImmutable) {
                createColumn(columnName,type,isImmutable,null);
        }
@@ -150,43 +108,10 @@
        }
 
        public <T> void createListColumn(String columnName, Class<T> 
listElementType, boolean isImmutable, List<T> defaultValue ) {
-               logger.debug("delegating createListColumn '" + columnName + "' 
from local " + local.getTitle() + " to shared: " + shared.getTitle());
+               logger.debug("delegating create List Column '" + columnName + 
"' from local " + local.getTitle() + " to shared: " + shared.getTitle());
                
shared.createListColumn(columnName,listElementType,isImmutable,defaultValue);
        }
 
-       public CyRow getRow(Object primaryKey) {
-               return local.getRow(primaryKey);
-       }
-
-       public boolean rowExists(Object primaryKey) {
-               return local.rowExists(primaryKey); 
-       }
-
-       public boolean deleteRows(Collection<?> primaryKeys) {
-               return local.deleteRows(primaryKeys); 
-       }
-
-       public List<CyRow> getAllRows() {
-               return local.getAllRows();      
-       }
-
-       public String getLastInternalError() {
-               return local.getLastInternalError();
-       }
-
-       public Collection<CyRow> getMatchingRows(String columnName, Object 
value) {
-               return local.getMatchingRows(columnName,value); 
-       }
-
-       public int countMatchingRows(String columnName, Object value) {
-               return local.countMatchingRows(columnName, value);
-
-       }
-
-       public int getRowCount() {
-               return local.getRowCount();     
-       }
-
        public String addVirtualColumn(String virtualColumn, String 
sourceColumn, CyTable sourceTable, String targetJoinKey, boolean isImmutable) {
                String s = shared.addVirtualColumn(virtualColumn, sourceColumn, 
sourceTable, targetJoinKey, isImmutable);
                return s;
@@ -195,16 +120,4 @@
        public void addVirtualColumns(CyTable sourceTable, String 
targetJoinKey, boolean isImmutable) {
                shared.addVirtualColumns(sourceTable, targetJoinKey, 
isImmutable);
        }
-
-       public SavePolicy getSavePolicy() {
-               return local.getSavePolicy();
-       }
-
-       public void setSavePolicy(SavePolicy policy) {
-               local.setSavePolicy(policy);
-       }
-
-       public void swap(CyTable otherTable) {
-               local.swap(otherTable); 
-       }
 }

Modified: 
csplugins/trunk/ucsd/mes/cy3-shared-local-tables/impl/model-impl/impl/src/main/java/org/cytoscape/model/internal/LocalTableFacade.java.with_abstract
===================================================================
--- 
csplugins/trunk/ucsd/mes/cy3-shared-local-tables/impl/model-impl/impl/src/main/java/org/cytoscape/model/internal/LocalTableFacade.java.with_abstract
        2012-08-08 21:42:52 UTC (rev 30133)
+++ 
csplugins/trunk/ucsd/mes/cy3-shared-local-tables/impl/model-impl/impl/src/main/java/org/cytoscape/model/internal/LocalTableFacade.java.with_abstract
        2012-08-08 21:43:37 UTC (rev 30134)
@@ -108,6 +108,7 @@
        }
 
        public <T> void createListColumn(String columnName, Class<T> 
listElementType, boolean isImmutable, List<T> defaultValue ) {
+               logger.debug("delegating createListColumn '" + columnName + "' 
from local " + local.getTitle() + " to shared: " + shared.getTitle());
                
shared.createListColumn(columnName,listElementType,isImmutable,defaultValue);
        }
 

Modified: 
csplugins/trunk/ucsd/mes/cy3-shared-local-tables/impl/model-impl/impl/src/main/java/org/cytoscape/model/internal/SharedTableFacade.java
===================================================================
--- 
csplugins/trunk/ucsd/mes/cy3-shared-local-tables/impl/model-impl/impl/src/main/java/org/cytoscape/model/internal/SharedTableFacade.java
     2012-08-08 21:42:52 UTC (rev 30133)
+++ 
csplugins/trunk/ucsd/mes/cy3-shared-local-tables/impl/model-impl/impl/src/main/java/org/cytoscape/model/internal/SharedTableFacade.java
     2012-08-08 21:43:37 UTC (rev 30134)
@@ -126,9 +126,16 @@
        }
 
        public <T> void createListColumn(String columnName, Class<T> 
listElementType, boolean isImmutable, List<T> defaultValue ) {
+               logger.debug("adding real List column: '" + columnName + "' to 
table: " + shared.getTitle());
                shared.createListColumn(columnName, listElementType, 
isImmutable, defaultValue);
-               for ( CyTable local : localTables() ) 
+               for ( CyTable local : localTables() ) {
+                       if ( local == null ) {
+                               logger.debug("NULL table!");
+                               continue;
+                       }
+                       logger.debug("adding virtual list column: " + 
columnName + " to local table: " + local.getTitle());
                        
local.addVirtualColumn(columnName,columnName,shared,CyIdentifiable.SUID,isImmutable);
+               }
        }
 
        public String addVirtualColumn(String virtualColumn, String 
sourceColumn, CyTable sourceTable, String targetJoinKey, boolean isImmutable) {

-- 
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