[jbpm-commits] JBoss JBPM SVN: r1931 - in jbpm3/trunk/modules/gwt-console/war/src/main: java/org/jboss/bpm/console/client/process and 4 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Tue Aug 19 10:57:32 EDT 2008
Author: heiko.braun at jboss.com
Date: 2008-08-19 10:57:31 -0400 (Tue, 19 Aug 2008)
New Revision: 1931
Added:
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/HelpPanel.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/PieChart.java
jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/icons/
jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/icons/05.png
jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/icons/05_1.png
jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/icons/14.png
jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/icons/29.png
jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/icons/31.png
jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/icons/36.png
jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/icons/41.png
Modified:
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/EditorPanel.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/MainMenu.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/process/ProcessInstanceEditor.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/EditorView.java
jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/console.css
Log:
Add metric menu and teaser. Update icons
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/EditorPanel.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/EditorPanel.java 2008-08-19 11:04:43 UTC (rev 1930)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/EditorPanel.java 2008-08-19 14:57:31 UTC (rev 1931)
@@ -54,6 +54,7 @@
tab.setBorder(false);
tab.setFrame(false);
tab.setHideBorders(true);
+ tab.setIconCls(editorView.getIconCSS());
this.add(tab);
return tab;
}
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/MainMenu.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/MainMenu.java 2008-08-19 11:04:43 UTC (rev 1930)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/MainMenu.java 2008-08-19 14:57:31 UTC (rev 1931)
@@ -22,6 +22,8 @@
package org.jboss.bpm.console.client;
import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.tree.TreePanel;
+import com.gwtext.client.widgets.tree.TreeNode;
import com.gwtext.client.widgets.layout.AccordionLayout;
/**
@@ -44,19 +46,58 @@
this.setLayout(accordion);
Panel navPanel = new Panel();
- navPanel.setHtml("<p>Hi. I'm the west panel.</p>");
- navPanel.setTitle("Navigation");
+ navPanel.setTitle("Process Management");
navPanel.setBorder(false);
- navPanel.setIconCls("forlder-icon");
+ navPanel.setHideBorders(true);
+ navPanel.setIconCls("bpm-process-icon");
+ navPanel.add(new ProcessTree());
this.add(navPanel);
+ Panel taskPanel = new Panel();
+ taskPanel.setHtml("<p>Task Management</p>");
+ taskPanel.setTitle("Task Management");
+ taskPanel.setBorder(false);
+ taskPanel.setIconCls("bpm-task-icon");
+ this.add(taskPanel);
+
+ Panel metricPanel = new Panel();
+ metricPanel.setHtml("<p>Metrics and Stats</p>");
+ metricPanel.setTitle("Metrics and Stats");
+ metricPanel.setBorder(false);
+ metricPanel.setIconCls("bpm-metric-icon");
+ this.add(metricPanel);
+
Panel settingsPanel = new Panel();
- settingsPanel.setHtml("<p>Some settings in here.</p>");
+ settingsPanel.setHtml("<p>Settings</p>");
settingsPanel.setTitle("Settings");
settingsPanel.setBorder(false);
- settingsPanel.setIconCls("settings-icon");
+ settingsPanel.setIconCls("bpm-settings-icon");
this.add(settingsPanel);
}
+ class ProcessTree extends TreePanel
+ {
+ public ProcessTree() {
+
+ TreeNode root = new TreeNode("Process Definitions");
+
+ TreeNode view = new TreeNode("View definitions");
+ view.setExpanded(true);
+ TreeNode upload = new TreeNode("Upload new definitions");
+ upload.setExpanded(true);
+
+ root.appendChild(view);
+ root.appendChild(upload);
+
+ setRootVisible(true);
+
+ /*setTitle("Company");
+ setWidth(200);
+ setHeight(400);*/
+ setRootNode(root);
+ root.setExpanded(true);
+ }
+ }
+
}
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-19 11:04:43 UTC (rev 1930)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java 2008-08-19 14:57:31 UTC (rev 1931)
@@ -22,14 +22,26 @@
package org.jboss.bpm.console.client.process;
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;
+import com.google.gwt.user.client.ui.HTML;
import org.jboss.bpm.console.client.ConsoleView;
import org.jboss.bpm.console.client.widgets.EditorView;
+import org.jboss.bpm.console.client.widgets.PieChart;
+import org.jboss.bpm.console.client.widgets.HelpPanel;
+import java.util.Map;
+import java.util.HashMap;
+
/**
* @author Heiko.Braun <heiko.braun at jboss.com>
*/
public class ProcessDefinitionListEditor extends EditorView
-{
+{
public final static String ID = "org.jboss.bpm.process.ProcessList";
private ProcessDefinitionList processDefinitions;
@@ -40,13 +52,14 @@
{
super();
this.setId(ID);
-
+
this.view = view;
+ this.setLayout( new ColumnLayout() );
+ this.setWidth(680);
+
// ----------------------------------
- //this.setLayout( new ColumnLayout() );
-
// stats
/*Map barValues = new HashMap();
@@ -72,17 +85,73 @@
processDefinitions = new ProcessDefinitionList("Process Definitions", view);
// ----------------------------------
+ // TODO: introduce abstractions and integrate with DAO
+ Map chartValues = new HashMap();
+ chartValues.put("1", new Double(0.65));
+ chartValues.put("2", new Double(0.20));
+ chartValues.put("3", new Double(0.10));
+ chartValues.put("4", new Double(0.5));
- /*PaddedPanel rightPanel = new PaddedPanel(processDefinitions, 5, 5, 0, 5);
- PaddedPanel leftPanel = new PaddedPanel( new Panel("Metrics", 200, 150) , 5, 5, 0, 5);
+ PieChart pieChart = new PieChart(180, 120, "", chartValues);
+ Panel metricPanel = new Panel("Most active process", 200, 300);
+ metricPanel.setLayout(new VerticalLayout());
+ metricPanel.setIconCls("bpm-metric-icon");
+ metricPanel.add(pieChart);
+ HTML legend = new HTML(
+ "<ol class='piechart-types'>" +
+ "<li>1. Order Process" +
+ "<li>2. Loan application" +
+ "<li>3. Expense claim" +
+ "<li>4. Credit approval" +
+ "</ol>"
+ );
+ Panel legendPanel = new Panel();
+ legendPanel.setBorder(false);
+ legendPanel.setFrame(false);
+ legendPanel.setHideBorders(true);
+ legendPanel.setPaddings(5);
+ legendPanel.add(legend);
+ metricPanel.add(legendPanel);
+
+ // toolbar
+
+ Toolbar bottomToolbar = new Toolbar();
+ bottomToolbar.addFill();
+ bottomToolbar.addButton(
+ new ToolbarButton("More metrics", new ButtonListenerAdapter() {
+ public void onClick(Button button, EventObject e)
+ {
+ // TODO: display metric tab
+ }
+ })
+ );
+
+ metricPanel.setBottomToolbar(bottomToolbar);
+
// ----------------------------------
- this.add(rightPanel, new ColumnLayoutData(0.7) );
+ HelpPanel help = new HelpPanel(200, 180, "About process definitions");
+ help.setContent("Process definitions are the base classs for any process instance. " +
+ "They act as an execution template for BPM engine");
+
+
+ Panel leftPanel = new Panel();
+ leftPanel.setPaddings(10,0,0,5);
+ leftPanel.setLayout(new VerticalLayout(10));
+ leftPanel.setHideBorders(true);
+ leftPanel.setFrame(false);
+ leftPanel.setBorder(false);
+
+ leftPanel.add(help);
+ leftPanel.add(metricPanel);
+
+ this.add(processDefinitions, new ColumnLayoutData(0.7) );
this.add(leftPanel , new ColumnLayoutData(0.3) );
- */
- this.add(processDefinitions);
+ // init gchart
+ pieChart.update();
+
}
@@ -95,4 +164,9 @@
{
return "Processes";
}
+
+ public String getIconCSS()
+ {
+ return "bpm-process-icon";
+ }
}
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceEditor.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceEditor.java 2008-08-19 11:04:43 UTC (rev 1930)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceEditor.java 2008-08-19 14:57:31 UTC (rev 1931)
@@ -84,4 +84,10 @@
{
return "#"+processInstance.getId()+" ("+processDefinition.getName()+")";
}
+
+
+ public String getIconCSS()
+ {
+ return "bpm-instance-icon";
+ }
}
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java 2008-08-19 11:04:43 UTC (rev 1930)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java 2008-08-19 14:57:31 UTC (rev 1931)
@@ -59,4 +59,10 @@
{
return parent.getName();
}
+
+
+ public String getIconCSS()
+ {
+ return "bpm-instance-icon";
+ }
}
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/EditorView.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/EditorView.java 2008-08-19 11:04:43 UTC (rev 1930)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/EditorView.java 2008-08-19 14:57:31 UTC (rev 1931)
@@ -36,4 +36,5 @@
public abstract String getEditorId();
public abstract String getTitle();
+ public abstract String getIconCSS();
}
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/HelpPanel.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/HelpPanel.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/HelpPanel.java 2008-08-19 14:57:31 UTC (rev 1931)
@@ -0,0 +1,60 @@
+/*
+ * 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.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.layout.FitLayout;
+import com.google.gwt.user.client.ui.HTML;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class HelpPanel extends Panel
+{
+ private int width, height;
+
+ public HelpPanel(int width, int height, String title)
+ {
+ super();
+ setTitle(title);
+ setWidth(width);
+ setHeight(height);
+ setIconCls("bpm-help-icon");
+
+ this.width = width;
+ this.height = height;
+ }
+
+ public void setContent(String content)
+ {
+ Panel wrapper = new Panel();
+ wrapper.setBaseCls("bpm-help-panel");
+ wrapper.setFrame(false);
+ wrapper.setHideBorders(true);
+ wrapper.setPaddings(5);
+ wrapper.add(new HTML(content));
+ wrapper.setLayout(new FitLayout());
+ wrapper.setWidth(width);
+ wrapper.setHeight(height);
+ this.add(wrapper);
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/HelpPanel.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/widgets/PieChart.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/PieChart.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/PieChart.java 2008-08-19 14:57:31 UTC (rev 1931)
@@ -0,0 +1,83 @@
+/*
+ * 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;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class PieChart extends GChart
+{
+ public PieChart(int width, int height, String title, Map typeValues)
+ {
+ String[] pieColors = {"green", "red", "maroon", "yellow"};
+
+ this.setChartSize(width, height);
+ setChartTitle(title);
+ this.setLegendVisible(false);
+
+ getXAxis().setAxisVisible(false);
+ getYAxis().setAxisVisible(false);
+ getXAxis().setAxisMin(0);
+ getXAxis().setAxisMax(10);
+ getXAxis().setTickCount(0);
+ getYAxis().setAxisMin(0);
+ getYAxis().setAxisMax(10);
+ getYAxis().setTickCount(0);
+
+ // --------------------
+ // this line orients the center of the first slice (apple) due east
+ String[] pieTypes = (String[])typeValues.keySet().toArray(new String[] {});
+
+ double[] pieValues = new double[pieTypes.length];
+ for(int i=0; i<pieTypes.length; i++)
+ {
+ pieValues[i] = ((Double)typeValues.get(pieTypes[i])).doubleValue();
+ }
+
+ // --------------------
+
+ setInitialPieSliceOrientation(0.75 - pieValues[0]/2);
+ for (int i=0; i < pieValues.length; i++)
+ {
+ addCurve();
+ getCurve().addPoint(5,5);
+ getCurve().getSymbol().setSymbolType( SymbolType.PIE_SLICE_OPTIMAL_SHADING );
+ getCurve().getSymbol().setBorderColor("white");
+ getCurve().getSymbol().setBackgroundColor(pieColors[i]);
+
+ // next two lines define pie diameter as 6 x-axis model units
+ getCurve().getSymbol().setModelWidth(6);
+ getCurve().getSymbol().setHeight(0);
+ getCurve().getSymbol().setFillSpacing(3);
+ getCurve().getSymbol().setFillThickness(3);
+ getCurve().getSymbol().setHovertextTemplate(pieTypes[i] + ", " + Math.round(100*pieValues[i])+"%");
+
+ getCurve().getSymbol().setPieSliceSize(pieValues[i]);
+ getCurve().getPoint().setAnnotationText( pieTypes[i] );
+ getCurve().getPoint().setAnnotationLocation( AnnotationLocation.OUTSIDE_PIE_ARC);
+ }
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/PieChart.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/console.css
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/console.css 2008-08-19 11:04:43 UTC (rev 1930)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/console.css 2008-08-19 14:57:31 UTC (rev 1931)
@@ -40,12 +40,44 @@
border: 0px;
}
-.div {
- border: 1px dashed red;
-}
-
.bpm-SplitPanel {
border: 1px dashed green;
vertical-align: top;
position:relative; top:5px; left:5px;
}
+
+.piechart-types {
+ font-size: small;
+ list-style-type:decimal;
+ font-family: sans-serif;
+}
+
+.bpm-help-panel {
+ background-color:#F0F0F0;
+ font-family: sans-serif;
+}
+
+.bpm-help-icon {
+ background-image: url( images/icons/14.png)
+}
+
+.bpm-metric-icon {
+ background-image: url( images/icons/31.png)
+}
+
+.bpm-process-icon {
+ background-image: url( images/icons/41.png)
+}
+
+.bpm-task-icon {
+ background-image: url( images/icons/29.png)
+}
+
+.bpm-instance-icon {
+ background-image: url( images/icons/05_1.png)
+}
+
+.bpm-settings-icon {
+ background-image: url( images/icons/36.png)
+}
+
Added: jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/icons/05.png
===================================================================
(Binary files differ)
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/icons/05.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/icons/05_1.png
===================================================================
(Binary files differ)
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/icons/05_1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/icons/14.png
===================================================================
(Binary files differ)
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/icons/14.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/icons/29.png
===================================================================
(Binary files differ)
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/icons/29.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/icons/31.png
===================================================================
(Binary files differ)
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/icons/31.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/icons/36.png
===================================================================
(Binary files differ)
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/icons/36.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/icons/41.png
===================================================================
(Binary files differ)
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/icons/41.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
More information about the jbpm-commits
mailing list