home *** CD-ROM | disk | FTP | other *** search
Java Source | 1997-09-01 | 4.0 KB | 131 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 {
- java.net.URL[] tempURL = new java.net.URL[2];
- tempURL[0] = symantec.itools.net.RelativeURL.getURL("1.gif");
- tempURL[1] = symantec.itools.net.RelativeURL.getURL("10.gif");
- animator1.setImageList(tempURL);
- }
- catch (java.net.MalformedURLException error) { }
- catch(java.beans.PropertyVetoException e) { }
- animator1.setBounds(91,4,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.setTickFreq(10);
- }
- catch(java.beans.PropertyVetoException e) { }
- verticalSlider1.setBounds(0,94,535,184);
- 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,278,535,93);
- 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) { }
- }
- //}}
- }
- }