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

  1. import java.applet.Applet;
  2. import java.awt.Component;
  3. import java.awt.Container;
  4. import java.awt.LayoutManager;
  5. import java.awt.event.ActionEvent;
  6. import java.beans.PropertyVetoException;
  7. import java.net.MalformedURLException;
  8. import symantec.itools.awt.InvisibleButton;
  9. import symantec.itools.awt.WrappingLabel;
  10. import symantec.itools.lang.Context;
  11. import symantec.itools.multimedia.ImageViewer;
  12. import symantec.itools.multimedia.SlideShow;
  13. import symantec.itools.net.RelativeURL;
  14.  
  15. public class SlideShowIsle extends Applet {
  16.    InvisibleButton invisibleButtonPrevUnder;
  17.    InvisibleButton invisibleButtonNextUnder;
  18.    SlideShow slideShowPhotos;
  19.    ImageViewer imageViewerClicker;
  20.    InvisibleButton invisibleButtonNext;
  21.    InvisibleButton invisibleButtonPrev;
  22.    WrappingLabel wrappingLabelDesc;
  23.  
  24.    void invisibleButtonNextUnder_Action(ActionEvent event) {
  25.       this.slideShowPhotos.nextImage();
  26.    }
  27.  
  28.    void invisibleButtonPrevUnder_Action(ActionEvent event) {
  29.       this.slideShowPhotos.previousImage();
  30.    }
  31.  
  32.    void slideShowPhotos_SlideChanged(ActionEvent event) {
  33.       try {
  34.          this.wrappingLabelDesc.setText(this.slideShowPhotos.getDescription(this.slideShowPhotos.getCurrentImageIndex()));
  35.       } catch (PropertyVetoException var2) {
  36.       }
  37.  
  38.    }
  39.  
  40.    void invisibleButtonNext_Action(ActionEvent event) {
  41.       this.slideShowPhotos.nextImage();
  42.    }
  43.  
  44.    void invisibleButtonPrev_Action(ActionEvent event) {
  45.       this.slideShowPhotos.previousImage();
  46.    }
  47.  
  48.    public void init() {
  49.       Context.setApplet(this);
  50.       ((Container)this).setLayout((LayoutManager)null);
  51.       ((Component)this).setSize(531, 364);
  52.       this.invisibleButtonPrevUnder = new InvisibleButton();
  53.       this.invisibleButtonPrevUnder.setBounds(262, 277, 37, 40);
  54.       ((Container)this).add(this.invisibleButtonPrevUnder);
  55.       this.invisibleButtonNextUnder = new InvisibleButton();
  56.       this.invisibleButtonNextUnder.setBounds(305, 272, 40, 44);
  57.       ((Container)this).add(this.invisibleButtonNextUnder);
  58.       this.slideShowPhotos = new SlideShow();
  59.  
  60.       try {
  61.          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.");
  62.          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.");
  63.          this.slideShowPhotos.addImageAndDescription(RelativeURL.getURL("Images/PHOTO_3.GIF"), "At the top of Venduca volcano, you can safely watch the volcanic activity.");
  64.          this.slideShowPhotos.addImageAndDescription(RelativeURL.getURL("Images/Photo_7.gif"), "The ocean pounds against rocks formed from past Venduca lava flows.");
  65.          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.");
  66.          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.");
  67.          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.");
  68.          this.slideShowPhotos.addImageAndDescription(RelativeURL.getURL("Images/Photo_6.gif"), "Moderna rose gardens bloom year-round.");
  69.       } catch (Exception var5) {
  70.       }
  71.  
  72.       this.slideShowPhotos.setBounds(8, 8, 337, 232);
  73.       ((Container)this).add(this.slideShowPhotos);
  74.       this.imageViewerClicker = new ImageViewer();
  75.  
  76.       try {
  77.          this.imageViewerClicker.setImageURL(RelativeURL.getURL("Images/Clicker.gif"));
  78.       } catch (MalformedURLException var3) {
  79.       } catch (PropertyVetoException var4) {
  80.       }
  81.  
  82.       this.imageViewerClicker.setBounds(8, 256, 381, 104);
  83.       ((Container)this).add(this.imageViewerClicker);
  84.       this.invisibleButtonNext = new InvisibleButton();
  85.       this.invisibleButtonNext.setBounds(305, 272, 40, 41);
  86.       ((Container)this).add(this.invisibleButtonNext);
  87.       this.invisibleButtonPrev = new InvisibleButton();
  88.       this.invisibleButtonPrev.setBounds(264, 273, 35, 43);
  89.       ((Container)this).add(this.invisibleButtonPrev);
  90.       this.wrappingLabelDesc = new WrappingLabel();
  91.  
  92.       try {
  93.          this.wrappingLabelDesc.setText("Pristine Bungbusi beaches are ideal for relaxing and for all kinds of water sports, including surfing, water skiing, and snorkeling.");
  94.       } catch (PropertyVetoException var2) {
  95.       }
  96.  
  97.       this.wrappingLabelDesc.setBounds(352, 24, 175, 212);
  98.       ((Container)this).add(this.wrappingLabelDesc);
  99.       SlideShowIsle$Action lAction = new SlideShowIsle$Action(this);
  100.       this.invisibleButtonPrev.addActionListener(lAction);
  101.       this.invisibleButtonNext.addActionListener(lAction);
  102.       this.slideShowPhotos.addActionListener(lAction);
  103.       this.invisibleButtonPrevUnder.addActionListener(lAction);
  104.       this.invisibleButtonNextUnder.addActionListener(lAction);
  105.    }
  106. }
  107.