Author: mes
Date: 2011-10-20 13:24:30 -0700 (Thu, 20 Oct 2011)
New Revision: 27248

Modified:
   
core3/api/trunk/core-task-api/src/main/java/org/cytoscape/task/MapNetworkAttrTask.java
   
core3/api/trunk/io-api/src/main/java/org/cytoscape/io/read/CyNetworkReader.java
   
core3/api/trunk/session-api/src/main/java/org/cytoscape/session/events/SessionAboutToBeSavedEvent.java
   
core3/api/trunk/viewmodel-api/src/main/java/org/cytoscape/view/model/VisualProperty.java
   
core3/api/trunk/vizmap-gui-api/src/main/java/org/cytoscape/view/vizmap/gui/DefaultViewEditor.java
   
core3/api/trunk/vizmap-gui-api/src/main/java/org/cytoscape/view/vizmap/gui/editor/VisualPropertyEditor.java
   
core3/impl/trunk/table-import-impl/src/main/java/org/cytoscape/tableimport/internal/ui/ImportAttributeTableTask.java
Log:
javadoc updates and minor tweak to MapNetworkAttrTask

Modified: 
core3/api/trunk/core-task-api/src/main/java/org/cytoscape/task/MapNetworkAttrTask.java
===================================================================
--- 
core3/api/trunk/core-task-api/src/main/java/org/cytoscape/task/MapNetworkAttrTask.java
      2011-10-20 20:23:22 UTC (rev 27247)
+++ 
core3/api/trunk/core-task-api/src/main/java/org/cytoscape/task/MapNetworkAttrTask.java
      2011-10-20 20:24:30 UTC (rev 27248)
@@ -16,7 +16,11 @@
 import org.cytoscape.work.TaskMonitor;
 import org.cytoscape.work.Tunable;
 
-/** #ASKMIKE */
+/** 
+ * This is a simple {@link Task} that will take a loaded table and ask whether
+ * the columns in the new table should become virtual columns in the node or
+ * edge table of the current network, all networks, or no networks.
+ */
 public final class MapNetworkAttrTask extends AbstractTask {
        @Tunable(description="Map to current network only")
        public boolean currentNetworkOnly = true;
@@ -24,27 +28,26 @@
        private final Class<? extends CyTableEntry> type; // Must be node or 
edge!
        private final CyTable newGlobalTable;
        private final CyNetworkManager networkManager;
-       final private CyApplicationManager applicationManager;
-       private String key = null;
-       private String mappingKey = null;
-       
-       public MapNetworkAttrTask(final Class<? extends CyTableEntry> type, 
final CyTable newGlobalTable,
-                       String key, String mappingKey,
-                       final CyNetworkManager networkManager,
-                       final CyApplicationManager applicationManager)
-       {
-               this(type,newGlobalTable,networkManager, applicationManager);
-               this.key = key;
-               this.mappingKey = mappingKey;           
-       }
+       private final CyApplicationManager applicationManager;
+       private String mappingKey; 
 
-       
-       public MapNetworkAttrTask(final Class<? extends CyTableEntry> type, 
final CyTable newGlobalTable,
-                                 final CyNetworkManager networkManager,
-                                 final CyApplicationManager applicationManager)
+       /**
+        * Constructor.
+        * @param type The type of table to map to, either CyNode.class or 
CyEdge.class.
+        * @param newGlobalTable The table to be mapped. 
+        * @param mappingKey The column name in the existing table used to join 
with the primary key in the new table.
+        * @param networkManager The network manager used to access the list of 
all networks. 
+        * @param applicationManager The application manager used to access the 
current network. 
+        */
+       public MapNetworkAttrTask(final Class<? extends CyTableEntry> type, 
+                                 final CyTable newGlobalTable,
+                                 String mappingKey,
+                                 final CyNetworkManager networkManager,
+                                 final CyApplicationManager applicationManager)
        {
                this.type               = type;
                this.newGlobalTable     = newGlobalTable;
+               this.mappingKey         = mappingKey;           
                this.networkManager     = networkManager;
                this.applicationManager = applicationManager;
 
@@ -53,6 +56,29 @@
        }
 
        
+       /**
+        * Constructor. Will attempt to map existing tables based on the {@link 
CyTableEntry.NAME}
+        * column.
+        * @param type The type of table to map to, either CyNode.class or 
CyEdge.class.
+        * @param newGlobalTable The table to be mapped. 
+        * @param networkManager The network manager used to access the list of 
all networks. 
+        * @param applicationManager The application manager used to access the 
current network. 
+        */
+       public MapNetworkAttrTask(final Class<? extends CyTableEntry> type, 
+                                 final CyTable newGlobalTable,
+                                 final CyNetworkManager networkManager,
+                                 final CyApplicationManager applicationManager)
+       {
+               this(type,newGlobalTable,CyTableEntry.NAME,networkManager, 
applicationManager);
+       }
+
+
+       /**
+        * Executes the task.
+        * @param taskMonitor The TaskMonitor used to track the state of the 
task execution.
+        * @throws Exception All Exceptions throw will be caught and handled by 
the 
+        * {@link org.cytoscape.work.TaskManager} executing the task.
+        */
        public void run(final TaskMonitor taskMonitor) throws Exception {
                taskMonitor.setTitle("Mapping virtual columns");
 
@@ -84,15 +110,7 @@
                for (final CyTable targetTable : targetTables) {
                        if (cancelled)
                                return;
-                       if (mappingKey == null){
-                               // use primary key to do table join
-                               targetTable.addVirtualColumns(newGlobalTable, 
sourceTableJoinColumn,
-                                                     CyTableEntry.NAME, false);
-                       }
-                       else {
-                               // use alternative key
-                               targetTable.addVirtualColumns(newGlobalTable, 
sourceTableJoinColumn, mappingKey, false);                        
-                       }
+                       targetTable.addVirtualColumns(newGlobalTable, 
sourceTableJoinColumn, mappingKey, false);                        
                }
        }
-}
\ No newline at end of file
+}

