Author: mes
Date: 2011-04-29 17:30:39 -0700 (Fri, 29 Apr 2011)
New Revision: 24877
Modified:
core3/layout-api/trunk/src/main/java/org/cytoscape/view/layout/CyLayoutAlgorithmManager.java
core3/layout-api/trunk/src/main/java/org/cytoscape/view/layout/internal/CyLayoutsImpl.java
Log:
Added javadoc and cleaned things up a bit.
Modified:
core3/layout-api/trunk/src/main/java/org/cytoscape/view/layout/CyLayoutAlgorithmManager.java
===================================================================
---
core3/layout-api/trunk/src/main/java/org/cytoscape/view/layout/CyLayoutAlgorithmManager.java
2011-04-30 00:18:58 UTC (rev 24876)
+++
core3/layout-api/trunk/src/main/java/org/cytoscape/view/layout/CyLayoutAlgorithmManager.java
2011-04-30 00:30:39 UTC (rev 24877)
@@ -31,21 +31,38 @@
import java.util.Collection;
-import java.util.Map;
-import org.cytoscape.view.model.CyNetworkView;
-
-
+/**
+ * This class provides access to the available layout algorithms.
+ */
public interface CyLayoutAlgorithmManager {
String PREF_MENU_KEY = "preferredMenu";
String PREF_MENU_DEFAULT = "Cytoscape Layouts";
String DEFAULT_LAYOUT_NAME = "grid";
+ String DEFAULT_LAYOUT_PROPERTY_NAME = "layout.default";
+ /**
+ * Returns a layout algorithm of the specified name and null if no
+ * algorithm exists with that name.
+ * @param name The name of the algorithm.
+ * @return a layout algorithm of the specified name and null if no
+ * algorithm exists with that name.
+ */
CyLayoutAlgorithm getLayout(String name);
+ /**
+ * Returns a collection of all available layouts.
+ * @return a collection of all available layouts.
+ */
Collection<CyLayoutAlgorithm> getAllLayouts();
+ /**
+ * Returns the default layout. The default layout name
+ * can be specified using the DEFAULT_LAYOUT_PROPERTY_NAME
+ * property.
+ * @return the default layout.
+ */
CyLayoutAlgorithm getDefaultLayout();
String getMenuName(CyLayoutAlgorithm layout);
Modified:
core3/layout-api/trunk/src/main/java/org/cytoscape/view/layout/internal/CyLayoutsImpl.java
===================================================================
---
core3/layout-api/trunk/src/main/java/org/cytoscape/view/layout/internal/CyLayoutsImpl.java
2011-04-30 00:18:58 UTC (rev 24876)
+++
core3/layout-api/trunk/src/main/java/org/cytoscape/view/layout/internal/CyLayoutsImpl.java
2011-04-30 00:30:39 UTC (rev 24877)
@@ -35,8 +35,10 @@
import org.cytoscape.view.layout.internal.algorithms.GridNodeLayout;
import org.cytoscape.view.model.CyNetworkView;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
@@ -91,6 +93,7 @@
* @param name String representing the name of the layout
* @return the layout of that name or null if it is not reigstered
*/
+ @Override
public CyLayoutAlgorithm getLayout(String name) {
if (layoutMap.containsKey(name))
return layoutMap.get(name);
@@ -102,6 +105,7 @@
*
* @return a Collection of all the available layouts
*/
+ @Override
public Collection<CyLayoutAlgorithm> getAllLayouts() {
return layoutMap.values();
}
@@ -112,6 +116,7 @@
*
* @return CyLayoutAlgorithm to use as the default layout algorithm
*/
+ @Override
public CyLayoutAlgorithm getDefaultLayout() {
// See if the user has set the layout.default property
// String defaultLayout =
CytoscapeInit.getProperties().getProperty("layout.default");
@@ -126,6 +131,7 @@
}
// Ack.
+ @Override
public String getMenuName(CyLayoutAlgorithm layout) {
return menuNameMap.get(layout);
}
--
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.