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.java < prev    next >
Encoding:
Java Source  |  1998-03-11  |  6.5 KB  |  156 lines

  1. /*
  2.     A basic extension of the java.applet.Applet class
  3.  */
  4.  
  5. import java.awt.*;
  6. import java.applet.*;
  7. import symantec.itools.awt.*;
  8.  
  9. import symantec.itools.awt.InvisibleButton;
  10. import symantec.itools.awt.WrappingLabel;
  11. import symantec.itools.multimedia.ImageViewer;
  12. import symantec.itools.multimedia.*;
  13. import symantec.itools.multimedia.SlideShow;
  14. public class SlideShowIsle extends Applet {
  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.     public void addNotify() {
  67.         super.addNotify();
  68.  
  69.         // Take out this line if you don't use symantec.itools.net.RelativeURL
  70.         symantec.itools.lang.Context.setDocumentBase(getDocumentBase());
  71.  
  72.         //{{INIT_CONTROLS
  73.         setLayout(null);
  74.         setSize(531,365);
  75.         setFont(new Font("Dialog", Font.PLAIN, 12));
  76.         setForeground(new Color(0));
  77.         setBackground(new Color(16777215));
  78.         invisibleButtonPrevUnder = new symantec.itools.awt.InvisibleButton();
  79.         invisibleButtonPrevUnder.setBounds(262,277,37,40);
  80.         add(invisibleButtonPrevUnder);
  81.         invisibleButtonNextUnder = new symantec.itools.awt.InvisibleButton();
  82.         invisibleButtonNextUnder.setBounds(305,272,40,44);
  83.         add(invisibleButtonNextUnder);
  84.         slideShowPhotos = new symantec.itools.multimedia.SlideShow();
  85.         try {
  86.             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.");
  87.             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.");
  88.             slideShowPhotos.addImageAndDescription(symantec.itools.net.RelativeURL.getURL("Images/PHOTO_3.GIF"), "At the top of Venduca volcano, you can safely watch the volcanic activity.");
  89.             slideShowPhotos.addImageAndDescription(symantec.itools.net.RelativeURL.getURL("Images/Photo_7.gif"), "The ocean pounds against rocks formed from past Venduca lava flows.");
  90.             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.");
  91.             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.");
  92.             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.");
  93.             slideShowPhotos.addImageAndDescription(symantec.itools.net.RelativeURL.getURL("Images/Photo_6.gif"), "Moderna rose gardens bloom year-round.");
  94.         } catch (Exception e) { }
  95.         slideShowPhotos.setBounds(8,8,337,232);
  96.         add(slideShowPhotos);
  97.         imageViewerClicker = new symantec.itools.multimedia.ImageViewer();
  98.         try {
  99.             imageViewerClicker.setURL(symantec.itools.net.RelativeURL.getURL("Images/Clicker.gif"));
  100.         }
  101.         catch (java.net.MalformedURLException error) { }
  102.         catch(java.beans.PropertyVetoException e) { }
  103.         imageViewerClicker.setBounds(8,256,381,104);
  104.         add(imageViewerClicker);
  105.         invisibleButtonNext = new symantec.itools.awt.InvisibleButton();
  106.         invisibleButtonNext.setBounds(305,272,40,41);
  107.         add(invisibleButtonNext);
  108.         invisibleButtonPrev = new symantec.itools.awt.InvisibleButton();
  109.         invisibleButtonPrev.setBounds(264,273,35,43);
  110.         add(invisibleButtonPrev);
  111.         wrappingLabelDesc = new symantec.itools.awt.WrappingLabel();
  112.         try {
  113.             wrappingLabelDesc.setText("Pristine Bungbusi beaches are ideal for relaxing and for all kinds of water sports, including surfing, water skiing, and snorkeling.");
  114.         }
  115.         catch(java.beans.PropertyVetoException e) { }
  116.         wrappingLabelDesc.setBounds(352,24,175,212);
  117.         add(wrappingLabelDesc);
  118.         //}}
  119.  
  120.         //{{REGISTER_LISTENERS
  121.         Action lAction = new Action();
  122.         invisibleButtonPrev.addActionListener(lAction);
  123.         invisibleButtonNext.addActionListener(lAction);
  124.         slideShowPhotos.addActionListener(lAction);
  125.         invisibleButtonPrevUnder.addActionListener(lAction);
  126.         invisibleButtonNextUnder.addActionListener(lAction);
  127.         //}}
  128.     }
  129.  
  130.     //{{DECLARE_CONTROLS
  131.     symantec.itools.awt.InvisibleButton invisibleButtonPrevUnder;
  132.     symantec.itools.awt.InvisibleButton invisibleButtonNextUnder;
  133.     symantec.itools.multimedia.SlideShow slideShowPhotos;
  134.     symantec.itools.multimedia.ImageViewer imageViewerClicker;
  135.     symantec.itools.awt.InvisibleButton invisibleButtonNext;
  136.     symantec.itools.awt.InvisibleButton invisibleButtonPrev;
  137.     symantec.itools.awt.WrappingLabel wrappingLabelDesc;
  138.     //}}
  139.  
  140.     class Action implements java.awt.event.ActionListener {
  141.         public void actionPerformed(java.awt.event.ActionEvent event) {
  142.             Object object = event.getSource();
  143.             if (object == invisibleButtonPrev)
  144.                 invisibleButtonPrev_Action(event);
  145.             else if (object == invisibleButtonNext)
  146.                 invisibleButtonNext_Action(event);
  147.             else if (object == slideShowPhotos)
  148.                 slideShowPhotos_SlideChanged(event);
  149.             else if (object == invisibleButtonPrevUnder)
  150.                 invisibleButtonPrevUnder_Action(event);
  151.             else if (object == invisibleButtonNextUnder)
  152.                 invisibleButtonNextUnder_Action(event);
  153.         }
  154.     }
  155. }
  156.