home *** CD-ROM | disk | FTP | other *** search
/ CD Ware Multimedia 1999 February / CDW0299.iso / Demos / Cafe / WDETOUR.BIN / SlideShowIsle.java < prev    next >
Encoding:
Java Source  |  1998-03-11  |  6.6 KB  |  158 lines

  1. /*
  2.     A basic extension of the java.applet.Applet class
  3.  */
  4.  
  5. import java.awt.*;
  6. import java.applet.*;
  7.  
  8. import symantec.itools.awt.InvisibleButton;
  9. import symantec.itools.multimedia.SlideShow;
  10. import symantec.itools.awt.WrappingLabel;
  11. import symantec.itools.multimedia.ImageViewer;
  12. public class SlideShowIsle extends Applet
  13. {
  14.    
  15.     void invisibleButtonNextUnder_Action(java.awt.event.ActionEvent event) {
  16.  
  17.  
  18.         //{{CONNECTION
  19.         // Go to the SlideShow's next image
  20.         slideShowPhotos.nextImage();
  21.         //}}
  22.     }
  23.     void invisibleButtonPrevUnder_Action(java.awt.event.ActionEvent event) {
  24.  
  25.  
  26.         //{{CONNECTION
  27.         // Go to the SlideShow's previous image
  28.         slideShowPhotos.previousImage();
  29.         //}}
  30.     }
  31.     void slideShowPhotos_SlideChanged(java.awt.event.ActionEvent event) {
  32.  
  33.         //{{CONNECTION
  34.         // Set the text for WrappingLabel... Get current description
  35.         {
  36.         try
  37.             {
  38.             wrappingLabelDesc.setText(slideShowPhotos.getDescription(slideShowPhotos.getCurrentImageIndex()));
  39.             }
  40.         catch (java.beans.PropertyVetoException p)
  41.         {
  42.         }
  43.  
  44.         }
  45.         
  46.         //}}
  47.     }
  48.     void invisibleButtonNext_Action(java.awt.event.ActionEvent event) {
  49.  
  50.  
  51.         //{{CONNECTION
  52.         // Go to the SlideShow's next image
  53.         slideShowPhotos.nextImage();
  54.         //}}
  55.     }
  56.     void invisibleButtonPrev_Action(java.awt.event.ActionEvent event) {
  57.  
  58.  
  59.         //{{CONNECTION
  60.         // Go to the SlideShow's previous image
  61.         slideShowPhotos.previousImage();
  62.         //}}
  63.     }
  64.  
  65.  
  66.     
  67.     public void init()
  68.     {
  69.         // Take out this line if you don't use symantec.itools.net.RelativeURL or symantec.itools.awt.util.StatusScroller
  70.         symantec.itools.lang.Context.setApplet(this);
  71.     
  72.         // This code is automatically generated by Visual Cafe when you add
  73.         // components to the visual environment. It instantiates and initializes
  74.         // the components. To modify the code, only use code syntax that matches
  75.         // what Visual Cafe can generate, or Visual Cafe may be unable to back
  76.         // parse your Java file into its visual environment.
  77.         //{{INIT_CONTROLS
  78.         setLayout(null);
  79.         setSize(531,364);
  80.         invisibleButtonPrevUnder = new symantec.itools.awt.InvisibleButton();
  81.         invisibleButtonPrevUnder.setBounds(262,277,37,40);
  82.         add(invisibleButtonPrevUnder);
  83.         invisibleButtonNextUnder = new symantec.itools.awt.InvisibleButton();
  84.         invisibleButtonNextUnder.setBounds(305,272,40,44);
  85.         add(invisibleButtonNextUnder);
  86.         slideShowPhotos = new symantec.itools.multimedia.SlideShow();
  87.         try {
  88.             slideShowPhotos.addImageAndDescription(symantec.itools.net.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.");
  89.             slideShowPhotos.addImageAndDescription(symantec.itools.net.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.");
  90.             slideShowPhotos.addImageAndDescription(symantec.itools.net.RelativeURL.getURL("Images/PHOTO_3.GIF"), "At the top of Venduca volcano, you can safely watch the volcanic activity.");
  91.             slideShowPhotos.addImageAndDescription(symantec.itools.net.RelativeURL.getURL("Images/Photo_7.gif"), "The ocean pounds against rocks formed from past Venduca lava flows.");
  92.             slideShowPhotos.addImageAndDescription(symantec.itools.net.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.");
  93.             slideShowPhotos.addImageAndDescription(symantec.itools.net.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.");
  94.             slideShowPhotos.addImageAndDescription(symantec.itools.net.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.");
  95.             slideShowPhotos.addImageAndDescription(symantec.itools.net.RelativeURL.getURL("Images/Photo_6.gif"), "Moderna rose gardens bloom year-round.");
  96.         } catch (Exception e) { }
  97.         slideShowPhotos.setBounds(8,8,337,232);
  98.         add(slideShowPhotos);
  99.         imageViewerClicker = new symantec.itools.multimedia.ImageViewer();
  100.         try {
  101.             imageViewerClicker.setImageURL(symantec.itools.net.RelativeURL.getURL("Images/Clicker.gif"));
  102.         }
  103.         catch (java.net.MalformedURLException error) { }
  104.         catch(java.beans.PropertyVetoException e) { }
  105.         imageViewerClicker.setBounds(8,256,381,104);
  106.         add(imageViewerClicker);
  107.         invisibleButtonNext = new symantec.itools.awt.InvisibleButton();
  108.         invisibleButtonNext.setBounds(305,272,40,41);
  109.         add(invisibleButtonNext);
  110.         invisibleButtonPrev = new symantec.itools.awt.InvisibleButton();
  111.         invisibleButtonPrev.setBounds(264,273,35,43);
  112.         add(invisibleButtonPrev);
  113.         wrappingLabelDesc = new symantec.itools.awt.WrappingLabel();
  114.         try {
  115.             wrappingLabelDesc.setText("Pristine Bungbusi beaches are ideal for relaxing and for all kinds of water sports, including surfing, water skiing, and snorkeling.");
  116.         }
  117.         catch(java.beans.PropertyVetoException e) { }
  118.         wrappingLabelDesc.setBounds(352,24,175,212);
  119.         add(wrappingLabelDesc);
  120.         //}}
  121.     
  122.         //{{REGISTER_LISTENERS
  123.         Action lAction = new Action();
  124.         invisibleButtonPrev.addActionListener(lAction);
  125.         invisibleButtonNext.addActionListener(lAction);
  126.         slideShowPhotos.addActionListener(lAction);
  127.         invisibleButtonPrevUnder.addActionListener(lAction);
  128.         invisibleButtonNextUnder.addActionListener(lAction);
  129.         //}}
  130.     }
  131.     
  132.     //{{DECLARE_CONTROLS
  133.     symantec.itools.awt.InvisibleButton invisibleButtonPrevUnder;
  134.     symantec.itools.awt.InvisibleButton invisibleButtonNextUnder;
  135.     symantec.itools.multimedia.SlideShow slideShowPhotos;
  136.     symantec.itools.multimedia.ImageViewer imageViewerClicker;
  137.     symantec.itools.awt.InvisibleButton invisibleButtonNext;
  138.     symantec.itools.awt.InvisibleButton invisibleButtonPrev;
  139.     symantec.itools.awt.WrappingLabel wrappingLabelDesc;
  140.     //}}
  141.  
  142.     class Action implements java.awt.event.ActionListener {
  143.         public void actionPerformed(java.awt.event.ActionEvent event) {
  144.             Object object = event.getSource();
  145.             if (object == invisibleButtonPrev)
  146.                 invisibleButtonPrev_Action(event);
  147.             else if (object == invisibleButtonNext)
  148.                 invisibleButtonNext_Action(event);
  149.             else if (object == slideShowPhotos)
  150.                 slideShowPhotos_SlideChanged(event);
  151.             else if (object == invisibleButtonPrevUnder)
  152.                 invisibleButtonPrevUnder_Action(event);
  153.             else if (object == invisibleButtonNextUnder)
  154.                 invisibleButtonNextUnder_Action(event);
  155.         }
  156.     }
  157. }
  158.