Modified: 
core3/api/trunk/io-api/src/main/java/org/cytoscape/io/read/CyNetworkReader.java
===================================================================
--- 
core3/api/trunk/io-api/src/main/java/org/cytoscape/io/read/CyNetworkReader.java 
    2011-10-20 20:23:22 UTC (rev 27247)
+++ 
core3/api/trunk/io-api/src/main/java/org/cytoscape/io/read/CyNetworkReader.java 
    2011-10-20 20:24:30 UTC (rev 27248)
@@ -4,11 +4,12 @@
 import org.cytoscape.view.model.CyNetworkView;
 import org.cytoscape.work.Task;
 
-/** #ASKMIKE
+/** 
  * An extension of the Task interface that returns an array of
- * {@link org.cytoscape.view.model.CyNetworkView} objects as well as optional
- * {@link org.cytoscape.view.vizmap.VisualStyle} objects that are read as part
- * of the Task. Instances of this interface are created by
+ * {@link org.cytoscape.model.CyNetwork} objects that are read as part
+ * of the Task. An additional method provides an option for readers
+ * to create {@link CyNetworkView}s from the networks it has read as
+ * well. Instances of this interface are created by
  * InputStreamTaskFactory objects registered as OSGi services, which are in 
turn
  * processed by associated reader manager objects that distinguish
  * InputStreamTaskFactories based on the DataCategory associated with the
@@ -16,8 +17,17 @@
  */
 public interface CyNetworkReader extends Task {
 
+       /**
+        * Returns an array of networks read after executing the run() method 
of {@link Task}.
+        * @return an array of networks read after executing the run() method 
of {@link Task}.
+        */
        CyNetwork[] getCyNetworks();
 
+       /**
+        * A method to build a {@link CyNetworkView} from one of the networks 
just read.
+        * @param network A network just read by the task and part of the 
getCyNetworks() array.
+        * @return A {@link CyNetworkView} created by the reader for the 
network specified.
+        */
        CyNetworkView buildCyNetworkView(final CyNetwork network);
 
 }

Modified: 
core3/api/trunk/session-api/src/main/java/org/cytoscape/session/events/SessionAboutToBeSavedEvent.java
===================================================================
--- 
core3/api/trunk/session-api/src/main/java/org/cytoscape/session/events/SessionAboutToBeSavedEvent.java
      2011-10-20 20:23:22 UTC (rev 27247)
