home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / pc / java / un2maiq4 / pjjava / src / pj / awt / deferpage.java < prev    next >
Encoding:
Java Source  |  1996-08-14  |  3.4 KB  |  139 lines

  1. /*---------------------------------------------------------------------------
  2.  
  3.     Written by the Personal Journal developers of Dow Jones & Company, Inc.
  4.  
  5.     Dow Jones makes no representations or warranties about 
  6.     the suitability of this software, either express or 
  7.     implied, including but not limited to the implied warranties 
  8.     of merchantability, fitness for a particular purpose, 
  9.     or non-infringement.  Dow Jones will not be liable for 
  10.     any damages suffered by a user as a result of using, 
  11.     modifying or distributing this software or its derivatives.
  12.  
  13.  
  14.     @(#)DeferPage.java  0.00 19-Mar-96
  15.  
  16.         A page that defers the handling of NextView() and such
  17.         to another page.  For example, a page can contain a column,
  18.         and that column has many views.  So the containing page can
  19.         defer handling of views to the Column.  So when you say nextView
  20.         to the page, the colum switches views.
  21.  
  22.     Authors:
  23.  
  24.         Ted Ted Skolnick.
  25.  
  26.     Version Ident:
  27.  
  28.         $Header$
  29.  
  30.     History:
  31.  
  32.         0.00 19-Mar-96  Ted Skolnick.      Initial Creation
  33.         
  34.  
  35. ---------------------------------------------------------------------------*/
  36.  
  37. package pj.awt;
  38.  
  39. import pj.util.Nameable;
  40.  
  41. import java.awt.Panel;
  42. import java.awt.BorderLayout;
  43.  
  44. /**
  45.  * A page that defers the handling of View() functions
  46.  *        to another page.  For example, a page can contain a column,
  47.  *        and that column has many views.  So the containing page can
  48.  *        defer handling of views to the Column.  So when you say nextView
  49.  *        to the page, the Column switches views. 
  50.  *
  51.  * @see     java.awt.Page
  52.  * @version 0.00 19-Mar-96
  53.  * @author  Ted S.
  54. */
  55. public class DeferPage extends Page
  56.     {
  57.  
  58.  
  59.     // --- Instance variables
  60.  
  61.    
  62.     Page m_PageThatHandlesViews;
  63.  
  64.  
  65.     // --- Public constructors
  66.  
  67.     /**
  68.      * Construct a Page with a given name.
  69.      * @param name  The name for a page
  70.     */
  71.     public DeferPage(String name, Page PageThatHandlesViews)
  72.         {
  73.         super( name );
  74.         
  75.         m_PageThatHandlesViews = PageThatHandlesViews;
  76.         } 
  77.          
  78.     // --- Public operations    
  79.     /**
  80.      * @return The number of views in an implementation instance.
  81.     */
  82.     public int countViews()
  83.         {
  84.         return m_PageThatHandlesViews.countViews();
  85.         }
  86.  
  87.     
  88.  
  89.     /**
  90.      * Make the first view the current view.
  91.     */
  92.     public void firstView()
  93.         {
  94.         m_PageThatHandlesViews.firstView();
  95.         }
  96.  
  97.     /**
  98.      * Make the next view (after the current view) the current view.
  99.      *  a false return means you have hit the end.
  100.     */
  101.     public boolean nextView()
  102.         {
  103.         return m_PageThatHandlesViews.nextView();
  104.         }
  105.  
  106.     /**
  107.      * Make the last view the current view.
  108.     */
  109.     public void lastView()
  110.         {
  111.         m_PageThatHandlesViews.lastView();
  112.         }
  113.  
  114.     /**
  115.      * Make the previous view (before current view) the current view.
  116.      *  a false return means you have hit the end.
  117.     */
  118.     public boolean previousView()
  119.         {        
  120.         return m_PageThatHandlesViews.previousView();     
  121.         }
  122.  
  123.     
  124.      
  125.     /**
  126.      * Make a specific view the current view.
  127.      * @param idx The index of the view to display.
  128.     */
  129.     public void view(int idx)
  130.         {
  131.         m_PageThatHandlesViews.view( idx );
  132.         }
  133.  
  134.  
  135.  
  136.     
  137.  
  138.     } // Page
  139.