[jbpm-commits] JBoss JBPM SVN: r1927 - in jbpm3/trunk/modules/gwt-console/war: src/main/java/org/jboss/bpm/console/client and 5 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Aug 19 06:19:39 EDT 2008


Author: heiko.braun at jboss.com
Date: 2008-08-19 06:19:38 -0400 (Tue, 19 Aug 2008)
New Revision: 1927

Added:
   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/widgets/BarChart.java
   jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/UIConstants.java
Removed:
   jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/BareEditorView.java
Modified:
   jbpm3/trunk/modules/gwt-console/war/pom.xml
   jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/ConsoleView.java
   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/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/ProcessDefinitionList.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/ProcessInstanceList.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/java/org/jboss/bpm/console/client/widgets/ListView.java
   jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/Application.gwt.xml
   jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/processSample.jpg
Log:
Layout enhancements. Added first gchart samples

Modified: jbpm3/trunk/modules/gwt-console/war/pom.xml
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/pom.xml	2008-08-19 07:49:22 UTC (rev 1926)
+++ jbpm3/trunk/modules/gwt-console/war/pom.xml	2008-08-19 10:19:38 UTC (rev 1927)
@@ -30,6 +30,10 @@
          <groupId>com.gwtext</groupId>
          <artifactId>gwtext</artifactId>         
       </dependency>
+      <dependency>
+         <groupId>com.google.gwt</groupId>
+         <artifactId>gchart</artifactId>         
+      </dependency>
    </dependencies>
 
    <!-- Plugins -->

Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/ConsoleView.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/ConsoleView.java	2008-08-19 07:49:22 UTC (rev 1926)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/ConsoleView.java	2008-08-19 10:19:38 UTC (rev 1927)
@@ -32,6 +32,7 @@
 import com.gwtext.client.widgets.layout.FitLayout;
 import org.jboss.bpm.console.client.process.ProcessDefinitionListEditor;
 import org.jboss.bpm.console.client.widgets.EditorView;
+import org.jboss.bpm.console.client.widgets.UIConstants;
 
 /**
  * @author Heiko.Braun <heiko.braun at jboss.com>
@@ -50,12 +51,12 @@
    public ConsoleView()
    {
       mainPanel.setBorder(false);
-      mainPanel.setPaddings(15);
+      mainPanel.setPaddings(5); // outer most padding
       mainPanel.setLayout(new FitLayout());     
 
       initWidget( mainPanel );
       
-      borderPanel.setLayout(new BorderLayout());
+      borderPanel.setLayout(new BorderLayout());      
 
       // ------------------------------------------
 
@@ -67,8 +68,8 @@
       mainMenu = new MainMenu(this);
       BorderLayoutData menuData = new BorderLayoutData(RegionPosition.WEST);
       menuData.setSplit(false);
-      menuData.setMinSize(175);
-      menuData.setMaxSize(400);
+      menuData.setMinSize(UIConstants.MAIN_MENU_MIN);
+      menuData.setMaxSize(UIConstants.MAIN_MENU_MAX);
       menuData.setMargins(new Margins(0, 5, 0, 0));
       borderPanel.add(mainMenu, menuData);
 

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 07:49:22 UTC (rev 1926)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/EditorPanel.java	2008-08-19 10:19:38 UTC (rev 1927)
@@ -41,7 +41,8 @@
       this.setResizeTabs(true);
       this.setMinTabWidth(115);
       this.setTabWidth(135);
-      this.setEnableTabScroll(true);      
+      this.setEnableTabScroll(true);
+      this.setAutoScroll(true);      
       this.setActiveTab(0);
    }
 
@@ -50,7 +51,9 @@
       tab.setAutoScroll(true);
       tab.setTitle(editorView.getTitle());
       tab.setClosable(closeable);
-      tab.setLayout(new FitLayout());      
+      tab.setBorder(false);
+      tab.setFrame(false);
+      tab.setHideBorders(true);
       this.add(tab);
       return tab;
    }

Modified: 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-19 07:49:22 UTC (rev 1926)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MockProcessDefinitionDAO.java	2008-08-19 10:19:38 UTC (rev 1927)
@@ -29,17 +29,27 @@
  */
 public class MockProcessDefinitionDAO implements ProcessDefinitionDAO
 {
-   final static List defs = new ArrayList();
+   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", "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;    
+   }
 }

