home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-08-14 | 4.2 KB | 150 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.
-
-
- @(#)PjCheckboxNb.java 0.00 05-Jan-96
-
- An implementation of PjNbSpec using CheckboxNb.
-
- Authors:
-
- jts Ted Skolnick
- ln Lindee Ning
- rphall Rick Hall
- jlee James Lee
-
- Version Ident:
-
- $Header: /PjJavaClient/src/pj/awt/PjCheckboxNb.java 6 2/02/96 11:46a Rphall $
-
- History:
-
- 0.00 05-Jan-96 rphall Initial Creation
- 29-Jan-96 jlee Added WeatherSection
- 12-Feb-96 ln Added ticker
- 13-Feb-96 jts Added DogEar
- 14-Feb-96 jlee Added SportsSection
- 23-Feb-96 Ted S. Made this implement PaperView so you
- can step through the paper saying NextView().
-
- ---------------------------------------------------------------------------*/
-
- package pj.awt;
-
- import pj.awt.CheckboxNb;
- import pj.awt.DogEar;
- import pj.awt.HeadlineSection;
- import pj.awt.MarketSection;
- import pj.awt.PaperView;
- import pj.awt.PjImages;
- import pj.awt.PjNbSpec;
- import pj.awt.PjTicker;
- import pj.awt.SportsSection;
- import pj.awt.WeatherSection;
- import pj.io.Paper;
-
- import collections.Assertable;
- import collections.ImplementationError;
- import java.awt.BorderLayout;
- import java.awt.Color;
- import java.awt.Panel;
- import java.util.Date;
-
-
- /**
- * An implementation of PjNbSpec using CheckboxNb.
- *
- * @see pj.awt.CheckboxNb
- * @version 0.00 05-Jan-96
- * @author rphall
- */
- public class PjCheckboxNb extends CheckboxNb implements Assertable
- {
-
- // --- Instance variables
-
- DogEar dogear;
- Paper paper;
- PjTicker ticker;
-
- // --- Public constructors
-
- /**
- * Create a Personal Journal notebook.
- */
- public PjCheckboxNb(Paper p, PjAds ads, PjImages images)
- {
- assert(p != null);
- assert(ads != null);
- assert(images != null);
-
- paper = p;
- PjNbSpec nbs = new PjNbSpec();
-
- appendPage( new HeadlineSection(
- nbs.pagespecs()[nbs.idxFPHdlines],paper) );
-
- appendPage( new HeadlineSection(
- nbs.pagespecs()[nbs.idxTJIHdlines],paper) );
-
- appendPage( new MarketSection(
- nbs.pagespecs()[nbs.idxMrk],paper) );
-
- appendPage( new PortView(
- nbs.pagespecs()[nbs.idxPort],
- ads.adspecs()[ads.idxPortAd],paper) );
-
- appendPage( new SportsSection(
- nbs.pagespecs()[nbs.idxSpHilite],
- ads.adspecs()[ads.idxSpAd],paper) );
-
- appendPage( new WeatherSection(
- nbs.pagespecs()[nbs.idxWth],
- ads.adspecs()[ads.idxWthAd],paper,
- images.imagespecs()[images.idxWthMap]) );
-
- // Top panel with Connect Button, Ticker, DogEar
- Panel pnl = new Panel();
- pnl.setLayout(new BorderLayout(/*hgap*/5,/*vgap*/0) );
- dogear = new DogEar( images, this );
-
- pnl.add("East",dogear);
- Panel pnlTicker = new Panel();
- ticker = new PjTicker( p.idPortQuote, p );
-
- pnlTicker.add("North", ticker);
- ticker.startTicker();
-
- // Leave space for something later
- Panel westPnl = new Panel();
-
- pnl.add("West",westPnl);
- pnl.add("Center", pnlTicker);
- add("North",pnl);
-
- } // PjCheckboxNb
-
- // --- Public operations
-
- /**
- * Raise an exception if predicate is false.
- * @see collections.Assertable
- */
- public void assert(boolean predicate) throws ImplementationError
- {
- ImplementationError.assert(this, predicate);
- }
-
-
-
- } // PjCheckboxNb
-