home *** CD-ROM | disk | FTP | other *** search
/ Tutto per Internet / Internet.iso / soft95 / Html / qdiva / DESIGNER.SKL next >
Encoding:
Text File  |  1996-01-31  |  3.6 KB  |  143 lines

  1. ********************************************************
  2. **** Skeletons are pretty simple.
  3. ****
  4. **** // {{description (until it finds newline)
  5. ****   body of skeleton
  6. **** // }}
  7. ****
  8. **** Anything not bracketed by // {{ and // }} is ignored
  9. ****
  10. **** Note: There can be no spaces in the // {{ and // }} tokens.
  11. ****
  12. **** // {{{Description - start a new tree root
  13. ****
  14. **** If the body contains $SEL$, the current selection in the
  15. **** source code will be substituted.  For example:
  16. ****     <B>$SEL$$</B>
  17. **** will surround the selected text with HTML Bold tags
  18. ****
  19. **** Please send updated skeletons to : FRISKEL@INCH.COM and they
  20. **** will be available for all to use.
  21. ********************************************************
  22. *********************************************************
  23. //{{{Program templates with Designer Tags
  24. //{{Main program with a Frame 
  25.  
  26.  
  27. import java.awt.*;
  28.  
  29. //-------------------------------
  30. // Code generation by the Diva
  31. //-------------------------------
  32. public class $SEL$ extends Frame {
  33.     private boolean inAnApplet = true;
  34.     private boolean laidOut = false;
  35.     //{{StartDeclaration
  36.     //{{EndDeclaration
  37.     //-------------------------------
  38.     public $SEL$() {
  39.         super();
  40.         setLayout(null);
  41.         setFont(new Font("Helvetica", Font.PLAIN,10));
  42.         //{{StartConstruction
  43.         //{{EndConstruction
  44.     }
  45.     //-------------------------------
  46.     //{{StartHandlers
  47.     
  48.     //-------------------------------
  49.     public void reshapeControls(Graphics g) {
  50.         if (!laidOut) {
  51.             Insets insets = insets();
  52.             insets = insets();
  53.             //{{StartReshape
  54.             //{{EndReshape
  55.             laidOut = true;
  56.             }
  57.         }
  58.     //-------------------------------
  59.     public void paint(Graphics g) {
  60.         reshapeControls(g);
  61.         //ToDo: Add you paint code...
  62.         }
  63.     //-------------------------------
  64.     public synchronized boolean handleEvent(Event e) {
  65.         //{{StartEventTriggers
  66.         //{{EndEventTriggers
  67.         if (e.id == Event.WINDOW_DESTROY) {
  68.             if (inAnApplet) {
  69.                 dispose();
  70.                 return false;
  71.             } else {
  72.                 System.exit(0);
  73.             }
  74.          }
  75.         return super.handleEvent(e);
  76.     }
  77.     public static void main(String args[]) {
  78.         $SEL$ window = new $SEL$();
  79.         Insets insets = window.insets();
  80.         window.inAnApplet = false;
  81.         window.setTitle("NoneWindow Application");
  82.         window.resize(250 + insets.left + insets.right,
  83.             250 + insets.top + insets.bottom);
  84.         window.show();
  85.     }
  86. }
  87.  
  88. //}}
  89. ******************************************************************
  90. //{{Basic Applet 
  91.  
  92.  
  93. import java.awt.*;
  94.  
  95. //-------------------------------
  96. public class $SEL$ extends java.applet.Applet {
  97.     private boolean laidOut = false;
  98.     //{{StartDeclaration
  99.     //{{EndDeclaration
  100.     //-------------------------------
  101.         public void init() {
  102.                 setLayout(null);
  103.                 setFont(new Font("Helvetica", Font.PLAIN,10));
  104.                 resize(250 , 250) ;
  105.         //{{StartConstruction
  106.         //{{EndConstruction
  107.     }
  108.     //-------------------------------
  109.     //{{StartHandlers
  110.     
  111.     //-------------------------------
  112.     public void reshapeControls(Graphics g) {
  113.         if (!laidOut) {
  114.             Insets insets = insets();
  115.             insets = insets();
  116.             //{{StartReshape
  117.             //{{EndReshape
  118.             laidOut = true;
  119.             }
  120.         }
  121.     //-------------------------------
  122.     public void paint(Graphics g) {
  123.         reshapeControls(g);
  124.         //ToDo: Add you paint code...
  125.         }
  126.         
  127.     //-------------------------------
  128.     public synchronized boolean handleEvent(Event e) {
  129.         //{{StartEventTriggers
  130.         //{{EndEventTriggers
  131.  
  132.                  //Todo: Handle events here
  133.                  if (e.id == Event.MOUSE_MOVE) {
  134.  
  135.                  }
  136.  
  137.         return super.handleEvent(e);
  138.     }
  139. }
  140.  
  141. //}}
  142.  
  143.