+++ 
core3/api/trunk/session-api/src/main/java/org/cytoscape/session/events/SessionAboutToBeSavedEvent.java
      2011-10-20 20:24:30 UTC (rev 27248)
@@ -88,7 +88,7 @@
        /**
         * A method that allows plugins to specify desktop-related data to be
         * stored in the session.
-        * @param desktop
+        * @param desktop Setting the {@link Desktop} object associated with 
this event.
         */
        public void setDesktop(Desktop desktop) {
                this.desktop = desktop;
@@ -107,8 +107,8 @@
        /**
         * A method that allows plugins to add Cytopanel-related information to 
be
         * stored in the session.
-        * @param cytopanel
-        * @throws Exception #ASKMIKE Shouldn't this be nullptrexcept?
+        * @param cytopanel The CytoPanel to be added.
+        * @throws NullPointerException If the cytopanel to be added is null.
         */
        public void addCytopanel(Cytopanel cytopanel) throws Exception {
                if (cytopanel == null)
@@ -116,5 +116,4 @@
                
                cytopanels.add(cytopanel);
        }
-       
 }

Modified: 
core3/api/trunk/viewmodel-api/src/main/java/org/cytoscape/view/model/VisualProperty.java
===================================================================
--- 
core3/api/trunk/viewmodel-api/src/main/java/org/cytoscape/view/model/VisualProperty.java
    2011-10-20 20:23:22 UTC (rev 27247)
+++ 
core3/api/trunk/viewmodel-api/src/main/java/org/cytoscape/view/model/VisualProperty.java
    2011-10-20 20:24:30 UTC (rev 27248)
@@ -54,8 +54,7 @@
 
        /**
         * The default value of this property.  This value is immutable.
-        *
-        * @return  DOCUMENT ME!
+        * @return  The default value of this property.  
         */
        T getDefault();
 
@@ -63,8 +62,7 @@
        /**
         * A short string used to identify this visual property and suitable for
         * serializing to XML and other text formats.
-        *
-        * @return  DOCUMENT ME!
+        * @return A short string used to identify this visual property and 
suitable for serialization.
         */
        String getIdString();
 
@@ -72,8 +70,7 @@
        /**
         * A short string suitable for presentation to humans.  Should not be 
used
         * for serialization.
-        *
-        * @return  DOCUMENT ME!
+        * @return  A short string suitable for presentation to humans.
         */
        String getDisplayName();
 
@@ -102,15 +99,14 @@
        /**
         * In some cases, default value from visual style is not suitable, such 
as x, y, z location of nodes.
         * If this flag is on, it will be ignored and it will be controlled by 
mapping only.
-        * #ASKMIKE
-        * @return
+        * @return true if the default value should be ignored (as with x,y,z 
locations) and false otherwise.
         */
        boolean shouldIgnoreDefault();
        
        
        /**
         * VisualProperty is always associated with a data type.  For example, 
EDGE_COLOR is associated with 
-        * {@link org.cytoscape.model.CyEdge} data object.  In that case, this 
returns Class<CyEdge>.  
+        * {@link org.cytoscape.model.CyEdge} data object.  In that case, this 
returns Class&lt;CyEdge&gt;.  
         * For now, return data types are CyNode, CyEdge, and CyNetwork.
         * 
         * @return target data type of this visual property.  CyNode, CyEdge, 
or CyNetwork.

Modified: 
core3/api/trunk/vizmap-gui-api/src/main/java/org/cytoscape/view/vizmap/gui/DefaultViewEditor.java
===================================================================
--- 
core3/api/trunk/vizmap-gui-api/src/main/java/org/cytoscape/view/vizmap/gui/DefaultViewEditor.java
   2011-10-20 20:23:22 UTC (rev 27247)
+++ 
core3/api/trunk/vizmap-gui-api/src/main/java/org/cytoscape/view/vizmap/gui/DefaultViewEditor.java
   2011-10-20 20:24:30 UTC (rev 27248)
@@ -7,22 +7,22 @@
 /**
  * Default View Editor is the component to display available visual properties
  * and its default view for given Visual Style.
- * 
  * This component will be provided as a service.
- * 
- * @author kono
- * @since Cytoscape 3.0
- * 
  */
 public interface DefaultViewEditor {
 
        /**
-        * For a given visual style name, returns a graphics of default.
+        * For a given visual style name, return a component containing
+        * a graphical view of the specified visual style.
         * 
         * @param vs The {@link VisualStyle} to get the default view of. 
-        * @return the default graphics Component. #ASKMIKE
+        * @return a component containing a graphical view of the specified 
visual style.
         */
-       public Component getDefaultView(VisualStyle vs);
-       
-       public void showEditor(Component parent);
-}
\ No newline at end of file
+       Component getDefaultView(VisualStyle vs);
+
+       /**
+        * Show the default view editor in the specified parent component.
+        * @param parent The component in which the default view should be 
shown.
+        */
+       void showEditor(Component parent);
+}

