[jbpm-commits] JBoss JBPM SVN: r1943 - in jbpm3/trunk/modules/gwt-console/war/src/main: java/org/jboss/bpm/console/client/model and 4 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Wed Aug 20 12:55:52 EDT 2008
Author: heiko.braun at jboss.com
Date: 2008-08-20 12:55:52 -0400 (Wed, 20 Aug 2008)
New Revision: 1943
Added:
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MetricsDAO.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessInstancePerformance.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockHelpDAO.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockMetricsDAO.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockProcessDefinitionDAO.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockProcessInstanceDAO.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/LineChart.java
Removed:
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MockHelpDAO.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MockProcessDefinitionDAO.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MockProcessInstanceDAO.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/GChartExample.java
Modified:
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricEditor.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricView.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverview.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverviewEditor.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/DAOFactory.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinition.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionDAO.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/BarChart.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/UIConstants.java
jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/processSample.jpg
Log:
More metrics added
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricEditor.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricEditor.java 2008-08-20 14:10:41 UTC (rev 1942)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricEditor.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -22,8 +22,21 @@
package org.jboss.bpm.console.client.metric;
import org.jboss.bpm.console.client.widgets.EditorView;
+import org.jboss.bpm.console.client.widgets.UIConstants;
+import org.jboss.bpm.console.client.widgets.TeaserPanel;
+import org.jboss.bpm.console.client.widgets.HelpPanel;
import org.jboss.bpm.console.client.model.ProcessDefinition;
import org.jboss.bpm.console.client.ConsoleView;
+import org.jboss.bpm.console.client.process.ProcessInstanceEditor;
+import org.jboss.bpm.console.client.process.ProcessInstanceListEditor;
+import com.gwtext.client.widgets.layout.ColumnLayout;
+import com.gwtext.client.widgets.layout.ColumnLayoutData;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.Toolbar;
+import com.gwtext.client.widgets.ToolbarButton;
+import com.gwtext.client.widgets.Button;
+import com.gwtext.client.widgets.event.ButtonListenerAdapter;
+import com.gwtext.client.core.EventObject;
/**
* @author Heiko.Braun <heiko.braun at jboss.com>
@@ -33,17 +46,55 @@
private ProcessDefinition parent;
private ConsoleView view;
+ private Panel teaserPanel;
-
- public DefinitionMetricEditor(ConsoleView view, ProcessDefinition processDefinition)
+ public DefinitionMetricEditor(final ConsoleView view, final ProcessDefinition proc)
{
super();
this.view = view;
- this.parent = processDefinition;
+ this.parent = proc;
- this.setId(MetricOverviewEditor.ID+"."+processDefinition.getName());
+ this.setId(MetricOverviewEditor.ID+"."+proc.getName());
// -----------------------------------------------
+
+ this.setLayout( new ColumnLayout() );
+ this.setWidth(UIConstants.EDITOR_PANE_WIDTH);
+
+ // -----------------------------------------------
+
+ teaserPanel = new TeaserPanel();
+
+ HelpPanel instancePanel = new HelpPanel(UIConstants.TEASER_PANEL_WIDTH, 180, "Process instances");
+ instancePanel.setIconCls("bpm-process-icon");
+
+ instancePanel.setContent(
+ "You can manage running instances through the process management editor."
+ );
+
+ Toolbar bottomToolbar = new Toolbar();
+ bottomToolbar.addFill();
+ bottomToolbar.addButton(
+ new ToolbarButton("View instances", new ButtonListenerAdapter() {
+ public void onClick(Button button, EventObject e)
+ {
+ String editorId = ProcessInstanceEditor.ID+"."+proc.getName();
+
+ if(view.hasEditorView(editorId))
+ view.showEditor(editorId);
+ else
+ view.addEditorView( new ProcessInstanceListEditor(proc, view) );
+ }
+ })
+ );
+
+ instancePanel.setBottomToolbar(bottomToolbar);
+ teaserPanel.add(instancePanel);
+
+ // -----------------------------------------------
+
+ this.add( new DefinitionMetricView(view, proc), new ColumnLayoutData(0.7));
+ this.add( teaserPanel, new ColumnLayoutData(0.3));
}
public String getEditorId()
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricView.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricView.java 2008-08-20 14:10:41 UTC (rev 1942)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricView.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -22,9 +22,20 @@
package org.jboss.bpm.console.client.metric;
import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.form.FieldSet;
+import com.gwtext.client.widgets.form.FormPanel;
+import com.gwtext.client.widgets.form.TextField;
+import com.googlecode.gchart.client.GChart;
+import org.jboss.bpm.console.client.ConsoleView;
+import org.jboss.bpm.console.client.model.DAOFactory;
import org.jboss.bpm.console.client.model.ProcessDefinition;
-import org.jboss.bpm.console.client.ConsoleView;
+import org.jboss.bpm.console.client.model.ProcessInstancePerformance;
+import org.jboss.bpm.console.client.widgets.LineChart;
+import org.jboss.bpm.console.client.widgets.UIConstants;
+import java.util.Iterator;
+import java.util.Map;
+
/**
* @author Heiko.Braun <heiko.braun at jboss.com>
*/
@@ -33,7 +44,7 @@
private ProcessDefinition parent;
private ConsoleView view;
-
+
public DefinitionMetricView(ConsoleView view, ProcessDefinition parent)
{
super();
@@ -43,6 +54,108 @@
this.setHeader(false);
this.setBorder(false);
+ // ----------------------------------------
+
+ ProcessInstancePerformance perf =
+ DAOFactory.createMetricsDAO().getProcessInstancePerformance(parent.getId());
+
+ LineChart chart = new LineChart(
+ parent.getName() + " performance", 380, 260, perf.getInstanceMetrics(), "Instance", "t"
+ );
+
+ double[] fixture = deriveFixture(perf);
+
+ Panel chartPanel = new Panel();
+ chartPanel.setPaddings(10);
+ chartPanel.setHeader(false);
+ chartPanel.setBorder(false);
+ chartPanel.setWidth(UIConstants.EDITOR_PANE_WIDTH);
+ chartPanel.add(chart);
+
+ // ----------------------------------------
+
+ Panel panel = new Panel();
+ panel.setBorder(false);
+ panel.setFrame(false);
+ panel.setPaddings(10);
+
+ //create the form
+ FormPanel formPanel = new FormPanel();
+ formPanel.setHeader(false);
+ formPanel.setFrame(false);
+ formPanel.setPaddings(5, 5, 5, 0);
+ formPanel.setWidth(450);
+ formPanel.setLabelWidth(120);
+
+ //create first collapsible fieldset with checkbox
+ FieldSet fieldSet = new FieldSet();
+ fieldSet.setCheckboxToggle(false);
+ fieldSet.setFrame(true);
+ fieldSet.setTitle("Process metrics");
+ fieldSet.setCollapsed(false);
+
+ //add fields to the User FieldSet
+ TextField name = new TextField("Process Definition Name", "name", 210);
+ name.setAllowBlank(false);
+ name.setValue( parent.getName() );
+ fieldSet.add(name);
+
+ TextField execs = new TextField("Number of executions", "numexec", 210);
+ execs.setAllowBlank(false);
+ execs.setValue( perf.getInstanceMetrics().size() +"" );
+ fieldSet.add(execs);
+
+ TextField average = new TextField("Average execution time", "average", 210);
+ average.setValue(""+fixture[0]);
+ fieldSet.add(average);
+
+ TextField max = new TextField("Min execution time", "min", 210);
+ max.setValue(""+ fixture[1]);
+ fieldSet.add(max);
+
+ TextField min = new TextField("Max execution time", "max", 210);
+ min.setValue("" + fixture[2]);
+ fieldSet.add(min);
+ formPanel.add(fieldSet);
+
+ panel.add(formPanel);
+
+
+ // ----------------------------------------
+ this.add(chartPanel);
+ this.add(panel);
+
+ // gchart hack
+ chart.update();
+
}
+
+ private double[] deriveFixture(ProcessInstancePerformance perf)
+ {
+ double avg = -1;
+ double min= 0;
+ double max = -1;
+ double sum = -1;
+
+ Map metrics = perf.getInstanceMetrics();
+ Iterator keys = metrics.keySet().iterator();
+
+ while(keys.hasNext())
+ {
+ Long k = (Long)keys.next();
+ Double v = (Double)metrics.get(k);
+
+ if(v.longValue()>max) max = v.longValue();
+ else if(v.longValue()<=min) min = v.longValue();
+ else if(min==-1) min = v.longValue();
+
+ sum += v.longValue();
+
+ }
+
+ avg = Math.floor( sum/metrics.size());
+
+ return new double[] {avg, min, max};
+ }
}
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverview.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverview.java 2008-08-20 14:10:41 UTC (rev 1942)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverview.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -21,22 +21,23 @@
*/
package org.jboss.bpm.console.client.metric;
+import com.gwtext.client.core.EventObject;
import com.gwtext.client.data.Record;
import com.gwtext.client.data.SimpleStore;
import com.gwtext.client.data.Store;
-import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.Button;
import com.gwtext.client.widgets.MessageBox;
+import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-import com.gwtext.client.widgets.form.*;
+import com.gwtext.client.widgets.form.ComboBox;
+import com.gwtext.client.widgets.form.FormPanel;
import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
-import com.gwtext.client.core.EventObject;
+import org.jboss.bpm.console.client.ConsoleView;
import org.jboss.bpm.console.client.model.DAOFactory;
import org.jboss.bpm.console.client.model.ProcessDefinition;
import org.jboss.bpm.console.client.model.ProcessDefinitionDAO;
import org.jboss.bpm.console.client.widgets.BarChart;
import org.jboss.bpm.console.client.widgets.UIConstants;
-import org.jboss.bpm.console.client.ConsoleView;
import java.util.HashMap;
import java.util.Iterator;
@@ -73,11 +74,10 @@
barValues.put("Expense report review", new Double(10.00));
BarChart chart = new BarChart(360,250, "Most used processes", "Process Name", barValues );
- chart.setLegendVisible(false);
- chart.setFontFamily("sans-serif");
+ chart.setLegendVisible(false);
- Panel chartPanel = new Panel("Most active process definitions");
- chartPanel.setPaddings(15);
+ Panel chartPanel = new Panel();
+ chartPanel.setPaddings(10);
chartPanel.setHeader(false);
chartPanel.setBorder(false);
chartPanel.setWidth(UIConstants.EDITOR_PANE_WIDTH);
@@ -91,11 +91,11 @@
final FormPanel formPanel = new FormPanel();
formPanel.setFrame(true);
- formPanel.setTitle("Simple Form");
+ formPanel.setTitle("View process details");
- formPanel.setWidth(450);
+ formPanel.setWidth(UIConstants.MAIN_EDITOR_PANEL_WIDTH);
formPanel.setLabelWidth(75);
- //formPanel.setUrl("save-form.php");
+ //formPanel.setUrl("save-form.php");
//create a Store using local array data
final Store store = new SimpleStore(
@@ -115,7 +115,7 @@
cb.setLoadingText("Searching...");
cb.setTypeAhead(true);
cb.setSelectOnFocus(true);
- cb.setWidth(200);
+ cb.setWidth(300);
cb.setHideTrigger(false);
@@ -159,8 +159,8 @@
Button button = new Button("View details", listener);
formPanel.add(cb);
- formPanel.add(button);
-
+ formPanel.addButton(button);
+
panel.add(formPanel);
this.add(chartPanel);
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverviewEditor.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverviewEditor.java 2008-08-20 14:10:41 UTC (rev 1942)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverviewEditor.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -56,8 +56,8 @@
// -------------------------------------
- HelpPanel help = new HelpPanel(200, 180, "Process workload explained");
- help.setContent( DAOFactory.getHelpDAO().getHelpByReference(HelpDAO.REF_PROCESS_METRIC));
+ HelpPanel help = new HelpPanel(UIConstants.TEASER_PANEL_WIDTH, 180, "Process workload explained");
+ help.setContent( DAOFactory.createHelpDAO().getHelpByReference(HelpDAO.REF_PROCESS_METRIC));
// -------------------------------------
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/DAOFactory.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/DAOFactory.java 2008-08-20 14:10:41 UTC (rev 1942)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/DAOFactory.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -21,6 +21,11 @@
*/
package org.jboss.bpm.console.client.model;
+import org.jboss.bpm.console.client.model.internal.MockHelpDAO;
+import org.jboss.bpm.console.client.model.internal.MockProcessDefinitionDAO;
+import org.jboss.bpm.console.client.model.internal.MockMetricsDAO;
+import org.jboss.bpm.console.client.model.internal.MockProcessInstanceDAO;
+
/**
* @author Heiko.Braun <heiko.braun at jboss.com>
*/
@@ -36,8 +41,13 @@
return new MockProcessInstanceDAO();
}
- public static HelpDAO getHelpDAO()
+ public static HelpDAO createHelpDAO()
{
return new MockHelpDAO();
}
+
+ public static MetricsDAO createMetricsDAO()
+ {
+ return new MockMetricsDAO();
+ }
}
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MetricsDAO.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MetricsDAO.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MetricsDAO.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software 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. 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public interface MetricsDAO
+{
+
+ ProcessInstancePerformance getProcessInstancePerformance(long processId);
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MetricsDAO.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MockHelpDAO.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MockHelpDAO.java 2008-08-20 14:10:41 UTC (rev 1942)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MockHelpDAO.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -1,57 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This 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 (at your option) any later version.
- *
- * This software 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. 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.model;
-
-import java.util.Map;
-import java.util.HashMap;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public class MockHelpDAO implements HelpDAO
-{
-
- private static Map ref2text = new HashMap();
-
- static {
- ref2text.put(
- new Integer(HelpDAO.REF_PROCESS_DEFINITIONS),
- "Process definitions are the base classs for any process instance. " +
- "They act as an execution template for BPM engine"
- );
-
- ref2text.put(
- new Integer(HelpDAO.REF_PROCESS_METRIC),
- "The chart on the left displays the most used process definitions. " +
- "Usage is defined by the number of instances that have been created for a particular definition."
- );
- }
-
- public String getHelpByReference(int ref)
- {
- String text = (String)ref2text.get(new Integer(ref));
- if(text!=null)
- return text;
- else
- return "No help entry for ref: " + ref;
- }
-}
Deleted: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MockProcessDefinitionDAO.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MockProcessDefinitionDAO.java 2008-08-20 14:10:41 UTC (rev 1942)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MockProcessDefinitionDAO.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This 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 (at your option) any later version.
- *
- * This software 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. 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.model;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public class MockProcessDefinitionDAO implements ProcessDefinitionDAO
-{
- public final static List defs = new ArrayList();
- static
- {
- defs.add( new ProcessDefinition(1, "OrderProcess", "1"));
- defs.add( new ProcessDefinition(2, "VacationManagement", "1"));
- defs.add( new ProcessDefinition(3, "New Employee walkthrough", "1"));
- defs.add( new ProcessDefinition(4, "Source code review", "2"));
- defs.add( new ProcessDefinition(5, "Loan application", "1"));
- defs.add( new ProcessDefinition(6, "Expense report review", "4"));
- defs.add( new ProcessDefinition(7, "Expense claim", "4"));
- defs.add( new ProcessDefinition(8, "Credit approval", "4"));
-
- }
-
- public List getAllProcessDefinitions()
- {
- return defs;
- }
-
- public List getMostActiveProcesses()
- {
- return defs;
- }
-}
Deleted: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MockProcessInstanceDAO.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MockProcessInstanceDAO.java 2008-08-20 14:10:41 UTC (rev 1942)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MockProcessInstanceDAO.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This 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 (at your option) any later version.
- *
- * This software 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. 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.model;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public class MockProcessInstanceDAO implements ProcessInstanceDAO
-{
-
- final static List instances = new ArrayList();
- static
- {
- instances.add( new ProcessInstance(2, -1, "Running", new Date(), null));
- instances.add( new ProcessInstance(3, -1, "Stopped", new Date(System.currentTimeMillis()-(1000*60*120)), new Date(System.currentTimeMillis()-(1000*60*12))));
- instances.add( new ProcessInstance(4, -1, "Ended", new Date(System.currentTimeMillis()-(1000*60*60)), new Date(System.currentTimeMillis()-(1000*60*24))));
- instances.add( new ProcessInstance(5, -1, "Suspended", new Date(System.currentTimeMillis()-(1000*60*90)), new Date(System.currentTimeMillis()-(1000*60*17))));
- instances.add( new ProcessInstance(6, -1, "Running", new Date(), null));
- instances.add( new ProcessInstance(7, -1, "Running", new Date(), null));
- }
-
-
- public List getInstanceByProcessDefinitionId(long id)
- {
- return instances;
- }
-}
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinition.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinition.java 2008-08-20 14:10:41 UTC (rev 1942)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinition.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -30,7 +30,6 @@
private String name;
private String version;
-
public ProcessDefinition()
{
}
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionDAO.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionDAO.java 2008-08-20 14:10:41 UTC (rev 1942)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionDAO.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -29,4 +29,6 @@
public interface ProcessDefinitionDAO
{
List getAllProcessDefinitions();
+
+ ProcessDefinition getProcessDefinitionById(long id);
}
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessInstancePerformance.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessInstancePerformance.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessInstancePerformance.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software 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. 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model;
+
+import java.util.Map;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public final class ProcessInstancePerformance
+{
+ private long id;
+ private String processName;
+
+ Map instanceMetrics; // Map<instanceId,averageExectime>
+
+ public ProcessInstancePerformance(long processId, String processName, Map instanceMetrics)
+ {
+ this.id = processId;
+ this.processName = processName;
+ this.instanceMetrics = instanceMetrics;
+ }
+
+
+ public long getId()
+ {
+ return id;
+ }
+
+ public String getProcessName()
+ {
+ return processName;
+ }
+
+ public Map getInstanceMetrics()
+ {
+ return instanceMetrics;
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessInstancePerformance.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockHelpDAO.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockHelpDAO.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockHelpDAO.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software 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. 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model.internal;
+
+import org.jboss.bpm.console.client.model.HelpDAO;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class MockHelpDAO implements HelpDAO
+{
+
+ private static Map ref2text = new HashMap();
+
+ static {
+ ref2text.put(
+ new Integer(HelpDAO.REF_PROCESS_DEFINITIONS),
+ "Process definitions are the base classs for any process instance. " +
+ "They act as an execution template for BPM engine"
+ );
+
+ ref2text.put(
+ new Integer(HelpDAO.REF_PROCESS_METRIC),
+ "The chart on the left displays the most used process definitions. " +
+ "Usage is defined by the number of instances that have been created for a particular definition."
+ );
+ }
+
+ public String getHelpByReference(int ref)
+ {
+ String text = (String)ref2text.get(new Integer(ref));
+ if(text!=null)
+ return text;
+ else
+ return "No help entry for ref: " + ref;
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockHelpDAO.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockMetricsDAO.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockMetricsDAO.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockMetricsDAO.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software 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. 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model.internal;
+
+import org.jboss.bpm.console.client.model.*;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class MockMetricsDAO implements MetricsDAO
+{
+
+ public final static double MAX_EXEC_TIME = 3600.00;
+
+ public ProcessInstancePerformance getProcessInstancePerformance(long processId)
+ {
+ ProcessDefinition pd = DAOFactory.createProcessDefinitionDAO().getProcessDefinitionById(processId);
+
+ ProcessInstancePerformance performance = new ProcessInstancePerformance(
+ pd.getId(), pd.getName(), generateInstanceMetrics(processId)
+ );
+
+ return performance;
+ }
+
+ private Map generateInstanceMetrics(long processId)
+ {
+ List instances = DAOFactory.createProcessInstanceDAO().getInstanceByProcessDefinitionId(processId);
+
+ Map metrics = new HashMap();
+ for(int i=0; i<instances.size(); i++)
+ {
+ ProcessInstance pi = (ProcessInstance)instances.get(i);
+ metrics.put( new Long(pi.getId()) , new Double(Math.random()* MAX_EXEC_TIME) );
+ }
+
+ return metrics;
+ }
+
+
+
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockMetricsDAO.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockProcessDefinitionDAO.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockProcessDefinitionDAO.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockProcessDefinitionDAO.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software 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. 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model.internal;
+
+import org.jboss.bpm.console.client.model.ProcessDefinitionDAO;
+import org.jboss.bpm.console.client.model.ProcessDefinition;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class MockProcessDefinitionDAO implements ProcessDefinitionDAO
+{
+ public final static List defs = new ArrayList();
+ static
+ {
+ defs.add( new ProcessDefinition(1, "OrderProcess", "1"));
+ defs.add( new ProcessDefinition(2, "VacationManagement", "1"));
+ defs.add( new ProcessDefinition(3, "New Employee walkthrough", "1"));
+ defs.add( new ProcessDefinition(4, "Source code review", "2"));
+ defs.add( new ProcessDefinition(5, "Loan application", "1"));
+ defs.add( new ProcessDefinition(6, "Expense report review", "4"));
+ defs.add( new ProcessDefinition(7, "Expense claim", "4"));
+ defs.add( new ProcessDefinition(8, "Credit approval", "4"));
+
+ }
+
+ public List getAllProcessDefinitions()
+ {
+ return defs;
+ }
+
+ public ProcessDefinition getProcessDefinitionById(long id)
+ {
+ ProcessDefinition result = null;
+ for(int i=0; i<defs.size(); i++)
+ {
+ ProcessDefinition pd = (ProcessDefinition)defs.get(i);
+ if(pd.getId() == id)
+ {
+ result = pd;
+ break;
+ }
+ }
+ return result;
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockProcessDefinitionDAO.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockProcessInstanceDAO.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockProcessInstanceDAO.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockProcessInstanceDAO.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software 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. 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model.internal;
+
+import org.jboss.bpm.console.client.model.ProcessInstanceDAO;
+import org.jboss.bpm.console.client.model.ProcessInstance;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class MockProcessInstanceDAO implements ProcessInstanceDAO
+{
+
+ final static List instances = new ArrayList();
+ static
+ {
+ instances.add( new ProcessInstance(2, -1, "Running", new Date(), null));
+ instances.add( new ProcessInstance(3, -1, "Stopped", new Date(System.currentTimeMillis()-(1000*60*120)), new Date(System.currentTimeMillis()-(1000*60*12))));
+ instances.add( new ProcessInstance(4, -1, "Ended", new Date(System.currentTimeMillis()-(1000*60*60)), new Date(System.currentTimeMillis()-(1000*60*24))));
+ instances.add( new ProcessInstance(5, -1, "Suspended", new Date(System.currentTimeMillis()-(1000*60*90)), new Date(System.currentTimeMillis()-(1000*60*17))));
+ instances.add( new ProcessInstance(6, -1, "Running", new Date(), null));
+ instances.add( new ProcessInstance(7, -1, "Running", new Date(), null));
+ }
+
+
+ public List getInstanceByProcessDefinitionId(long id)
+ {
+ return instances;
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockProcessInstanceDAO.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/GChartExample.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/GChartExample.java 2008-08-20 14:10:41 UTC (rev 1942)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/GChartExample.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -1,109 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This 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 (at your option) any later version.
- *
- * This software 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. 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.process;
-
-import com.google.gwt.user.client.ui.Widget;
-import com.google.gwt.user.client.ui.ClickListener;
-import com.google.gwt.user.client.ui.Button;
-import com.googlecode.gchart.client.GChart;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public class GChartExample extends GChart
-{
- final String[] groupLabels = { "O Seven", "Owe Ate", "Oh Nein!"};
-
- final String[] barLabels = { "Q1", "Q2", "Q3", "Q4"};
-
- final String[] barColors = { "red", "blue", "green", "silver"};
-
- final int MAX_REVENUE = 1000;
- final int WIDTH = 300;
- final int HEIGHT = 200;
-
- //Button updateButton = new Button( "Update");
-
- public GChartExample() {
- setChartSize(WIDTH, HEIGHT);
- setChartTitle("<b><big><big>" + "Simulated Quarterly Revenues" +"</big></big><br> </b>");
-
- /*updateButton.addClickListener(
- new ClickListener()
- {
- public void onClick(Widget w) {
- for (int iCurve=0; iCurve < getNCurves(); iCurve++)
- {
- for (int iPoint=0; iPoint < getCurve(iCurve).getNPoints(); iPoint++)
- {
- getCurve(iCurve).getPoint(iPoint).setY( Math.random()*MAX_REVENUE);
- }
- }
- update();
- updateButton.setFocus(true);
- }
- }
- );
-
- setChartFootnotes(updateButton);*/
-
- for (int iCurve=0; iCurve < barLabels.length; iCurve++)
- {
- addCurve(); // one curve per quarter
- getCurve().getSymbol().setSymbolType(SymbolType.VBAR_SOUTHWEST);
- getCurve().getSymbol().setBackgroundColor(barColors[iCurve]);
- getCurve().setLegendLabel(barLabels[iCurve]);
- getCurve().getSymbol().setHovertextTemplate(
- barLabels[iCurve] + " revenue=${y}");
- getCurve().getSymbol().setModelWidth(1.02);
- getCurve().getSymbol().setBorderColor("black");
- getCurve().getSymbol().setBorderWidth(1);
- for (int jGroup=0; jGroup < groupLabels.length; jGroup++) {
- // the '+1' creates a bar-sized gap between groups
- getCurve().addPoint(1+iCurve+jGroup*(barLabels.length+1),
- Math.random()*MAX_REVENUE);
- getCurve().getPoint().setAnnotationText(barLabels[iCurve]);
- getCurve().getPoint().setAnnotationLocation(
- AnnotationLocation.NORTH);
- }
- }
-
- for (int i = 0; i < groupLabels.length; i++)
- {
- // formula centers tick-label horizontally on each group
- getXAxis().addTick(
- barLabels.length/2. + i*(barLabels.length+1),
- groupLabels[i]
- );
- getXAxis().setTickLabelFontSize(20);
- }
- getXAxis().setTickLength(6); // small tick-like gap...
- getXAxis().setTickThickness(0); // but with invisible ticks
- getXAxis().setAxisMin(0); // keeps first bar on chart
-
- getYAxis().setAxisMin(0); // Based on sim revenue range
- getYAxis().setAxisMax(MAX_REVENUE); // of 0 to MAX_REVENUE.
- getYAxis().setTickCount(11);
- getYAxis().setHasGridlines(true);
- getYAxis().setTickLabelFormat("$#,###");
- }
-}
\ No newline at end of file
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java 2008-08-20 14:10:41 UTC (rev 1942)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -24,7 +24,6 @@
import com.gwtext.client.widgets.layout.ColumnLayout;
import com.gwtext.client.widgets.layout.ColumnLayoutData;
import com.gwtext.client.widgets.layout.VerticalLayout;
-import com.gwtext.client.widgets.layout.HorizontalLayout;
import com.gwtext.client.widgets.*;
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
import com.gwtext.client.core.EventObject;
@@ -120,8 +119,8 @@
// ----------------------------------
- HelpPanel help = new HelpPanel(200, 180, "About process definitions");
- help.setContent( DAOFactory.getHelpDAO().getHelpByReference(HelpDAO.REF_PROCESS_DEFINITIONS));
+ HelpPanel help = new HelpPanel(UIConstants.TEASER_PANEL_WIDTH, 180, "About process definitions");
+ help.setContent( DAOFactory.createHelpDAO().getHelpByReference(HelpDAO.REF_PROCESS_DEFINITIONS));
// ----------------------------------
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/BarChart.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/BarChart.java 2008-08-20 14:10:41 UTC (rev 1942)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/BarChart.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -44,6 +44,7 @@
setChartSize(width, height);
setChartTitle(title);
+ setFontFamily("sans-serif");
String[] labels = (String[])barValues.keySet().toArray( new String[]{} );
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/LineChart.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/LineChart.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/LineChart.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software 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. 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.widgets;
+
+import com.googlecode.gchart.client.GChart;
+
+import java.util.Map;
+import java.util.Set;
+import java.util.Iterator;
+
+import org.jboss.bpm.console.client.model.internal.MockMetricsDAO;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class LineChart extends GChart
+{
+ /**
+ *
+ * @param metrics Long->Double
+ */
+ public LineChart(String title, int width, int height, Map metrics, String xLabel, String yLabel)
+ {
+ setChartTitle(title);
+ setChartSize(width, height);
+ setFontFamily("sans-serif");
+ addCurve();
+
+ // 2 pixel square connecting dots, spaced 5 pixels apart:
+ getCurve().getSymbol().setFillThickness(2);
+ getCurve().getSymbol().setFillSpacing(5);
+ getCurve().getSymbol().setBackgroundColor("#66CC66");
+ getCurve().getSymbol().setBorderColor("#66CC66");
+
+ Iterator keys = metrics.keySet().iterator();
+ int i=0;
+ while(keys.hasNext())
+ {
+ Long k = (Long)keys.next();
+ Double v = (Double)metrics.get(k);
+ getCurve().addPoint(i, v.doubleValue() );
+
+ getCurve().getPoint().setAnnotationVisible(true);
+ getCurve().getPoint().setAnnotationText("ID " + k);
+ getCurve().getPoint().setAnnotationLocation( GChart.AnnotationLocation.NORTH);
+ i++;
+ }
+
+
+ getXAxis().setTickCount(metrics.size());
+ getXAxis().setTickLength(6); // small tick-like gap...
+ getXAxis().setTickThickness(0); // but with invisible ticks
+ getXAxis().setAxisMin(0); // keeps first bar on chart
+
+ getXAxis().setAxisLabel(xLabel);
+ getYAxis().setAxisLabel(yLabel);
+ getYAxis().setAxisMin(0); // Based on sim revenue range
+ getYAxis().setAxisMax(MockMetricsDAO.MAX_EXEC_TIME); // TODO: Fixme
+ getYAxis().setTickCount(11);
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/LineChart.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/UIConstants.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/UIConstants.java 2008-08-20 14:10:41 UTC (rev 1942)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/UIConstants.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -30,4 +30,6 @@
public static final int MAIN_MENU_MIN = 175;
public static final int MAIN_MENU_MAX = 400;
public static final int EDITOR_PANE_WIDTH = 680;
+ public static final int TEASER_PANEL_WIDTH = 200;
+ public static final int MAIN_EDITOR_PANEL_WIDTH = 450;
}
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/processSample.jpg
===================================================================
(Binary files differ)
More information about the jbpm-commits
mailing list