Modified: 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-19 07:49:22 UTC (rev 1926)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MockProcessInstanceDAO.java	2008-08-19 10:19:38 UTC (rev 1927)
@@ -35,9 +35,9 @@
    static
    {
       instances.add( new ProcessInstance(2, -1, "Running", new Date(), null));
-      instances.add( new ProcessInstance(3, -1, "Stopped", new Date(), null));
-      instances.add( new ProcessInstance(4, -1, "Ended", new Date(System.currentTimeMillis()-(1000*60*60)), null));
-      instances.add( new ProcessInstance(5, -1, "Suspended", new Date(System.currentTimeMillis()-(1000*60*90)), 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));      
    }

Added: 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	                        (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/GChartExample.java	2008-08-19 10:19:38 UTC (rev 1927)
@@ -0,0 +1,109 @@
+/*
+ * 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>&nbsp;</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


Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/GChartExample.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/process/ProcessDefinitionList.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionList.java	2008-08-19 07:49:22 UTC (rev 1926)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionList.java	2008-08-19 10:19:38 UTC (rev 1927)
@@ -65,7 +65,7 @@
         new ColumnConfig[]
           {
             new ColumnConfig("Process ID", "processId", 75, true),
-            new ColumnConfig("Name", "name", 200, true, null, "name"),
+            new ColumnConfig("Name", "name", 300, true, null, "name"),
             new ColumnConfig("Version", "version", 75, true)
           }
       );
@@ -78,9 +78,8 @@
       store.load();
       grid.setStore(store);
 
-
       grid.setAutoExpandColumn("name");
-      grid.setAutoExpandMin(200);
+      grid.setAutoExpandMin(300);
 
    }
 

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 07:49:22 UTC (rev 1926)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java	2008-08-19 10:19:38 UTC (rev 1927)
@@ -21,6 +21,7 @@
  */
 package org.jboss.bpm.console.client.process;
 
+import com.gwtext.client.widgets.layout.ColumnLayout;
 import org.jboss.bpm.console.client.ConsoleView;
 import org.jboss.bpm.console.client.widgets.EditorView;
 
@@ -41,8 +42,46 @@
       this.setId(ID);
       
       this.view = view;
+
+      // ----------------------------------
+
+      //this.setLayout( new ColumnLayout() );
+
+      // stats
+      /*Map barValues = new HashMap();
       
+      barValues.put("Order Process", new Double(12.00));
+      barValues.put("VacationManagement", new Double(24.00));
+      barValues.put("New Employee walkthrough", new Double(5.00));
+      barValues.put("Source code review", new Double(8.00));
+      barValues.put("Loan application", new Double(54.00));
+      barValues.put("Expense report review", new Double(10.00));
+
+      BarChart chart = new BarChart(320,240, "Most used processes", "process", barValues );
+      
+      Panel chartPanel = new Panel("Most active process definitions");
+      chartPanel.setPaddings(15);
+      chartPanel.setHeader(false);
+      chartPanel.setBorder(false);
+      chartPanel.setWidth(UIConstants.EDITOR_PANEL_WIDTH);
+      chartPanel.add( chart );
+      this.add(chartPanel);
+      chart.update();*/
+
+      // definitions
       processDefinitions = new ProcessDefinitionList("Process Definitions", view);
+
+      // ----------------------------------
+
+      /*PaddedPanel rightPanel = new PaddedPanel(processDefinitions, 5, 5, 0, 5);
+      PaddedPanel leftPanel = new PaddedPanel( new Panel("Metrics", 200, 150) , 5, 5, 0, 5);      
+
+      // ----------------------------------
+
+      this.add(rightPanel, new ColumnLayoutData(0.7) );
+      this.add(leftPanel , new ColumnLayoutData(0.3) );
+        */
+
       this.add(processDefinitions);
    }
 

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 07:49:22 UTC (rev 1926)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceEditor.java	2008-08-19 10:19:38 UTC (rev 1927)
@@ -21,8 +21,10 @@
  */
 package org.jboss.bpm.console.client.process;
 
