home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / VCafe / WDESAMPL.BIN / AnimatorClass.java < prev    next >
Encoding:
Java Source  |  1998-02-26  |  6.4 KB  |  174 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.multimedia.Animator;
  9. import symantec.itools.awt.Label3D;
  10. import symantec.itools.awt.VerticalSlider;
  11. import symantec.itools.multimedia.*;
  12. import symantec.itools.awt.*;
  13. public class AnimatorClass extends Applet
  14. {
  15.  
  16.     public void init()
  17.     {
  18.         // Take out this line if you don't use symantec.itools.net.RelativeURL or symantec.itools.awt.util.StatusScroller
  19.         symantec.itools.lang.Context.setApplet(this);
  20.  
  21.         // This code is automatically generated by Visual Cafe when you add
  22.         // components to the visual environment. It instantiates and initializes
  23.         // the components. To modify the code, only use code syntax that matches
  24.         // what Visual Cafe can generate, or Visual Cafe may be unable to back
  25.         // parse your Java file into its visual environment.
  26.         //{{INIT_CONTROLS
  27.         GridBagLayout gridBagLayout;
  28.         gridBagLayout = new GridBagLayout();
  29.         setLayout(gridBagLayout);
  30.         setSize(535,372);
  31.         setFont(new Font("Dialog", Font.PLAIN, 12));
  32.         setForeground(new Color(0));
  33.         setBackground(new Color(-19200));
  34.         animator1 = new symantec.itools.multimedia.Animator();
  35.         try {
  36.             animator1.setDelay(100);
  37.         }
  38.         catch(java.beans.PropertyVetoException e) { }
  39.         try {
  40.             java.net.URL[] tempURL = new java.net.URL[37];
  41.             tempURL[0] = symantec.itools.net.RelativeURL.getURL("1.GIF");
  42.             tempURL[1] = symantec.itools.net.RelativeURL.getURL("2.GIF");
  43.             tempURL[2] = symantec.itools.net.RelativeURL.getURL("3.GIF");
  44.             tempURL[3] = symantec.itools.net.RelativeURL.getURL("4.GIF");
  45.             tempURL[4] = symantec.itools.net.RelativeURL.getURL("5.GIF");
  46.             tempURL[5] = symantec.itools.net.RelativeURL.getURL("6.GIF");
  47.             tempURL[6] = symantec.itools.net.RelativeURL.getURL("7.GIF");
  48.             tempURL[7] = symantec.itools.net.RelativeURL.getURL("8.GIF");
  49.             tempURL[8] = symantec.itools.net.RelativeURL.getURL("9.GIF");
  50.             tempURL[9] = symantec.itools.net.RelativeURL.getURL("10.GIF");
  51.             tempURL[10] = symantec.itools.net.RelativeURL.getURL("11.GIF");
  52.             tempURL[11] = symantec.itools.net.RelativeURL.getURL("12.GIF");
  53.             tempURL[12] = symantec.itools.net.RelativeURL.getURL("13.GIF");
  54.             tempURL[13] = symantec.itools.net.RelativeURL.getURL("14.GIF");
  55.             tempURL[14] = symantec.itools.net.RelativeURL.getURL("15.GIF");
  56.             tempURL[15] = symantec.itools.net.RelativeURL.getURL("16.GIF");
  57.             tempURL[16] = symantec.itools.net.RelativeURL.getURL("17.GIF");
  58.             tempURL[17] = symantec.itools.net.RelativeURL.getURL("18.GIF");
  59.             tempURL[18] = symantec.itools.net.RelativeURL.getURL("19.GIF");
  60.             tempURL[19] = symantec.itools.net.RelativeURL.getURL("20.GIF");
  61.             tempURL[20] = symantec.itools.net.RelativeURL.getURL("21.GIF");
  62.             tempURL[21] = symantec.itools.net.RelativeURL.getURL("22.GIF");
  63.             tempURL[22] = symantec.itools.net.RelativeURL.getURL("23.GIF");
  64.             tempURL[23] = symantec.itools.net.RelativeURL.getURL("24.GIF");
  65.             tempURL[24] = symantec.itools.net.RelativeURL.getURL("25.GIF");
  66.             tempURL[25] = symantec.itools.net.RelativeURL.getURL("26.GIF");
  67.             tempURL[26] = symantec.itools.net.RelativeURL.getURL("27.GIF");
  68.             tempURL[27] = symantec.itools.net.RelativeURL.getURL("28.GIF");
  69.             tempURL[28] = symantec.itools.net.RelativeURL.getURL("29.GIF");
  70.             tempURL[29] = symantec.itools.net.RelativeURL.getURL("30.GIF");
  71.             tempURL[30] = symantec.itools.net.RelativeURL.getURL("31.GIF");
  72.             tempURL[31] = symantec.itools.net.RelativeURL.getURL("32.GIF");
  73.             tempURL[32] = symantec.itools.net.RelativeURL.getURL("33.GIF");
  74.             tempURL[33] = symantec.itools.net.RelativeURL.getURL("34.GIF");
  75.             tempURL[34] = symantec.itools.net.RelativeURL.getURL("35.GIF");
  76.             tempURL[35] = symantec.itools.net.RelativeURL.getURL("36.GIF");
  77.             tempURL[36] = symantec.itools.net.RelativeURL.getURL("37.GIF");
  78.             animator1.setImageList(tempURL);
  79.         }
  80.         catch (java.net.MalformedURLException error) { }
  81.         catch(java.beans.PropertyVetoException e) { }
  82.         animator1.setBounds(91,-1,353,86);
  83.         GridBagConstraints gbc;
  84.         gbc = new GridBagConstraints();
  85.         gbc.gridx = 0;
  86.         gbc.gridy = 0;
  87.         gbc.weightx = 1.0;
  88.         gbc.weighty = 1.0;
  89.         gbc.fill = GridBagConstraints.NONE;
  90.         gbc.insets = new Insets(0,0,0,0);
  91.         ((GridBagLayout)getLayout()).setConstraints(animator1, gbc);
  92.         add(animator1);
  93.         verticalSlider1 = new symantec.itools.awt.VerticalSlider();
  94.         try {
  95.             verticalSlider1.setMaxValue(200);
  96.         }
  97.         catch(java.beans.PropertyVetoException e) { }
  98.         try {
  99.             verticalSlider1.setValue(100);
  100.         }
  101.         catch(java.beans.PropertyVetoException e) { }
  102.         try {
  103.             verticalSlider1.setTickFreq(10);
  104.         }
  105.         catch(java.beans.PropertyVetoException e) { }
  106.         verticalSlider1.setBounds(0,85,535,202);
  107.         gbc = new GridBagConstraints();
  108.         gbc.gridx = 0;
  109.         gbc.gridy = 1;
  110.         gbc.weightx = 1.0;
  111.         gbc.weighty = 1.0;
  112.         gbc.fill = GridBagConstraints.BOTH;
  113.         gbc.insets = new Insets(0,0,0,0);
  114.         ((GridBagLayout)getLayout()).setConstraints(verticalSlider1, gbc);
  115.         add(verticalSlider1);
  116.         label3D1 = new symantec.itools.awt.Label3D();
  117.         try {
  118.             label3D1.setText("Visual Cafe");
  119.         }
  120.         catch(java.beans.PropertyVetoException e) { }
  121.         try {
  122.             label3D1.setBorderIndent(symantec.itools.awt.Label3D.INDENT_TWO);
  123.         }
  124.         catch(java.beans.PropertyVetoException e) { }
  125.         label3D1.setBounds(0,287,535,86);
  126.         label3D1.setFont(new Font("TimesRoman", Font.PLAIN, 64));
  127.         gbc = new GridBagConstraints();
  128.         gbc.gridx = 0;
  129.         gbc.gridy = 2;
  130.         gbc.weightx = 1.0;
  131.         gbc.weighty = 1.0;
  132.         gbc.fill = GridBagConstraints.BOTH;
  133.         gbc.insets = new Insets(0,0,0,0);
  134.         ((GridBagLayout)getLayout()).setConstraints(label3D1, gbc);
  135.         add(label3D1);
  136.         //}}
  137.     
  138.         //{{REGISTER_LISTENERS
  139.         Action lAction = new Action();
  140.         verticalSlider1.addActionListener(lAction);
  141.         //}}
  142.     }
  143.  
  144.     //{{DECLARE_CONTROLS
  145.     symantec.itools.multimedia.Animator animator1;
  146.     symantec.itools.awt.VerticalSlider verticalSlider1;
  147.     symantec.itools.awt.Label3D label3D1;
  148.     //}}
  149.  
  150.     class Action implements java.awt.event.ActionListener
  151.     {
  152.         public void actionPerformed(java.awt.event.ActionEvent event)
  153.         {
  154.             Object object = event.getSource();
  155.             if (object == verticalSlider1)
  156.                 verticalSlider1_actionPerformed(event);
  157.         }
  158.     }
  159.  
  160.     void verticalSlider1_actionPerformed(java.awt.event.ActionEvent event)
  161.     {
  162.         // to do: code goes here.
  163.              
  164.         //{{CONNECTION
  165.         // Set the delay amount... Get the current value of the VerticalSlider
  166.         {
  167.             try {
  168.                 animator1.setDelay(verticalSlider1.getValue());
  169.             }
  170.             catch(java.beans.PropertyVetoException e) { }
  171.         }
  172.         //}}
  173.     }
  174. }