Author: kono
Date: 2010-09-15 16:09:57 -0700 (Wed, 15 Sep 2010)
New Revision: 21882
Added:
core3/vizmap-api/branches/vp-tree/
core3/vizmap-api/branches/vp-tree/src/main/java/org/cytoscape/view/vizmap/VisualMappingFunction.java
core3/vizmap-api/branches/vp-tree/src/main/java/org/cytoscape/view/vizmap/VisualStyle.java
core3/vizmap-api/branches/vp-tree/src/test/java/org/cytoscape/vizmap/AbstractVisualMappingFunctionTest.java
Removed:
core3/vizmap-api/branches/vp-tree/src/main/java/org/cytoscape/view/vizmap/VisualMappingFunction.java
core3/vizmap-api/branches/vp-tree/src/main/java/org/cytoscape/view/vizmap/VisualStyle.java
core3/vizmap-api/branches/vp-tree/src/test/java/org/cytoscape/vizmap/AbstractVisualMappingFunctionTest.java
Modified:
core3/vizmap-api/branches/vp-tree/src/main/java/org/cytoscape/view/vizmap/VisualMappingManager.java
Log:
Visual Property Tree version of view model.
Copied: core3/vizmap-api/branches/vp-tree (from rev 21529,
core3/vizmap-api/trunk)
Property changes on: core3/vizmap-api/branches/vp-tree
___________________________________________________________________
Name: svn:ignore
+ .settings
target
.classpath
.project
Name: svn:mergeinfo
+
Deleted:
core3/vizmap-api/branches/vp-tree/src/main/java/org/cytoscape/view/vizmap/VisualMappingFunction.java
===================================================================
---
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/VisualMappingFunction.java
2010-08-23 17:19:54 UTC (rev 21529)
+++
core3/vizmap-api/branches/vp-tree/src/main/java/org/cytoscape/view/vizmap/VisualMappingFunction.java
2010-09-15 23:09:57 UTC (rev 21882)
@@ -1,103 +0,0 @@
-/*
- Copyright (c) 2008, The Cytoscape Consortium (www.cytoscape.org)
-
- The Cytoscape Consortium is:
- - Institute for Systems Biology
- - University of California San Diego
- - Memorial Sloan-Kettering Cancer Center
- - Institut Pasteur
- - Agilent Technologies
-
- This library is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published
- by the Free Software Foundation; either version 2.1 of the License, or
- any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
- documentation provided hereunder is on an "as is" basis, and the
- Institute for Systems Biology and the Whitehead Institute
- have no obligations to provide maintenance, support,
- updates, enhancements or modifications. In no event shall the
- Institute for Systems Biology and the Whitehead Institute
- be liable to any party for direct, indirect, special,
- incidental or consequential damages, including lost profits, arising
- out of the use of this software and its documentation, even if the
- Institute for Systems Biology and the Whitehead Institute
- have been advised of the possibility of such damage. See
- the GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this library; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-*/
-package org.cytoscape.view.vizmap;
-
-import java.util.Collection;
-
-import org.cytoscape.model.GraphObject;
-import org.cytoscape.view.model.View;
-import org.cytoscape.view.model.VisualProperty;
-
-
-/**
- * This class defines how an attribute gets mapped to a visual property.<br />
- *
- * It takes two values:
- * <ul>
- * <li>Attribute value: node name(Strings), expression values(Numbers),
...</li>
- * <li>Visual Property: node size(Numbers), edge color(Color), node
shape(NodeShape), ...</li>
- * </ul>
- *
- * This provides the mapping function from converting the attribute to the
visual
- * property. Essentially, this is a map using <K> as the key and <V> as the
value.
- *
- * The direction of mapping is ALWAYS:<br />
- *
- * K(Attribute) ---> V(Visual Property)
- *
- * K will be used in implementations.
- *
- * @param <K> Attribute value object type. This is the key of this mapping
(Can be any objects)
- * @param <V> Visual property value type. (can be any type)
- *
- */
-public interface VisualMappingFunction<K, V> {
-
- /**
- * Returns attribute name used in this mapping.
- *
- * @return DOCUMENT ME!
- */
- public String getMappingAttributeName();
-
-
- /**
- *
- * @return
- */
- public Class<K> getMappingAttributeType();
-
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public VisualProperty<V> getVisualProperty();
-
-
- /**
- * Since current MappingCalculators map from Attributes to
- * VisualProperties, have to restrict View<?> to those
- * generic types that have CyAttributes; currently this is
- * GraphObject.
- *
- * @param <G> Graph object type.
- *
- * @param column DOCUMENT ME!
- * @param views DOCUMENT ME!
- */
- <G extends GraphObject> void apply(final Collection<? extends View<G>>
views);
-}
Copied:
core3/vizmap-api/branches/vp-tree/src/main/java/org/cytoscape/view/vizmap/VisualMappingFunction.java
(from rev 21770,
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/VisualMappingFunction.java)
===================================================================
---
core3/vizmap-api/branches/vp-tree/src/main/java/org/cytoscape/view/vizmap/VisualMappingFunction.java
(rev 0)
+++
core3/vizmap-api/branches/vp-tree/src/main/java/org/cytoscape/view/vizmap/VisualMappingFunction.java
2010-09-15 23:09:57 UTC (rev 21882)
@@ -0,0 +1,103 @@
+/*
+ Copyright (c) 2008, The Cytoscape Consortium (www.cytoscape.org)
+
+ The Cytoscape Consortium is:
+ - Institute for Systems Biology
+ - University of California San Diego
+ - Memorial Sloan-Kettering Cancer Center
+ - Institut Pasteur
+ - Agilent Technologies
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
+ documentation provided hereunder is on an "as is" basis, and the
+ Institute for Systems Biology and the Whitehead Institute
+ have no obligations to provide maintenance, support,
+ updates, enhancements or modifications. In no event shall the
+ Institute for Systems Biology and the Whitehead Institute
+ be liable to any party for direct, indirect, special,
+ incidental or consequential damages, including lost profits, arising
+ out of the use of this software and its documentation, even if the
+ Institute for Systems Biology and the Whitehead Institute
+ have been advised of the possibility of such damage. See
+ the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+*/
+package org.cytoscape.view.vizmap;
+
+import java.util.Collection;
+
+import org.cytoscape.model.CyTableEntry;
+import org.cytoscape.view.model.View;
+import org.cytoscape.view.model.VisualProperty;
+
+
+/**
+ * This class defines how an attribute gets mapped to a visual property.<br />
+ *
+ * It takes two values:
+ * <ul>
+ * <li>Attribute value: node name(Strings), expression values(Numbers),
...</li>
+ * <li>Visual Property: node size(Numbers), edge color(Color), node
shape(NodeShape), ...</li>
+ * </ul>
+ *
+ * This provides the mapping function from converting the attribute to the
visual
+ * property. Essentially, this is a map using <K> as the key and <V> as the
value.
+ *
+ * The direction of mapping is ALWAYS:<br />
+ *
+ * K(Attribute) ---> V(Visual Property)
+ *
+ * K will be used in implementations.
+ *
+ * @param <K> Attribute value object type. This is the key of this mapping
(Can be any objects)
+ * @param <V> Visual property value type. (can be any type)
+ *
+ */
+public interface VisualMappingFunction<K, V> {
+
+ /**
+ * Returns attribute name used in this mapping.
+ *
+ * @return DOCUMENT ME!
+ */
+ public String getMappingAttributeName();
+
+
+ /**
+ *
+ * @return
+ */
+ public Class<K> getMappingAttributeType();
+
+
+ /**
+ * DOCUMENT ME!
+ *
+ * @return DOCUMENT ME!
+ */
+ public VisualProperty<V> getVisualProperty();
+
+
+ /**
+ * Since current MappingCalculators map from Attributes to
+ * VisualProperties, have to restrict View<?> to those
+ * generic types that have CyAttributes; currently this is
+ * CyTableEntry.
+ *
+ * @param <G> Graph object type.
+ *
+ * @param column DOCUMENT ME!
+ * @param views DOCUMENT ME!
+ */
+ void apply(final Collection<? extends View<? extends CyTableEntry>>
views);
+}
Modified:
core3/vizmap-api/branches/vp-tree/src/main/java/org/cytoscape/view/vizmap/VisualMappingManager.java
===================================================================
---
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/VisualMappingManager.java
2010-08-23 17:19:54 UTC (rev 21529)
+++
core3/vizmap-api/branches/vp-tree/src/main/java/org/cytoscape/view/vizmap/VisualMappingManager.java
2010-09-15 23:09:57 UTC (rev 21882)
@@ -39,7 +39,7 @@
import java.util.Collection;
import org.cytoscape.view.model.CyNetworkView;
-import org.cytoscape.view.model.RootVisualLexicon;
+import org.cytoscape.view.model.VisualLexiconManager;
/**
@@ -114,5 +114,5 @@
*
* @return All Visual Lexicon
*/
- public RootVisualLexicon getRootVisualLexicon();
+ public VisualLexiconManager getRootVisualLexicon();
}
Deleted:
core3/vizmap-api/branches/vp-tree/src/main/java/org/cytoscape/view/vizmap/VisualStyle.java
===================================================================
---
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/VisualStyle.java
2010-08-23 17:19:54 UTC (rev 21529)
+++
core3/vizmap-api/branches/vp-tree/src/main/java/org/cytoscape/view/vizmap/VisualStyle.java
2010-09-15 23:09:57 UTC (rev 21882)
@@ -1,132 +0,0 @@
-/*
- Copyright (c) 2008, The Cytoscape Consortium (www.cytoscape.org)
-
- The Cytoscape Consortium is:
- - Institute for Systems Biology
- - University of California San Diego
- - Memorial Sloan-Kettering Cancer Center
- - Institut Pasteur
- - Agilent Technologies
-
- This library is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published
- by the Free Software Foundation; either version 2.1 of the License, or
- any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
- documentation provided hereunder is on an "as is" basis, and the
- Institute for Systems Biology and the Whitehead Institute
- have no obligations to provide maintenance, support,
- updates, enhancements or modifications. In no event shall the
- Institute for Systems Biology and the Whitehead Institute
- be liable to any party for direct, indirect, special,
- incidental or consequential damages, including lost profits, arising
- out of the use of this software and its documentation, even if the
- Institute for Systems Biology and the Whitehead Institute
- have been advised of the possibility of such damage. See
- the GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this library; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
- */
-package org.cytoscape.view.vizmap;
-
-import java.util.Collection;
-
-import org.cytoscape.view.model.CyNetworkView;
-import org.cytoscape.view.model.VisualLexicon;
-import org.cytoscape.view.model.VisualProperty;
-
-
-/**
- * This is simply a collection of MappingCalculators that define how a set of
- * attributes modify the visual properties of a View object.
- *
- */
-public interface VisualStyle {
- /**
- * Returns name of this visual style. This should NOT be used as ID of
this
- * Visual Style. Just for GUI components.
- *
- * @return title of this visual style
- */
- public String getTitle();
-
- /**
- * Set new title of this VS.
- * Will be used by rename function.
- *
- * @param title
- * New title.
- */
- public void setTitle(String title);
-
- /**
- * Add a new mapping for this Visual Style.
- *
- * Note: renamed from "set" to "add" for consistency.
- *
- * @param mapping
- * DOCUMENT ME!
- */
- public void addVisualMappingFunction(VisualMappingFunction<?, ?>
mapping);
-
- /**
- * get current mapping for the Visual Property vp.
- *
- * @param <V> DOCUMENT ME!
- * @param vp DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public <V> VisualMappingFunction<?, V>
getVisualMappingFunction(VisualProperty<V> vp);
-
- /**
- * Returns all available mappings.
- *
- * @return All visual mappings for this style.
- */
- public Collection<VisualMappingFunction<?, ?>>
getAllVisualMappingFunctions();
-
- /**
- * Remove a mapping for Visual Property.
- *
- * @param <V> DOCUMENT ME!
- * @param vp DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public <V> VisualMappingFunction<?, V>
removeVisualMappingFunction(VisualProperty<V> vp);
-
- /**
- * Returns default value for the Visual Property vp.
- *
- * @param <V> DOCUMENT ME!
- * @param vp DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public <V> V getDefaultValue(VisualProperty<? extends V> vp);
-
- /**
- * Setter for the default value of vp.
- *
- * @param <V> DOCUMENT ME!
- * @param vp DOCUMENT ME!
- * @param value DOCUMENT ME!
- */
- public <V> void setDefaultValue(VisualProperty<? extends V> vp, V
value);
-
- /**
- * Apply this visual style to the view.
- *
- * @param v
- * DOCUMENT ME!
- */
- void apply(CyNetworkView v);
-
- public VisualLexicon getVisualLexicon();
-}
Copied:
core3/vizmap-api/branches/vp-tree/src/main/java/org/cytoscape/view/vizmap/VisualStyle.java
(from rev 21663,
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/VisualStyle.java)
===================================================================
---
core3/vizmap-api/branches/vp-tree/src/main/java/org/cytoscape/view/vizmap/VisualStyle.java
(rev 0)
+++
core3/vizmap-api/branches/vp-tree/src/main/java/org/cytoscape/view/vizmap/VisualStyle.java
2010-09-15 23:09:57 UTC (rev 21882)
@@ -0,0 +1,133 @@
+/*
+ Copyright (c) 2008, The Cytoscape Consortium (www.cytoscape.org)
+
+ The Cytoscape Consortium is:
+ - Institute for Systems Biology
+ - University of California San Diego
+ - Memorial Sloan-Kettering Cancer Center
+ - Institut Pasteur
+ - Agilent Technologies
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
+ documentation provided hereunder is on an "as is" basis, and the
+ Institute for Systems Biology and the Whitehead Institute
+ have no obligations to provide maintenance, support,
+ updates, enhancements or modifications. In no event shall the
+ Institute for Systems Biology and the Whitehead Institute
+ be liable to any party for direct, indirect, special,
+ incidental or consequential damages, including lost profits, arising
+ out of the use of this software and its documentation, even if the
+ Institute for Systems Biology and the Whitehead Institute
+ have been advised of the possibility of such damage. See
+ the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+package org.cytoscape.view.vizmap;
+
+import java.util.Collection;
+
+import org.cytoscape.view.model.CyNetworkView;
+import org.cytoscape.view.model.VisualLexicon;
+import org.cytoscape.view.model.VisualProperty;
+
+
+/**
+ * This is simply a collection of MappingCalculators that define how a set of
+ * attributes modify the visual properties of a View object.
+ *
+ */
+public interface VisualStyle {
+
+ /**
+ * Returns name of this visual style. This should NOT be used as ID of
this
+ * Visual Style. Just for GUI components.
+ *
+ * @return title of this visual style
+ */
+ public String getTitle();
+
+ /**
+ * Set new title of this VS.
+ * Will be used by rename function.
+ *
+ * @param title
+ * New title.
+ */
+ public void setTitle(String title);
+
+ /**
+ * Add a new mapping for this Visual Style.
+ *
+ * Note: renamed from "set" to "add" for consistency.
+ *
+ * @param mapping
+ * DOCUMENT ME!
+ */
+ public void addVisualMappingFunction(VisualMappingFunction<?, ?>
mapping);
+
+ /**
+ * get current mapping for the Visual Property vp.
+ *
+ * @param <V> DOCUMENT ME!
+ * @param vp DOCUMENT ME!
+ *
+ * @return DOCUMENT ME!
+ */
+ public <V> VisualMappingFunction<?, V>
getVisualMappingFunction(VisualProperty<V> vp);
+
+ /**
+ * Returns all available mappings.
+ *
+ * @return All visual mappings for this style.
+ */
+ public Collection<VisualMappingFunction<?, ?>>
getAllVisualMappingFunctions();
+
+ /**
+ * Remove a mapping for Visual Property.
+ *
+ * @param <V> DOCUMENT ME!
+ * @param vp DOCUMENT ME!
+ *
+ * @return DOCUMENT ME!
+ */
+ public <V> VisualMappingFunction<?, V>
removeVisualMappingFunction(VisualProperty<V> vp);
+
+ /**
+ * Returns default value for the Visual Property vp.
+ *
+ * @param <V> DOCUMENT ME!
+ * @param vp DOCUMENT ME!
+ *
+ * @return DOCUMENT ME!
+ */
+ public <V> V getDefaultValue(VisualProperty<? extends V> vp);
+
+ /**
+ * Setter for the default value of vp.
+ *
+ * @param <V> DOCUMENT ME!
+ * @param vp DOCUMENT ME!
+ * @param value DOCUMENT ME!
+ */
+ public <V> void setDefaultValue(VisualProperty<? extends V> vp, V
value);
+
+ /**
+ * Apply this visual style to the view.
+ *
+ * @param v
+ * DOCUMENT ME!
+ */
+ void apply(CyNetworkView v);
+
+ VisualLexicon getVisualLexicon();
+}
Deleted:
core3/vizmap-api/branches/vp-tree/src/test/java/org/cytoscape/vizmap/AbstractVisualMappingFunctionTest.java
===================================================================
---
core3/vizmap-api/trunk/src/test/java/org/cytoscape/vizmap/AbstractVisualMappingFunctionTest.java
2010-08-23 17:19:54 UTC (rev 21529)
+++
core3/vizmap-api/branches/vp-tree/src/test/java/org/cytoscape/vizmap/AbstractVisualMappingFunctionTest.java
2010-09-15 23:09:57 UTC (rev 21882)
@@ -1,52 +0,0 @@
-package org.cytoscape.vizmap;
-
-
-import static org.junit.Assert.*;
-
-import java.util.Collection;
-
-import org.cytoscape.model.GraphObject;
-import org.cytoscape.view.model.View;
-import org.cytoscape.view.model.VisualProperty;
-import org.cytoscape.view.vizmap.VisualMappingFunction;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public abstract class AbstractVisualMappingFunctionTest<K, V> {
-
- protected VisualMappingFunction<K, V> mapping;
-
- // Aname of controlling attr.
- protected String attrName;
- protected Class<K> attrType;
- protected VisualProperty<V> vp;
-
-
-
- protected Collection<View<GraphObject>> views;
-
- @Before
- public void setUp() throws Exception {
- }
-
- @After
- public void tearDown() throws Exception {
- }
-
-
- @Test
- public void testMappingSettings() throws Exception {
- assertEquals(attrName, mapping.getMappingAttributeName());
- assertEquals(attrType, mapping.getMappingAttributeType());
- assertEquals(vp, mapping.getVisualProperty());
- }
-
- @Test
- public void testMappingApply() throws Exception {
- //FIXME need a real test!
- mapping.apply(views);
-
- }
-
-}
Copied:
core3/vizmap-api/branches/vp-tree/src/test/java/org/cytoscape/vizmap/AbstractVisualMappingFunctionTest.java
(from rev 21770,
core3/vizmap-api/trunk/src/test/java/org/cytoscape/vizmap/AbstractVisualMappingFunctionTest.java)
===================================================================
---
core3/vizmap-api/branches/vp-tree/src/test/java/org/cytoscape/vizmap/AbstractVisualMappingFunctionTest.java
(rev 0)
+++
core3/vizmap-api/branches/vp-tree/src/test/java/org/cytoscape/vizmap/AbstractVisualMappingFunctionTest.java
2010-09-15 23:09:57 UTC (rev 21882)
@@ -0,0 +1,52 @@
+package org.cytoscape.vizmap;
+
+
+import static org.junit.Assert.*;
+
+import java.util.Collection;
+
+import org.cytoscape.model.CyTableEntry;
+import org.cytoscape.view.model.View;
+import org.cytoscape.view.model.VisualProperty;
+import org.cytoscape.view.vizmap.VisualMappingFunction;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public abstract class AbstractVisualMappingFunctionTest<K, V> {
+
+ protected VisualMappingFunction<K, V> mapping;
+
+ // Aname of controlling attr.
+ protected String attrName;
+ protected Class<K> attrType;
+ protected VisualProperty<V> vp;
+
+
+
+ protected Collection<View<CyTableEntry>> views;
+
+ @Before
+ public void setUp() throws Exception {
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ }
+
+
+ @Test
+ public void testMappingSettings() throws Exception {
+ assertEquals(attrName, mapping.getMappingAttributeName());
+ assertEquals(attrType, mapping.getMappingAttributeType());
+ assertEquals(vp, mapping.getVisualProperty());
+ }
+
+ @Test
+ public void testMappingApply() throws Exception {
+ //FIXME need a real test!
+ mapping.apply(views);
+
+ }
+
+}
--
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.