home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-08-14 | 3.4 KB | 139 lines |
- /*---------------------------------------------------------------------------
-
- Written by the Personal Journal developers of Dow Jones & Company, Inc.
-
- Dow Jones makes no representations or warranties about
- the suitability of this software, either express or
- implied, including but not limited to the implied warranties
- of merchantability, fitness for a particular purpose,
- or non-infringement. Dow Jones will not be liable for
- any damages suffered by a user as a result of using,
- modifying or distributing this software or its derivatives.
-
-
- @(#)DeferPage.java 0.00 19-Mar-96
-
- A page that defers the handling of NextView() and such
- to another page. For example, a page can contain a column,
- and that column has many views. So the containing page can
- defer handling of views to the Column. So when you say nextView
- to the page, the colum switches views.
-
- Authors:
-
- Ted Ted Skolnick.
-
- Version Ident:
-
- $Header$
-
- History:
-
- 0.00 19-Mar-96 Ted Skolnick. Initial Creation
-
-
- ---------------------------------------------------------------------------*/
-
- package pj.awt;
-
- import pj.util.Nameable;
-
- import java.awt.Panel;
- import java.awt.BorderLayout;
-
- /**
- * A page that defers the handling of View() functions
- * to another page. For example, a page can contain a column,
- * and that column has many views. So the containing page can
- * defer handling of views to the Column. So when you say nextView
- * to the page, the Column switches views.
- *
- * @see java.awt.Page
- * @version 0.00 19-Mar-96
- * @author Ted S.
- */
- public class DeferPage extends Page
- {
-
-
- // --- Instance variables
-
-
- Page m_PageThatHandlesViews;
-
-
- // --- Public constructors
-
- /**
- * Construct a Page with a given name.
- * @param name The name for a page
- */
- public DeferPage(String name, Page PageThatHandlesViews)
- {
- super( name );
-
- m_PageThatHandlesViews = PageThatHandlesViews;
- }
-
- // --- Public operations
- /**
- * @return The number of views in an implementation instance.
- */
- public int countViews()
- {
- return m_PageThatHandlesViews.countViews();
- }
-
-
-
- /**
- * Make the first view the current view.
- */
- public void firstView()
- {
- m_PageThatHandlesViews.firstView();
- }
-
- /**
- * Make the next view (after the current view) the current view.
- * a false return means you have hit the end.
- */
- public boolean nextView()
- {
- return m_PageThatHandlesViews.nextView();
- }
-
- /**
- * Make the last view the current view.
- */
- public void lastView()
- {
- m_PageThatHandlesViews.lastView();
- }
-
- /**
- * Make the previous view (before current view) the current view.
- * a false return means you have hit the end.
- */
- public boolean previousView()
- {
- return m_PageThatHandlesViews.previousView();
- }
-
-
-
- /**
- * Make a specific view the current view.
- * @param idx The index of the view to display.
- */
- public void view(int idx)
- {
- m_PageThatHandlesViews.view( idx );
- }
-
-
-
-
-
- } // Page
-