home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-02-26 | 6.4 KB | 174 lines |
- /*
- A basic extension of the java.applet.Applet class
- */
-
- import java.awt.*;
- import java.applet.*;
-
- import symantec.itools.multimedia.Animator;
- import symantec.itools.awt.Label3D;
- import symantec.itools.awt.VerticalSlider;
- import symantec.itools.multimedia.*;
- import symantec.itools.awt.*;
- public class AnimatorClass extends Applet
- {
-
- public void init()
- {
- // Take out this line if you don't use symantec.itools.net.RelativeURL or symantec.itools.awt.util.StatusScroller
- symantec.itools.lang.Context.setApplet(this);
-
- // This code is automatically generated by Visual Cafe when you add
- // components to the visual environment. It instantiates and initializes
- // the components. To modify the code, only use code syntax that matches
- // what Visual Cafe can generate, or Visual Cafe may be unable to back
- // parse your Java file into its visual environment.
- //{{INIT_CONTROLS
- GridBagLayout gridBagLayout;
- gridBagLayout = new GridBagLayout();
- setLayout(gridBagLayout);
- setSize(535,372);
- setFont(new Font("Dialog", Font.PLAIN, 12));
- setForeground(new Color(0));
- setBackground(new Color(-19200));
- animator1 = new symantec.itools.multimedia.Animator();
- try {
- animator1.setDelay(100);
- }
- catch(java.beans.PropertyVetoException e) { }
- try {
- java.net.URL[] tempURL = new java.net.URL[37];
- tempURL[0] = symantec.itools.net.RelativeURL.getURL("1.GIF");
- tempURL[1] = symantec.itools.net.RelativeURL.getURL("2.GIF");
- tempURL[2] = symantec.itools.net.RelativeURL.getURL("3.GIF");
- tempURL[3] = symantec.itools.net.RelativeURL.getURL("4.GIF");
- tempURL[4] = symantec.itools.net.RelativeURL.getURL("5.GIF");
- tempURL[5] = symantec.itools.net.RelativeURL.getURL("6.GIF");
- tempURL[6] = symantec.itools.net.RelativeURL.getURL("7.GIF");
- tempURL[7] = symantec.itools.net.RelativeURL.getURL("8.GIF");
- tempURL[8] = symantec.itools.net.RelativeURL.getURL("9.GIF");
- tempURL[9] = symantec.itools.net.RelativeURL.getURL("10.GIF");
- tempURL[10] = symantec.itools.net.RelativeURL.getURL("11.GIF");
- tempURL[11] = symantec.itools.net.RelativeURL.getURL("12.GIF");
- tempURL[12] = symantec.itools.net.RelativeURL.getURL("13.GIF");
- tempURL[13] = symantec.itools.net.RelativeURL.getURL("14.GIF");
- tempURL[14] = symantec.itools.net.RelativeURL.getURL("15.GIF");
- tempURL[15] = symantec.itools.net.RelativeURL.getURL("16.GIF");
- tempURL[16] = symantec.itools.net.RelativeURL.getURL("17.GIF");
- tempURL[17] = symantec.itools.net.RelativeURL.getURL("18.GIF");
- tempURL[18] = symantec.itools.net.RelativeURL.getURL("19.GIF");
- tempURL[19] = symantec.itools.net.RelativeURL.getURL("20.GIF");
- tempURL[20] = symantec.itools.net.RelativeURL.getURL("21.GIF");
- tempURL[21] = symantec.itools.net.RelativeURL.getURL("22.GIF");
- tempURL[22] = symantec.itools.net.RelativeURL.getURL("23.GIF");
- tempURL[23] = symantec.itools.net.RelativeURL.getURL("24.GIF");
- tempURL[24] = symantec.itools.net.RelativeURL.getURL("25.GIF");
- tempURL[25] = symantec.itools.net.RelativeURL.getURL("26.GIF");
- tempURL[26] = symantec.itools.net.RelativeURL.getURL("27.GIF");
- tempURL[27] = symantec.itools.net.RelativeURL.getURL("28.GIF");
- tempURL[28] = symantec.itools.net.RelativeURL.getURL("29.GIF");
- tempURL[29] = symantec.itools.net.RelativeURL.getURL("30.GIF");
- tempURL[30] = symantec.itools.net.RelativeURL.getURL("31.GIF");
- tempURL[31] = symantec.itools.net.RelativeURL.getURL("32.GIF");
- tempURL[32] = symantec.itools.net.RelativeURL.getURL("33.GIF");
- tempURL[33] = symantec.itools.net.RelativeURL.getURL("34.GIF");
- tempURL[34] = symantec.itools.net.RelativeURL.getURL("35.GIF");
- tempURL[35] = symantec.itools.net.RelativeURL.getURL("36.GIF");
- tempURL[36] = symantec.itools.net.RelativeURL.getURL("37.GIF");
- animator1.setImageList(tempURL);
- }
- catch (java.net.MalformedURLException error) { }
- catch(java.beans.PropertyVetoException e) { }
- animator1.setBounds(91,-1,353,86);
- GridBagConstraints gbc;
- gbc = new GridBagConstraints();
- gbc.gridx = 0;
- gbc.gridy = 0;
- gbc.weightx = 1.0;
- gbc.weighty = 1.0;
- gbc.fill = GridBagConstraints.NONE;
- gbc.insets = new Insets(0,0,0,0);
- ((GridBagLayout)getLayout()).setConstraints(animator1, gbc);
- add(animator1);
- verticalSlider1 = new symantec.itools.awt.VerticalSlider();
- try {
- verticalSlider1.setMaxValue(200);
- }
- catch(java.beans.PropertyVetoException e) { }
- try {
- verticalSlider1.setValue(100);
- }
- catch(java.beans.PropertyVetoException e) { }
- try {
- verticalSlider1.setTickFreq(10);
- }
- catch(java.beans.PropertyVetoException e) { }
- verticalSlider1.setBounds(0,85,535,202);
- gbc = new GridBagConstraints();
- gbc.gridx = 0;
- gbc.gridy = 1;
- gbc.weightx = 1.0;
- gbc.weighty = 1.0;
- gbc.fill = GridBagConstraints.BOTH;
- gbc.insets = new Insets(0,0,0,0);
- ((GridBagLayout)getLayout()).setConstraints(verticalSlider1, gbc);
- add(verticalSlider1);
- label3D1 = new symantec.itools.awt.Label3D();
- try {
- label3D1.setText("Visual Cafe");
- }
- catch(java.beans.PropertyVetoException e) { }
- try {
- label3D1.setBorderIndent(symantec.itools.awt.Label3D.INDENT_TWO);
- }
- catch(java.beans.PropertyVetoException e) { }
- label3D1.setBounds(0,287,535,86);
- label3D1.setFont(new Font("TimesRoman", Font.PLAIN, 64));
- gbc = new GridBagConstraints();
- gbc.gridx = 0;
- gbc.gridy = 2;
- gbc.weightx = 1.0;
- gbc.weighty = 1.0;
- gbc.fill = GridBagConstraints.BOTH;
- gbc.insets = new Insets(0,0,0,0);
- ((GridBagLayout)getLayout()).setConstraints(label3D1, gbc);
- add(label3D1);
- //}}
-
- //{{REGISTER_LISTENERS
- Action lAction = new Action();
- verticalSlider1.addActionListener(lAction);
- //}}
- }
-
- //{{DECLARE_CONTROLS
- symantec.itools.multimedia.Animator animator1;
- symantec.itools.awt.VerticalSlider verticalSlider1;
- symantec.itools.awt.Label3D label3D1;
- //}}
-
- class Action implements java.awt.event.ActionListener
- {
- public void actionPerformed(java.awt.event.ActionEvent event)
- {
- Object object = event.getSource();
- if (object == verticalSlider1)
- verticalSlider1_actionPerformed(event);
- }
- }
-
- void verticalSlider1_actionPerformed(java.awt.event.ActionEvent event)
- {
- // to do: code goes here.
-
- //{{CONNECTION
- // Set the delay amount... Get the current value of the VerticalSlider
- {
- try {
- animator1.setDelay(verticalSlider1.getValue());
- }
- catch(java.beans.PropertyVetoException e) { }
- }
- //}}
- }
- }