+import com.gwtext.client.widgets.PaddedPanel;
 import com.gwtext.client.widgets.Panel;
-import com.gwtext.client.widgets.layout.HorizontalLayout;
+import com.gwtext.client.widgets.layout.ColumnLayout;
+import com.gwtext.client.widgets.layout.ColumnLayoutData;
 import org.jboss.bpm.console.client.ConsoleView;
 import org.jboss.bpm.console.client.model.ProcessDefinition;
 import org.jboss.bpm.console.client.model.ProcessInstance;
@@ -52,17 +54,25 @@
       this.processInstance = instance;
       this.view = view;
 
+      // ----------------------------------
+      
       this.setPaddings(15);
       this.setWidth(800);
+      this.setLayout( new ColumnLayout() );
       
       this.setBorder(false);
       this.setHeader(false);
-      
-      this.setLayout( new HorizontalLayout(10) );
 
-      this.add( new Panel("A", 220, 250) );
-      this.add( new Panel("B", 200, 150) );
+      // ----------------------------------
 
+      PaddedPanel rightPanel = new PaddedPanel(new ProcessImageView(instance), 5, 5, 0, 5);
+      PaddedPanel leftPanel = new PaddedPanel( new Panel("Tasks", 200, 150) , 5, 5, 0, 5);
+      leftPanel.add( new PaddedPanel(new Panel("Comments" , 200, 150), 5, 0, 0, 5) );
+      
+      // ----------------------------------
+      
+      this.add(rightPanel, new ColumnLayoutData(0.7) );
+      this.add(leftPanel , new ColumnLayoutData(0.3) );
    }
 
    public String getEditorId()
@@ -72,6 +82,6 @@
 
    public String getTitle()
    {
-      return processDefinition.getName() + " #"+processInstance.getId();
+      return "#"+processInstance.getId()+" ("+processDefinition.getName()+")";
    }
 }

Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java	2008-08-19 07:49:22 UTC (rev 1926)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java	2008-08-19 10:19:38 UTC (rev 1927)
@@ -24,6 +24,7 @@
 import com.gwtext.client.data.*;
 import com.gwtext.client.widgets.grid.ColumnConfig;
 import com.gwtext.client.widgets.grid.ColumnModel;
+import com.google.gwt.i18n.client.DateTimeFormat;
 import org.jboss.bpm.console.client.ConsoleView;
 import org.jboss.bpm.console.client.model.DAOFactory;
 import org.jboss.bpm.console.client.model.ProcessDefinition;
@@ -70,8 +71,8 @@
             new ColumnConfig("Instance ID", "instanceId", 50, true),
             new ColumnConfig("key", "key", 50, true),
             new ColumnConfig("Status", "status", 100, true, null, "status"),
-            new ColumnConfig("Start Date", "start", 75, true),
-            new ColumnConfig("End Date", "end", 75, true)
+            new ColumnConfig("Start Date", "start", 125, true),
+            new ColumnConfig("End Date", "end", 125, true)
           }
       );
 
@@ -108,6 +109,8 @@
 
       Object[][] records = new Object[processDefs.size()][];
 
+      //DateTimeFormat df = DateTimeFormat.getFormat("yyyy.MM.dd - HH:mm:ss");
+
       Iterator it = processDefs.iterator();
       int row = 0;
       while(it.hasNext())

