home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / VCafe / prosrc.bin / FrameTestData.java < prev    next >
Encoding:
Java Source  |  1998-03-18  |  2.9 KB  |  120 lines

  1. /*
  2.     A basic extension of the java.awt.Frame class
  3.  */
  4. package symantec.itools.db.beans.jdbc;
  5. import java.awt.*;
  6.  
  7.  
  8. import symantec.itools.awt.WrappingLabel;
  9.  
  10. public class FrameTestData extends Frame
  11. {
  12.     public FrameTestData()
  13.     {
  14.         // This code is automatically generated by Visual Cafe when you add
  15.         // components to the visual environment. It instantiates and initializes
  16.         // the components. To modify the code, only use code syntax that matches
  17.         // what Visual Cafe can generate, or Visual Cafe may be unable to back
  18.         // parse your Java file into its visual environment.
  19.         //{{INIT_CONTROLS
  20.         setLayout(null);
  21.         setVisible(false);
  22.         setSize(insets().left + insets().right + 430,insets().top + insets().bottom + 270);
  23.         list1 = new java.awt.List(0,false);
  24.         add(list1);
  25.         list1.setBounds(insets().left + 12,insets().top + 96,411,169);
  26.         wrappingLabel1 = new symantec.itools.awt.WrappingLabel();
  27.         wrappingLabel1.setBounds(insets().left + 12,insets().top + 12,409,72);
  28.         add(wrappingLabel1);
  29.         setTitle("Untitled");
  30.         //}}
  31.  
  32.         //{{INIT_MENUS
  33.         //}}
  34.  
  35.         //{{REGISTER_LISTENERS
  36.         SymWindow aSymWindow = new SymWindow();
  37.         this.addWindowListener(aSymWindow);
  38.         //}}
  39.  
  40. }
  41.  
  42.     public FrameTestData(String title)
  43.     {
  44.         this();
  45.         setTitle(title);
  46.     }
  47.  
  48.     public synchronized void show()
  49.     {
  50.         move(50, 50);
  51.         super.show();
  52.     }
  53.  
  54.     public void addNotify()
  55.     {
  56.         // Record the size of the window prior to calling parents addNotify.
  57.         Dimension d = getSize();
  58.  
  59.         super.addNotify();
  60.  
  61.         if (fComponentsAdjusted)
  62.             return;
  63.  
  64.         // Adjust components according to the insets
  65.         setSize(insets().left + insets().right + d.width, insets().top + insets().bottom + d.height);
  66.         Component components[] = getComponents();
  67.         for (int i = 0; i < components.length; i++)
  68.         {
  69.             Point p = components[i].getLocation();
  70.             p.translate(insets().left, insets().top);
  71.             components[i].setLocation(p);
  72.         }
  73.         fComponentsAdjusted = true;
  74.     }
  75.  
  76.     // Used for addNotify check.
  77.     boolean fComponentsAdjusted = false;
  78.  
  79.  
  80.  
  81.     //{{DECLARE_MENUS
  82.     //}}
  83.  
  84.     class SymWindow extends java.awt.event.WindowAdapter
  85.     {
  86.         public void windowClosing(java.awt.event.WindowEvent event)
  87.         {
  88.             Object object = event.getSource();
  89.             if (object == FrameTestData.this)
  90.                 Frame1_WindowClosing(event);
  91.         }
  92.     }
  93.  
  94.     void Frame1_WindowClosing(java.awt.event.WindowEvent event)
  95.     {
  96.         hide();         // hide the Frame
  97.     }
  98.     public void fillSqlStatement(String sqlStat){
  99.         try{
  100.         wrappingLabel1.setText(sqlStat);
  101.         wrappingLabel1.repaint();
  102.         }
  103.         catch(Exception e){}
  104.     }
  105.     public void fillData(String[] data){
  106.         int length=data.length;
  107.         list1.clear();
  108.         for(int i=0;i<length;i++)
  109.             list1.addItem(data[i]);
  110.         list1.repaint();
  111.     }
  112.  
  113.     //{{DECLARE_CONTROLS
  114.     java.awt.List list1;
  115.     symantec.itools.awt.WrappingLabel wrappingLabel1;
  116.     //}}
  117.     //{{DECLARE_MENUS
  118.     //}}
  119. }
  120.