CVS: Tapestry/examples/Tutorial/src/tutorial/workbench/chart Chart.java,1.6,1.6.2.1 Chart.html,1.1.4.1,NONE Chart.page,1.7.2.1,NONE

Howard Lewis Ship <[email protected]>
Newsgroups gmane.comp.java.tapestry.cvs
Message-ID <[email protected]>
Update of /cvsroot/tapestry/Tapestry/examples/Tutorial/src/tutorial/workbench/chart
In directory sc8-pr-cvs1:/tmp/cvs-serv10583/examples/Tutorial/src/tutorial/workbench/chart

Modified Files:
      Tag: hship-2-3
	Chart.java 
Removed Files:
      Tag: hship-2-3
	Chart.html Chart.page 
Log Message:
Reorganize the tutorials to use new 2.4 features.

Index: Chart.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/examples/Tutorial/src/tutorial/workbench/chart/Chart.java,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -C2 -d -r1.6 -r1.6.2.1
*** Chart.java	27 Nov 2002 17:58:54 -0000	1.6
--- Chart.java	2 Jan 2003 03:15:29 -0000	1.6.2.1
***************
*** 29,43 ****
  public class Chart extends BasePage implements IChartProvider
  {
!     private List plotValues;
!     private List removeValues;
!     private PlotValue plotValue;
  
!     public void detach()
      {
!         plotValues = null;
!         removeValues = null;
!         plotValue = null;
! 
!         super.detach();
      }
  
--- 29,41 ----
  public class Chart extends BasePage implements IChartProvider
  {
!     private List _plotValues;
!     private List _removeValues;
!     private PlotValue _plotValue;
  
!     public void initialize()
      {
!         _plotValues = null;
!         _removeValues = null;
!         _plotValue = null;
      }
  
***************
*** 55,73 ****
      public List getPlotValues()
      {
!         if (plotValues == null)
          {
!             setPlotValues(new ArrayList());
  
!             plotValues.add(new PlotValue("Fred", 10));
!             plotValues.add(new PlotValue("Barney", 15));
!             plotValues.add(new PlotValue("Dino", 7));
          }
  
!         return plotValues;
      }
  
      public void setPlotValues(List plotValues)
      {
!         this.plotValues = plotValues;
  
          fireObservedChange("plotValues", plotValues);
--- 53,73 ----
      public List getPlotValues()
      {
!         if (_plotValues == null)
          {
!             _plotValues = new ArrayList();
  
!             _plotValues.add(new PlotValue("Fred", 10));
!             _plotValues.add(new PlotValue("Barney", 15));
!             _plotValues.add(new PlotValue("Dino", 7));
! 
!             fireObservedChange("plotValues", _plotValues);
          }
  
!         return _plotValues;
      }
  
      public void setPlotValues(List plotValues)
      {
!         _plotValues = plotValues;
  
          fireObservedChange("plotValues", plotValues);
***************
*** 76,85 ****
      public PlotValue getPlotValue()
      {
!         return plotValue;
      }
  
      public void setPlotValue(PlotValue plotValue)
      {
!         this.plotValue = plotValue;
      }
  
--- 76,85 ----
      public PlotValue getPlotValue()
      {
!         return _plotValue;
      }
  
      public void setPlotValue(PlotValue plotValue)
      {
!         _plotValue = plotValue;
      }
  
***************
*** 106,113 ****
          if (value)
          {
!             if (removeValues == null)
!                 removeValues = new ArrayList();
  
!             removeValues.add(plotValue);
  
              // Deleting things screws up the validation delegate.
--- 106,113 ----
          if (value)
          {
!             if (_removeValues == null)
!                 _removeValues = new ArrayList();
  
!             _removeValues.add(_plotValue);
  
              // Deleting things screws up the validation delegate.
***************
*** 138,142 ****
--- 138,146 ----
      public void add(IRequestCycle cycle)
      {
+         List plotValues = getPlotValues();
+ 
          plotValues.add(new PlotValue());
+ 
+         setPlotValues(plotValues);
      }
  
***************
*** 150,155 ****
      public void delete(IRequestCycle cycle)
      {
!         if (removeValues != null)
!             plotValues.removeAll(removeValues);
      }
  
--- 154,165 ----
      public void delete(IRequestCycle cycle)
      {
!         if (_removeValues != null)
!         {
!             List plotValues = getPlotValues();
! 
!             plotValues.removeAll(_removeValues);
! 
!             setPlotValues(plotValues);
!         }
      }
  
***************
*** 174,177 ****
--- 184,189 ----
      {
          DefaultPieDataset data = new DefaultPieDataset();
+ 
+         List plotValues = getPlotValues();
  
          int count = plotValues.size();

--- Chart.html DELETED ---

--- Chart.page DELETED ---



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.