Added: 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	                        (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/BarChart.java	2008-08-19 10:19:38 UTC (rev 1927)
@@ -0,0 +1,94 @@
+/*
+ * 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 BarChart extends GChart
+{
+   String[] groupLabels;
+   
+   final static String BAR_COLOR = "blue";
+
+   final int MAX_REVENUE = 1000;
+   
+   public BarChart(int width, int height, String title, String groupName, Map barValues)
+   {
+
+      // limit to a single group
+      this.groupLabels = new String[] { groupName };
+
+      setChartSize(width, height);
+      setChartTitle(title);
+
+      String[] labels = (String[])barValues.keySet().toArray( new String[]{} );
+      
+      for (int iCurve=0; iCurve < labels.length; iCurve++)
+      {
+         addCurve();     // one curve per quarter
+         getCurve().getSymbol().setSymbolType(GChart.SymbolType.VBAR_SOUTHWEST);
+         getCurve().getSymbol().setBackgroundColor(BAR_COLOR);
+         getCurve().setLegendLabel(labels[iCurve]);
+
+         getCurve().getSymbol().setHovertextTemplate(
+           labels[iCurve]  + " value=${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*(labels.length+1), Math.random()*MAX_REVENUE);
+            getCurve().getPoint().setAnnotationText(labels[iCurve]);
+            getCurve().getPoint().setAnnotationLocation( GChart.AnnotationLocation.NORTH);
+         }
+      }
+
+      for (int i = 0; i < groupLabels.length; i++)
+      {
+         // formula centers tick-label horizontally on each group
+         getXAxis().addTick(
+           labels.length/2. + i*(labels.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("###");
+   }
+
+}


Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/BarChart.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/widgets/BareEditorView.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/BareEditorView.java	2008-08-19 07:49:22 UTC (rev 1926)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/BareEditorView.java	2008-08-19 10:19:38 UTC (rev 1927)
@@ -1,48 +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.widgets;
-
-import com.gwtext.client.widgets.Component;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public class BareEditorView extends EditorView
-{
-
-   private Component comp;
-
-   public BareEditorView(Component comp)
-   {
-      this.add(comp);
-   }
-
-   public String getEditorId()
-   {
-      return super.getId();
-   }
-
-   public String getTitle()
-   {
-      return ""; 
-   }
-}

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 07:49:22 UTC (rev 1926)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/EditorView.java	2008-08-19 10:19:38 UTC (rev 1927)
@@ -28,6 +28,12 @@
  */
 public abstract class EditorView extends Panel
 {
+
+   protected EditorView()
+   {
+      super();
+   }
+
    public abstract String getEditorId();
    public abstract String getTitle();
 }

Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/ListView.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/ListView.java	2008-08-19 07:49:22 UTC (rev 1926)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/ListView.java	2008-08-19 10:19:38 UTC (rev 1927)
@@ -46,9 +46,10 @@
 
       // ----------------------------------
 
-      this.setPaddings(15);
+      this.setPaddings(10);
       this.setHeader(false);
       this.setBorder(false);
+      this.setFrame(false);
 
       // ----------------------------------
 
@@ -110,11 +111,11 @@
 
       // ----------------------------------------
 
-      grid.setFrame(true);
+      grid.setFrame(false);
       grid.setStripeRows(true);
       grid.setTitle(titleName);
       
-      grid.setWidth(350);
+      grid.setWidth(UIConstants.EDITOR_PANEL_WIDTH);
 
       grid.setEnableHdMenu(false);
       grid.setEnableColumnMove(false);

Added: 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	                        (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/UIConstants.java	2008-08-19 10:19:38 UTC (rev 1927)
@@ -0,0 +1,32 @@
+/*
+ * 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;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class UIConstants
+{
+   final static int EDITOR_PANEL_WIDTH = 450;
+   public static final int MAIN_MENU_MIN = 175;
+   public static final int MAIN_MENU_MAX = 400;
+}


Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/UIConstants.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/Application.gwt.xml
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/Application.gwt.xml	2008-08-19 07:49:22 UTC (rev 1926)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/Application.gwt.xml	2008-08-19 10:19:38 UTC (rev 1927)
@@ -3,6 +3,9 @@
   <!-- Inherit the core Web Toolkit stuff. -->
   <inherits name='com.google.gwt.user.User' />
   <inherits name='com.gwtext.GwtExt' />
+  <inherits name='com.googlecode.gchart.GChart'/>
+
+
    
   <!-- Specify the app entry point class. -->
   <entry-point class='org.jboss.bpm.console.client.Application' />

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