Author: abeld
Date: 2008-12-21 01:44:45 -0800 (Sun, 21 Dec 2008)
New Revision: 15477

Added:
   
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/vizmap/src/main/resources/
   
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/vizmap/src/main/resources/META-INF/
   
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/vizmap/src/main/resources/META-INF/spring/
   
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/vizmap/src/main/resources/META-INF/spring/bundle-context-osgi.xml
   
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/vizmap/src/main/resources/META-INF/spring/bundle-context.xml
Modified:
   
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/integration_test/pom.xml
   
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/integration_test/src/main/java/cytoscape/CyMain.java
   
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/integration_test/src/main/resources/META-INF/spring/bundle-context-osgi.xml
   
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/integration_test/src/main/resources/META-INF/spring/bundle-context.xml
   
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/viewmodel/src/main/resources/META-INF/spring/bundle-context-osgi.xml
   
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/viewmodel/src/main/resources/META-INF/spring/bundle-context.xml
Log:
refactored-viewmodel: export as service and integration-test VisualStyleCatalog

- export VisualStyleCatalog as bean (in vizmap bundle)

- also exportVisualPropertyCatalog, since it was not before (in
  viewmodel bundle)

- create and apply VisualStyle in integration_test (note: no
  MappingCalculators applied yet, so this is an empty VisualStyle)


Modified: 
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/integration_test/pom.xml
===================================================================
--- 
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/integration_test/pom.xml
    2008-12-21 09:14:42 UTC (rev 15476)
+++ 
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/integration_test/pom.xml
    2008-12-21 09:44:45 UTC (rev 15477)
@@ -173,6 +173,13 @@
 
                <dependency>
                        <groupId>org.cytoscape</groupId>
+                       <artifactId>vizmap</artifactId>
+                       <version>1.0-SNAPSHOT</version>
+               </dependency>
+
+
+               <dependency>
+                       <groupId>org.cytoscape</groupId>
                        <artifactId>presentation</artifactId>
                        <version>1.0-SNAPSHOT</version>
                </dependency>

Modified: 
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/integration_test/src/main/java/cytoscape/CyMain.java
===================================================================
--- 
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/integration_test/src/main/java/cytoscape/CyMain.java
        2008-12-21 09:14:42 UTC (rev 15476)
+++ 
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/integration_test/src/main/java/cytoscape/CyMain.java
        2008-12-21 09:44:45 UTC (rev 15477)
@@ -41,9 +41,8 @@
 import org.cytoscape.model.CyEdge;
 import org.cytoscape.model.GraphObject;
 
-import org.cytoscape.viewmodel.CyNetworkView;
-import org.cytoscape.viewmodel.CyNetworkViewFactory;
-import org.cytoscape.viewmodel.View;
+import org.cytoscape.viewmodel.*;
+import org.cytoscape.vizmap.*;
 
 import org.cytoscape.presentation.NetworkPresentationFactory;
 import org.cytoscape.presentation.TextPresentation;
@@ -87,7 +86,7 @@
            System.out.println("NetworkFactory:"+f);
        }
     public CyMain(CyNetworkFactory f, CyNetworkViewFactory vf,
-                 NetworkPresentationFactory pf) throws Exception {
+                 NetworkPresentationFactory pf, VisualStyleCatalog vsc) throws 
Exception {
            System.out.println("hello world! -- factories");
            System.out.println("NetworkFactory:"+f);
            CyNetwork network = f.getInstance();
@@ -105,6 +104,13 @@
            System.out.println(view.getCyEdgeView(e2));
 
            // create visual style, add an example MappingCalculator, dump 
values
+           VisualStyle myStyle = vsc.createVisualStyle();
+           /*MappingCalculator nodeLabel = 
+               new PassthroughMappingCalculator("id", 
vpCatalog.getVisualProperty("NODE_LABEL"));
+           myStyle.setMappingCalculator(nodeLabel); */
+           System.out.println(myStyle);
+           myStyle.apply(view);
+           // TODO: add passthroughMapping to copy id to nodeLabel
            TextPresentation p = pf.getTextPresentationFor(view);
            System.out.println(p.render());
        }

Modified: 
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/integration_test/src/main/resources/META-INF/spring/bundle-context-osgi.xml
===================================================================
--- 
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/integration_test/src/main/resources/META-INF/spring/bundle-context-osgi.xml
 2008-12-21 09:14:42 UTC (rev 15476)
+++ 
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/integration_test/src/main/resources/META-INF/spring/bundle-context-osgi.xml
 2008-12-21 09:44:45 UTC (rev 15477)
@@ -17,5 +17,8 @@
                
interface="org.cytoscape.presentation.NetworkPresentationFactory">
        </osgi:reference>
 
+       <osgi:reference id="visualStyleCatalogServiceRef"
+               interface="org.cytoscape.vizmap.VisualStyleCatalog">
+       </osgi:reference>
 
 </beans>

Modified: 
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/integration_test/src/main/resources/META-INF/spring/bundle-context.xml
===================================================================
--- 
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/integration_test/src/main/resources/META-INF/spring/bundle-context.xml
      2008-12-21 09:14:42 UTC (rev 15476)
