[kepler-code] r28840 - trunk/modules/workflow-scheduler-gui/src/org/kepler/workflowscheduler/gui/configurationwizard
tao at ecoinformatics.org
tao at ecoinformatics.org
Thu Oct 27 15:55:38 PDT 2011
Author: tao
Date: 2011-10-27 15:55:38 -0700 (Thu, 27 Oct 2011)
New Revision: 28840
Added:
trunk/modules/workflow-scheduler-gui/src/org/kepler/workflowscheduler/gui/configurationwizard/KnownWorkflowRunEngineTableModel.java
Log:
A table model to display the known workflow run engine list.
Added: trunk/modules/workflow-scheduler-gui/src/org/kepler/workflowscheduler/gui/configurationwizard/KnownWorkflowRunEngineTableModel.java
===================================================================
--- trunk/modules/workflow-scheduler-gui/src/org/kepler/workflowscheduler/gui/configurationwizard/KnownWorkflowRunEngineTableModel.java (rev 0)
+++ trunk/modules/workflow-scheduler-gui/src/org/kepler/workflowscheduler/gui/configurationwizard/KnownWorkflowRunEngineTableModel.java 2011-10-27 22:55:38 UTC (rev 28840)
@@ -0,0 +1,116 @@
+/**
+ * Copyright (c) 2010 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * '$Author: crawl $'
+ * '$Date: 2010-06-03 16:45:10 -0700 (Thu, 03 Jun 2010) $'
+ * '$Revision: 24730 $'
+ *
+ * Permission is hereby granted, without written agreement and without
+ * license or royalty fees, to use, copy, modify, and distribute this
+ * software and its documentation for any purpose, provided that the above
+ * copyright notice and the following two paragraphs appear in all copies
+ * of this software.
+ *
+ * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
+ * FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+ * THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+ * PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+ * CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
+ * ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ */
+package org.kepler.workflowscheduler.gui.configurationwizard;
+
+import javax.swing.table.AbstractTableModel;
+
+import org.kepler.objectmanager.repository.Repository;
+import org.kepler.workflowscheduler.gui.Schedule;
+import org.kepler.workflowscheduler.gui.WorkflowRunEngine;
+
+/**
+ * A table model represents the data model for display a known workflow run engines.
+ * @author tao
+ *
+ */
+public class KnownWorkflowRunEngineTableModel extends AbstractTableModel
+{
+
+ private static final String[] COLUMNNAMES = {"Name of the Known Workflow Run Engine" };
+ private static final int NAMECOL = 0;
+ private static final String UNKNOWN = "Unknown";
+ private WorkflowRunEngine[] engineList = null;
+
+
+ /**
+ * Constructor
+ * @param engineList
+ */
+ public KnownWorkflowRunEngineTableModel(WorkflowRunEngine[] engineList)
+ {
+ this.engineList = engineList;
+ }
+ /**
+ * Get the number of row
+ */
+ public int getRowCount()
+ {
+ if(engineList == null)
+ {
+ return 0;
+ }
+ else
+ {
+ return engineList.length;
+ }
+ }
+
+ /**
+ * Get the number of column
+ */
+ public int getColumnCount()
+ {
+ return COLUMNNAMES.length;
+ }
+
+ /**
+ * Get the value of the cell at row and column.
+ */
+ public Object getValueAt(int row, int column)
+ {
+ String returnValue = UNKNOWN;
+ if(engineList != null)
+ {
+ WorkflowRunEngine engine = engineList[row];
+ if(engine != null)
+ {
+
+ switch(column)
+ {
+ case NAMECOL:
+ returnValue = engine.getName();
+ break;
+ default:
+ break;
+
+ }
+ }
+ }
+ return returnValue;
+ }
+
+ /**
+ * Get the column name
+ */
+ public String getColumnName(int columnIndex)
+ {
+ return COLUMNNAMES[columnIndex];
+ }
+
+}
More information about the Kepler-cvs
mailing list