Modified: 
core3/api/trunk/vizmap-gui-api/src/main/java/org/cytoscape/view/vizmap/gui/editor/VisualPropertyEditor.java
===================================================================
--- 
core3/api/trunk/vizmap-gui-api/src/main/java/org/cytoscape/view/vizmap/gui/editor/VisualPropertyEditor.java
 2011-10-20 20:23:22 UTC (rev 27247)
+++ 
core3/api/trunk/vizmap-gui-api/src/main/java/org/cytoscape/view/vizmap/gui/editor/VisualPropertyEditor.java
 2011-10-20 20:24:30 UTC (rev 27248)
@@ -45,8 +45,7 @@
  * If plugin developer adds a custom visual property, they should implement 
this
  * in the presentation layer.
  * 
- * @param <T>
- *            Type of object managed in the Visual Prop.
+ * @param <T> Type of object managed in the Visual Prop.
  * 
  */
 public interface VisualPropertyEditor<T> {
@@ -59,7 +58,7 @@
 
        /**
         * Returns continuous mapping editor for the Visual Property. Return 
value
-        * is null is Continuous Editor does not exist. #ASKMIKE
+        * is null if Continuous Editor does not exist.
         * @return a continuous mapping editor for the Visual Property.
         */
        PropertyEditor getContinuousMappingEditor();
@@ -80,24 +79,26 @@
        T showVisualPropertyValueEditor();
 
        /**
-        * Provide Cell renderer for JTable or JList. Developers can implement
-        * custom cell renderers by using returned component.
+        * A custom cell renderer for Discrete table cells. 
         * 
-        * @return a TableCellRenderer for JTable or JList.
+        * @return a TableCellRenderer Discrete table cells. 
         */
        TableCellRenderer getDiscreteTableCellRenderer();
        
+       /**
+        * A custom cell renderer for Continuous table cells. 
+        * 
+        * @return a TableCellRenderer Continuous table cells. 
+        */
        TableCellRenderer getContinuousTableCellRenderer();
 
        /**
         * This is for default view editor.
         * 
-        * @param width
-        *            DOCUMENT ME!
-        * @param height
-        *            DOCUMENT ME!
+        * @param width The width of the desired Icon.
+        * @param height The height of the desired Icon.
         * 
-        * @return DOCUMENT ME!
+        * @return An icon of the specified width and height. 
         */
        Icon getDefaultIcon(int width, int height);
 }

Modified: 
core3/impl/trunk/table-import-impl/src/main/java/org/cytoscape/tableimport/internal/ui/ImportAttributeTableTask.java
===================================================================
--- 
core3/impl/trunk/table-import-impl/src/main/java/org/cytoscape/tableimport/internal/ui/ImportAttributeTableTask.java
        2011-10-20 20:23:22 UTC (rev 27247)
+++ 
core3/impl/trunk/table-import-impl/src/main/java/org/cytoscape/tableimport/internal/ui/ImportAttributeTableTask.java
        2011-10-20 20:24:30 UTC (rev 27248)
@@ -88,7 +88,7 @@
                                                        
CytoscapeServices.netMgr, CytoscapeServices.appMgr);
                                        insertTasksAfterCurrentTask(task);
                        } else { /* Case 2: use an attribute as the key. */
-                               final MapNetworkAttrTask task = new 
MapNetworkAttrTask(type, table, primaryKey, mappingKey,
+                               final MapNetworkAttrTask task = new 
MapNetworkAttrTask(type, table, mappingKey,
                                                CytoscapeServices.netMgr, 
CytoscapeServices.appMgr);
                                insertTasksAfterCurrentTask(task);
                        }

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