+++ 
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/integration_test/src/main/resources/META-INF/spring/bundle-context.xml
      2008-12-21 09:44:45 UTC (rev 15477)
@@ -21,5 +21,6 @@
          <constructor-arg ref="cyNetworkFactoryServiceRef" />
          <constructor-arg ref="cyNetworkViewFactoryServiceRef" />
          <constructor-arg ref="networkPresentationFactoryServiceRef" />
+         <constructor-arg ref="visualStyleCatalogServiceRef" />
        </bean>
 </beans>

Modified: 
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/viewmodel/src/main/resources/META-INF/spring/bundle-context-osgi.xml
===================================================================
--- 
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/viewmodel/src/main/resources/META-INF/spring/bundle-context-osgi.xml
        2008-12-21 09:14:42 UTC (rev 15476)
+++ 
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/viewmodel/src/main/resources/META-INF/spring/bundle-context-osgi.xml
        2008-12-21 09:44:45 UTC (rev 15477)
@@ -14,8 +14,11 @@
                </osgi:service-properties>
        </osgi:service>
 
+       <osgi:service id="visualPropertyCatalogService"
+               ref="visualPropertyCatalog" 
interface="org.cytoscape.viewmodel.VisualPropertyCatalog">
+       </osgi:service>
+
        <osgi:reference id="cyEventHelperServiceRef"
                interface="org.cytoscape.event.CyEventHelper">
        </osgi:reference>
-
 </beans>

Modified: 
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/viewmodel/src/main/resources/META-INF/spring/bundle-context.xml
===================================================================
--- 
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/viewmodel/src/main/resources/META-INF/spring/bundle-context.xml
     2008-12-21 09:14:42 UTC (rev 15476)
+++ 
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/viewmodel/src/main/resources/META-INF/spring/bundle-context.xml
     2008-12-21 09:44:45 UTC (rev 15477)
@@ -19,4 +19,8 @@
          <property name="eventHelper" ref="cyEventHelperServiceRef"></property>
          <property name="bundleContext" ref="bundleContext"></property>
        </bean>
+
+       <bean id="visualPropertyCatalog" 
class="org.cytoscape.viewmodel.internal.VisualPropertyCatalogImpl">
+       </bean>
+
 </beans>

Added: 
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/vizmap/src/main/resources/META-INF/spring/bundle-context-osgi.xml
===================================================================
--- 
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/vizmap/src/main/resources/META-INF/spring/bundle-context-osgi.xml
   2008-12-21 09:14:42 UTC (rev 15476)
+++ 
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/vizmap/src/main/resources/META-INF/spring/bundle-context-osgi.xml
   2008-12-21 09:44:45 UTC (rev 15477)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:osgi="http://www.springframework.org/schema/osgi";
+       xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+                      http://www.springframework.org/schema/osgi 
http://www.springframework.org/schema/osgi/spring-osgi-1.0.xsd";
+       default-lazy-init="false">
+
+       <osgi:service id="visualStyleCatalogService"
+               ref="visualStyleCatalog" 
interface="org.cytoscape.vizmap.VisualStyleCatalog">
+       </osgi:service>
+
+       <osgi:reference id="cyEventHelperServiceRef"
+               interface="org.cytoscape.event.CyEventHelper">
+       </osgi:reference>
+
+       <osgi:reference id="visualPropertyCatalogRef"
+               interface="org.cytoscape.viewmodel.VisualPropertyCatalog">
+       </osgi:reference>
+</beans>

Added: 
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/vizmap/src/main/resources/META-INF/spring/bundle-context.xml
===================================================================
--- 
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/vizmap/src/main/resources/META-INF/spring/bundle-context.xml
        2008-12-21 09:14:42 UTC (rev 15476)
+++ 
cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/vizmap/src/main/resources/META-INF/spring/bundle-context.xml
        2008-12-21 09:44:45 UTC (rev 15477)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:aop="http://www.springframework.org/schema/aop";
+       xmlns:context="http://www.springframework.org/schema/context";
+       xmlns:lang="http://www.springframework.org/schema/lang"; 
xmlns:osgi="http://www.springframework.org/schema/osgi";
+       xsi:schemaLocation="
+    http://www.springframework.org/schema/beans
+    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+    http://www.springframework.org/schema/aop
+    http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
+    http://www.springframework.org/schema/context
+           http://www.springframework.org/schema/context/spring-context-2.5.xsd
+           http://www.springframework.org/schema/lang 
http://www.springframework.org/schema/lang/spring-lang-2.5.xsd
+            http://www.springframework.org/schema/osgi 
http://www.springframework.org/schema/osgi/spring-osgi-1.0.xsd";
+       default-lazy-init="false">
+
+       <context:annotation-config />
+
+       <bean id="visualStyleCatalog" 
class="org.cytoscape.vizmap.internal.VisualStyleCatalogImpl">
+         <property name="eventHelper" ref="cyEventHelperServiceRef"></property>
+         <property name="visualPropertyCatalog" 
ref="visualPropertyCatalogRef"></property>
+       </bean>
+
+</beans>


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