home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / VCafe / ddetour.bin / SlideShowIsle.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-03-19  |  4.8 KB  |  113 lines

  1. import java.applet.Applet;
  2. import java.awt.Color;
  3. import java.awt.Component;
  4. import java.awt.Container;
  5. import java.awt.Font;
  6. import java.awt.LayoutManager;
  7. import java.awt.event.ActionEvent;
  8. import java.beans.PropertyVetoException;
  9. import java.net.MalformedURLException;
  10. import symantec.itools.awt.InvisibleButton;
  11. import symantec.itools.awt.WrappingLabel;
  12. import symantec.itools.lang.Context;
  13. import symantec.itools.multimedia.ImageViewer;
  14. import symantec.itools.multimedia.SlideShow;
  15. import symantec.itools.net.RelativeURL;
  16.  
  17. public class SlideShowIsle extends Applet {
  18.    InvisibleButton invisibleButtonPrevUnder;
  19.    InvisibleButton invisibleButtonNextUnder;
  20.    SlideShow slideShowPhotos;
  21.    ImageViewer imageViewerClicker;
  22.    InvisibleButton invisibleButtonNext;
  23.    InvisibleButton invisibleButtonPrev;
  24.    WrappingLabel wrappingLabelDesc;
  25.  
  26.    void invisibleButtonNextUnder_Action(ActionEvent event) {
  27.       this.slideShowPhotos.nextImage();
  28.    }
  29.  
  30.    void invisibleButtonPrevUnder_Action(ActionEvent event) {
  31.       this.slideShowPhotos.previousImage();
  32.    }
  33.  
  34.    void slideShowPhotos_SlideChanged(ActionEvent event) {
  35.       try {
  36.          this.wrappingLabelDesc.setText(this.slideShowPhotos.getDescription(this.slideShowPhotos.getCurrentImageIndex()));
  37.       } catch (PropertyVetoException var2) {
  38.       }
  39.  
  40.    }
  41.  
  42.    void invisibleButtonNext_Action(ActionEvent event) {
  43.       this.slideShowPhotos.nextImage();
  44.    }
  45.  
  46.    void invisibleButtonPrev_Action(ActionEvent event) {
  47.       this.slideShowPhotos.previousImage();
  48.    }
  49.  
  50.    public void addNotify() {
  51.       super.addNotify();
  52.       Context.setDocumentBase(((Applet)this).getDocumentBase());
  53.       ((Container)this).setLayout((LayoutManager)null);
  54.       ((Component)this).setSize(531, 365);
  55.       ((Component)this).setFont(new Font("Dialog", 0, 12));
  56.       ((Component)this).setForeground(new Color(0));
  57.       ((Component)this).setBackground(new Color(16777215));
  58.       this.invisibleButtonPrevUnder = new InvisibleButton();
  59.       this.invisibleButtonPrevUnder.setBounds(262, 277, 37, 40);
  60.       ((Container)this).add(this.invisibleButtonPrevUnder);
  61.       this.invisibleButtonNextUnder = new InvisibleButton();
  62.       this.invisibleButtonNextUnder.setBounds(305, 272, 40, 44);
  63.       ((Container)this).add(this.invisibleButtonNextUnder);
  64.       this.slideShowPhotos = new SlideShow();
  65.  
  66.       try {
  67.          this.slideShowPhotos.addImageAndDescription(RelativeURL.getURL("Images/PHOTO_1.GIF"), "Pristine Bungbusi beaches are ideal for relaxing and for all kinds of water sports, including surfing, water skiing, and snorkeling.");
  68.          this.slideShowPhotos.addImageAndDescription(RelativeURL.getURL("Images/Photo_8.gif"), "Hiking through the rainforest and touring botanical gardens are some of the many ways to explore the Bungbusi tropical paradise.");
  69.          this.slideShowPhotos.addImageAndDescription(RelativeURL.getURL("Images/PHOTO_3.GIF"), "At the top of Venduca volcano, you can safely watch the volcanic activity.");
  70.          this.slideShowPhotos.addImageAndDescription(RelativeURL.getURL("Images/Photo_7.gif"), "The ocean pounds against rocks formed from past Venduca lava flows.");
  71.          this.slideShowPhotos.addImageAndDescription(RelativeURL.getURL("Images/PHOTO_2.GIF"), "Who were the technologically advanced people that constructed this ancient Simerilian building? This riddle attracts archeologists and curious travelers from around the world.");
  72.          this.slideShowPhotos.addImageAndDescription(RelativeURL.getURL("Images/PHOTO_4.GIF"), "The extinct civilization that lived in Simerilia had indoor plumbing, running water, saunas, enclosed courtyards, and sophisticated art in their city buildings.");
  73.          this.slideShowPhotos.addImageAndDescription(RelativeURL.getURL("Images/PHOTO_5.GIF"), "The beautiful Moderna river slinks through this modern village. Portions of the river are perfect for white-water rafting.");
  74.          this.slideShowPhotos.addImageAndDescription(RelativeURL.getURL("Images/Photo_6.gif"), "Moderna rose gardens bloom year-round.");
  75.       } catch (Exception var5) {
  76.       }
  77.  
  78.       this.slideShowPhotos.setBounds(8, 8, 337, 232);
  79.       ((Container)this).add(this.slideShowPhotos);
  80.       this.imageViewerClicker = new ImageViewer();
  81.  
  82.       try {
  83.          this.imageViewerClicker.setURL(RelativeURL.getURL("Images/Clicker.gif"));
  84.       } catch (MalformedURLException var3) {
  85.       } catch (PropertyVetoException var4) {
  86.       }
  87.  
  88.       this.imageViewerClicker.setBounds(8, 256, 381, 104);
  89.       ((Container)this).add(this.imageViewerClicker);
  90.       this.invisibleButtonNext = new InvisibleButton();
  91.       this.invisibleButtonNext.setBounds(305, 272, 40, 41);
  92.       ((Container)this).add(this.invisibleButtonNext);
  93.       this.invisibleButtonPrev = new InvisibleButton();
  94.       this.invisibleButtonPrev.setBounds(264, 273, 35, 43);
  95.       ((Container)this).add(this.invisibleButtonPrev);
  96.       this.wrappingLabelDesc = new WrappingLabel();
  97.  
  98.       try {
  99.          this.wrappingLabelDesc.setText("Pristine Bungbusi beaches are ideal for relaxing and for all kinds of water sports, including surfing, water skiing, and snorkeling.");
  100.       } catch (PropertyVetoException var2) {
  101.       }
  102.  
  103.       this.wrappingLabelDesc.setBounds(352, 24, 175, 212);
  104.       ((Container)this).add(this.wrappingLabelDesc);
  105.       SlideShowIsle$Action lAction = new SlideShowIsle$Action(this);
  106.       this.invisibleButtonPrev.addActionListener(lAction);
  107.       this.invisibleButtonNext.addActionListener(lAction);
  108.       this.slideShowPhotos.addActionListener(lAction);
  109.       this.invisibleButtonPrevUnder.addActionListener(lAction);
  110.       this.invisibleButtonNextUnder.addActionListener(lAction);
  111.    }
  112. }
  113.