Author: scooter
Date: 2012-04-10 16:44:14 -0700 (Tue, 10 Apr 2012)
New Revision: 28787
Added:
core3/api/trunk/group-data-api/src/main/java/org/cytoscape/group/data/CyGroupAggregationManager.java
Modified:
core3/api/trunk/app-api/pom.xml
core3/api/trunk/group-api/src/main/java/org/cytoscape/group/CyGroup.java
core3/api/trunk/group-api/src/main/java/org/cytoscape/group/CyGroupFactory.java
core3/api/trunk/group-api/src/main/java/org/cytoscape/group/CyGroupManager.java
core3/api/trunk/group-api/src/main/java/org/cytoscape/group/package-info.java
core3/api/trunk/group-data-api/src/main/java/org/cytoscape/group/data/Aggregator.java
core3/api/trunk/group-data-api/src/main/java/org/cytoscape/group/data/CyGroupSettings.java
Log:
Changes to support aggregation and documentation updates.
Modified: core3/api/trunk/app-api/pom.xml
===================================================================
--- core3/api/trunk/app-api/pom.xml 2012-04-10 23:43:45 UTC (rev 28786)
+++ core3/api/trunk/app-api/pom.xml 2012-04-10 23:44:14 UTC (rev 28787)
@@ -152,6 +152,16 @@
</dependency>
<dependency>
<groupId>org.cytoscape</groupId>
+ <artifactId>group-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.cytoscape</groupId>
+ <artifactId>group-data-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.cytoscape</groupId>
<artifactId>service-api</artifactId>
<version>${project.version}</version>
</dependency>
Modified:
core3/api/trunk/group-api/src/main/java/org/cytoscape/group/CyGroup.java
===================================================================
--- core3/api/trunk/group-api/src/main/java/org/cytoscape/group/CyGroup.java
2012-04-10 23:43:45 UTC (rev 28786)
+++ core3/api/trunk/group-api/src/main/java/org/cytoscape/group/CyGroup.java
2012-04-10 23:44:14 UTC (rev 28787)
@@ -37,11 +37,17 @@
/**
- * An object that represents a group of nodes and edges. Groups at the model
- * layer are a simple extension of a CyNode that creates a subnetwork for every
- * for every group. Groups may be added to networks in the same way that nodes
- * are. To determine if a node in a network is a group, use the instanceof
keyword
- * to check for CyGroup: if (node instanceof CyGroup).
+ * An object that represents a group of nodes and edges. A CyGroup
+ * is an object that encapsulates a {@link CyNode} that represents
+ * a collection of {@link CyNode}s and connecting {@link CyEdge}s
+ * stored as a {@link CyNetwork}. In addition a CyGroup maintains
+ * information about the links between the nodes in the group and
+ * nodes external to the group. Groups may be collapsed or expanded.
+ * A collapsed group is represented in a network as the {@link CyNode}
+ * representing the group and a series of "meta" edges that represent
+ * the edges between nodes within the group and external nodes. Like
+ * any other node, the group node can also have edges connecting to other
+ * nodes.
*
* @CyAPI.Api.Interface
*/
@@ -156,8 +162,9 @@
CyRootNetwork getRootNetwork(); // Should this return a CyNetwork
instead?
/**
- * Add a group to an additional network. When groups are created, they
are created in
- * a particular network. The can also be shown in other networks, as
long as all of
+ * Add a group to an additional network. When groups are created,
+ * they are created in a particular network. The can also be shown
+ * in other networks, as long as all of
* the networks are in the same {@link CyRootNetwork}
*
* @param network the {@link CyNetwork} to add the group to
@@ -187,27 +194,32 @@
public boolean isInNetwork(CyNetwork network);
/**
- * Collapse this group in the designated network. Note that this is a
"model-level"
- * collapse, which removes all of the member nodes and edges and
replaces them
- * with the node that represents the group in the network. This does
not imply
- * a specific visual representation.
+ * Collapse this group in the designated network. Note that this is
+ * a "model-level" collapse, which removes all of the member nodes
+ * and edges and replaces them with the node that represents the
+ * group in the network. This does not imply a specific visual
+ * representation.
*
- * @param network the {@link CyNetwork} that this group should be
collapsed in
+ * @param network the {@link CyNetwork} that this group should
+ * be collapsed in
*/
void collapse(CyNetwork network);
/**
- * Expand this group in the designated network. Note that this is a
"model-level"
- * expansion, which removes the node that represents the group from the
network
- * and adds all of the member nodes and edges. This does not imply
- * a specific visual representation.
+ * Expand this group in the designated network. Note that this
+ * is a "model-level" expansion, which removes the node that
+ * represents the group from the network and adds all of the
+ * member nodes and edges. This does not imply a specific
+ * visual representation.
*
- * @param network the {@link CyNetwork} that this group should be
expanded in
+ * @param network the {@link CyNetwork} that this group
+ * should be expanded in
*/
void expand(CyNetwork network);
/**
- * Return whether this group is expanded or collapsed in the designated
network.
+ * Return whether this group is expanded or collapsed in the
+ * designated network.
*
* @param network the {@link CyNetwork} we're interested in
* @return true if the group is collapsed in that network.
Modified:
core3/api/trunk/group-api/src/main/java/org/cytoscape/group/CyGroupFactory.java
===================================================================
---
core3/api/trunk/group-api/src/main/java/org/cytoscape/group/CyGroupFactory.java
2012-04-10 23:43:45 UTC (rev 28786)
+++
core3/api/trunk/group-api/src/main/java/org/cytoscape/group/CyGroupFactory.java
2012-04-10 23:44:14 UTC (rev 28787)
@@ -57,23 +57,30 @@
*
* @param network the {@link CyNetwork} this group is part of
* @param nodes the {@link CyNode}s that are part of this group.
- * @param edges the {@link CyEdge}s that are part of this group. If
this is null, the edges
+ * @param edges the {@link CyEdge}s that are part of this group.
+ * If this is null, the edges are determined based
+ * on the node connectivity
* @param register if true, register the {@link CyGroup}
- * are determined based on the node connectivity.
* @return A new {@link CyGroup} as part of the designated network.
*/
- public CyGroup createGroup(CyNetwork network, List<CyNode> nodes,
List<CyEdge> edges, boolean register);
+ public CyGroup createGroup(CyNetwork network,
+ List<CyNode> nodes, List<CyEdge> edges,
+ boolean register);
/**
- * Creates a CyGroup object in the referenced network from an existing
{@link CyNode}.
+ * Creates a CyGroup object in the referenced network from
+ * an existing {@link CyNode}.
*
* @param network the {@link CyNetwork} this group is part of
* @param node the {@link CyNode} to convert into a group
* @param nodes the {@link CyNode}s that are part of this group.
- * @param edges the {@link CyEdge}s that are part of this group. If
this is null, the edges
+ * @param edges the {@link CyEdge}s that are part of this group.
+ * If this is null, the edges are determined based
+ * on the node connectivity
* @param register if true, register the {@link CyGroup}
- * are determined based on the node connectivity.
* @return A new {@link CyGroup} as part of the designated network.
*/
- public CyGroup createGroup(CyNetwork network, CyNode node,
List<CyNode>nodes, List<CyEdge> edges, boolean register);
+ public CyGroup createGroup(CyNetwork network,
+ CyNode node, List<CyNode>nodes,
+ List<CyEdge> edges, boolean register);
}
Modified:
core3/api/trunk/group-api/src/main/java/org/cytoscape/group/CyGroupManager.java
===================================================================
---
core3/api/trunk/group-api/src/main/java/org/cytoscape/group/CyGroupManager.java
2012-04-10 23:43:45 UTC (rev 28786)
+++
core3/api/trunk/group-api/src/main/java/org/cytoscape/group/CyGroupManager.java
2012-04-10 23:44:14 UTC (rev 28787)
@@ -39,17 +39,22 @@
/**
- * Basic access to groups in an instance of Cytoscape.
+ * The CyGroupManager maintains information about all of the groups
+ * an instance of Cytoscape.
* @CyAPI.Api.Interface
*/
public interface CyGroupManager {
/**
- * Provides the set of all the groups known to the groups manager in a
particular network.
+ * Provides the set of all the groups known to the groups
+ * manager in a particular network.
*
- * @param network the network to get the groups from. If the network
is null, then
- * return only those groups that have been designated as "global" (no
referenced network)
- * for this {@link CyRootNetwork}
- * @return the complete set of all the currently known groups in a
Cytoscape network
+ * @param network the network to get the groups from. If
+ * the network is null, then return only those
+ * groups that have been designated as
+ * "global" (no referenced network)
+ * for this {@link CyRootNetwork}
+ * @return the complete set of all the currently known groups
+ * in a Cytoscape network
*/
public Set<CyGroup> getGroupSet(CyNetwork network);
@@ -92,8 +97,8 @@
public void destroyGroup(CyGroup group);
/**
- * Registers a group with the group manager. Does nothing if the group
is already
- * known to the group manager.
+ * Registers a group with the group manager. Does nothing
+ * if the group is already known to the group manager.
*
* @param group a non-null {@link CyGroup}
* @fires GroupAddedEvent
@@ -101,8 +106,8 @@
public void addGroup(final CyGroup group);
/**
- * Registers a list of groups with the group manager. Does nothing if
the group is already
- * known to the group manager.
+ * Registers a list of groups with the group manager. Does
+ * nothing if the group is already known to the group manager.
*
* @param groups a list of {@link CyGroup}
*/
Modified:
core3/api/trunk/group-api/src/main/java/org/cytoscape/group/package-info.java
===================================================================
---
core3/api/trunk/group-api/src/main/java/org/cytoscape/group/package-info.java
2012-04-10 23:43:45 UTC (rev 28786)
+++
core3/api/trunk/group-api/src/main/java/org/cytoscape/group/package-info.java
2012-04-10 23:44:14 UTC (rev 28787)
@@ -1,4 +1,15 @@
/**
- * This package provides an API for createing and managing groups in Cytoscape
+ * This package provides an API for creating and managing
+ * groups in Cytoscape. A {@link CyGroup} is a collection
+ * of nodes and associated edges represented by a node in a
+ * network. It is stored internally as a
+ * network and a list of external edges (edges that connect
+ * from nodes within the group to nodes outside of the group.
+ * Groups may contain nodes which represent groups, which allows
+ * for the creation of explicit hierarchies of groups. To create
+ * a group, use one of the {@link CyGroupFactory} methods. A
+ * {@link CyGroupManager} service is provided that tracks which
+ * groups apply in which networks and which {@link CyNode}s
+ * actually represent {@link CyGroups}.
*/
package org.cytoscape.group;
Modified:
core3/api/trunk/group-data-api/src/main/java/org/cytoscape/group/data/Aggregator.java
===================================================================
---
core3/api/trunk/group-data-api/src/main/java/org/cytoscape/group/data/Aggregator.java
2012-04-10 23:43:45 UTC (rev 28786)
+++
core3/api/trunk/group-data-api/src/main/java/org/cytoscape/group/data/Aggregator.java
2012-04-10 23:44:14 UTC (rev 28787)
@@ -6,6 +6,21 @@
public interface Aggregator<T> {
/**
+ * Return the Class this aggregator supports
+ *
+ * @return the {@link Class} supported
+ */
+ public Class getSupportedType();
+
+ /**
+ * This gets the name of the handling type supported
+ * by this aggregator, suitable for use in a menu.
+ *
+ * @return a name for the handling type
+ */
+ public String toString();
+
+ /**
* Aggregate the column for the members of the specified group into
* the group.
*
Added:
core3/api/trunk/group-data-api/src/main/java/org/cytoscape/group/data/CyGroupAggregationManager.java
===================================================================
---
core3/api/trunk/group-data-api/src/main/java/org/cytoscape/group/data/CyGroupAggregationManager.java
(rev 0)
+++
core3/api/trunk/group-data-api/src/main/java/org/cytoscape/group/data/CyGroupAggregationManager.java
2012-04-10 23:44:14 UTC (rev 28787)
@@ -0,0 +1,53 @@
+package org.cytoscape.group.data;
+
+import org.cytoscape.group.CyGroup;
+import org.cytoscape.model.CyColumn;
+import org.cytoscape.model.CyTable;
+
+import java.util.List;
+
+/**
+ * The CyGroupAggregationManager provides a mechanism to add new
+ * Aggregators to the group aggregation mechanism. It is
+ * meant to be used by apps that want to extend the aggregation
+ * mechanism for types not supported by the built-in aggregators.
+ */
+public interface CyGroupAggregationManager {
+ /**
+ * Add a new aggregator to the available aggregators. Aggregators
+ * provide a specific aggregation algorithm for a specific CyColumn
+ * type.
+ *
+ * @param aggregator the {@Link Aggregator}
+ */
+ public void addAggregator(Aggregator aggregator);
+
+ /**
+ * Remove an aggregator from the available aggregators.
+ *
+ * @param aggregator the {@Link Aggregator} to remove
+ */
+ public void removeAggregator(Aggregator aggregator);
+
+ /**
+ * Get the list of aggregators for a particular Class.
+ *
+ * @param type the {@link Class} to get aggregators for
+ * @return the list of aggregators
+ */
+ public List<Aggregator> getAggregators(Class type);
+
+ /**
+ * Get the list of aggregators.
+ *
+ * @return the list of aggregators
+ */
+ public List<Aggregator> getAggregators();
+
+ /**
+ * Get the list of classes for which have aggregators.
+ *
+ * @return the list of classes we're aggregating
+ */
+ public List<Class> getSupportedClasses();
+}
Modified:
core3/api/trunk/group-data-api/src/main/java/org/cytoscape/group/data/CyGroupSettings.java
===================================================================
---
core3/api/trunk/group-data-api/src/main/java/org/cytoscape/group/data/CyGroupSettings.java
2012-04-10 23:43:45 UTC (rev 28786)
+++
core3/api/trunk/group-data-api/src/main/java/org/cytoscape/group/data/CyGroupSettings.java
2012-04-10 23:44:14 UTC (rev 28787)
@@ -65,7 +65,7 @@
}
/**
- * Get the action to use when the user double-clicks on a group node or
member node.
+ * Get the default action to use when the user double-clicks on a group
node or member node.
* This settings has no impact if Cytoscape is headless.
*
* @return the double-click action
@@ -73,14 +73,32 @@
public DoubleClickAction getDoubleClickAction();
/**
- * Set the action to use when the user double-clicks on a group node or
member node.
+ * Get the action to use when the user double-clicks a specific group
node or member node.
* This settings has no impact if Cytoscape is headless.
*
+ * @param group the group we're interested in
+ * @return the double-click action
+ */
+ public DoubleClickAction getDoubleClickAction(CyGroup group);
+
+ /**
+ * Set the default action to use when the user double-clicks on a group
node or member node.
+ * This settings has no impact if Cytoscape is headless.
+ *
* @param action the double-click action
*/
public void setDoubleClickAction(DoubleClickAction action);
/**
+ * Set the action to use when the user double-clicks on a specific
group node or member node.
+ * This settings has no impact if Cytoscape is headless.
+ *
+ * @param group the group we're interested in
+ * @param action the double-click action
+ */
+ public void setDoubleClickAction(CyGroup group, DoubleClickAction
action);
+
+ /**
* Determine whether attribute aggregation (aggregating all of the
attributes from member nodes
* onto the group node).
*
@@ -89,6 +107,15 @@
public boolean getEnableAttributeAggregation();
/**
+ * Determine whether attribute aggregation (aggregating all of the
attributes from member nodes
+ * onto the group node) is enabled for a specific group.
+ *
+ * @param group the group we're interested in
+ * @return whether attribute aggregation is enabled (true) or not
(false)
+ */
+ public boolean getEnableAttributeAggregation(CyGroup group);
+
+ /**
* Set whether attribute aggregation (aggregating all of the attributes
from member nodes
* onto the group node).
*
@@ -96,14 +123,34 @@
*/
public void setEnableAttributeAggregation(boolean aggregateAttributes);
+ /**
+ * Set whether attribute aggregation (aggregating all of the attributes
from member nodes
+ * onto the group node) is enabled for a specific group.
+ *
+ * @param group the group we're interested in
+ * @param aggregateAttributes whether attribute aggregation is enabled
(true) or not (false)
+ */
+ public void setEnableAttributeAggregation(CyGroup group, boolean
aggregateAttributes);
+
+ /**
+ * The the {@link Aggregator} for a specific group and column
+ *
+ * @param group the group to get the aggregator for
+ * @param column the column to get the aggregator for
+ * @return the aggregator to use for this group and column
+ */
public Aggregator getAggregator(CyGroup group, CyColumn column);
public void setDefaultAggregation(CyGroup group, Class ovClass, Aggregator
agg);
+ public Aggregator getDefaultAggregation(CyGroup group, Class ovClass);
public void setDefaultAggregation(Class ovClass, Aggregator agg);
+ public Aggregator getDefaultAggregation(Class ovClass);
public void setOverrideAggregation(CyGroup group, CyColumn column,
Aggregator agg);
+ public Aggregator getOverrideAggregation(CyGroup group, CyColumn column);
public void setOverrideAggregation(CyColumn column, Aggregator agg);
+ public Aggregator getOverrideAggregation(CyColumn column);
}
--
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.