home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 14 / IOPROG_14.ISO / soft / sdkjava / sdkjava.exe / SDKJava.cab / AFC102 / Samples / LoanCalc / Src / LCInsetPanel.java < prev    next >
Encoding:
Java Source  |  1998-03-05  |  2.3 KB  |  116 lines

  1. //
  2. // (c) 1997 Microsoft Corporation.  All rights reserved.
  3. //
  4. import java.awt.Insets;
  5. import com.ms.ui.*;
  6.  
  7. public class LCInsetPanel extends UIPanel
  8. {
  9.     private int t,l,b,r;
  10.  
  11.     public LCInsetPanel() { this(0,0,0,0); }
  12.  
  13.     public LCInsetPanel(int t, int l, int b, int r)
  14.     { 
  15.         super();
  16.         this.t = t; this.l = l; this.b = b; this.r = r;
  17.     }
  18.  
  19.     public Insets getInsets() { return new Insets(t,l,b,r); }
  20. }
  21.  
  22. class BL extends LCInsetPanel
  23. {
  24.     public BL() { this(0,0,0,0); }
  25.  
  26.     public BL(IUIComponent comp) { this(comp,0,0,0,0); }
  27.  
  28.     public BL(IUIComponent comp, int t, int l, int b, int r)
  29.     { 
  30.         this(t,l,b,r);
  31.         add(comp, "center");
  32.     }
  33.  
  34.     public BL(int t, int l, int b, int r)
  35.     { 
  36.         super(t,l,b,r);
  37.         setLayout(new UIBorderLayout());
  38.     }
  39. }
  40.  
  41. class HSL extends LCInsetPanel
  42. {
  43.     public HSL() { this(100, 0,0,0,0); }
  44.  
  45.     public HSL(IUIComponent compnw, IUIComponent compse)
  46.     {
  47.         this(compnw, compse, 100, 0,0,0,0);
  48.     }
  49.  
  50.     public HSL(IUIComponent compnw, IUIComponent compse, int split)
  51.     {
  52.         this(compnw, compse, split, 0,0,0,0);
  53.     }
  54.  
  55.     public HSL(IUIComponent compnw, IUIComponent compse,
  56.                                 int split, int t, int l, int b, int r)
  57.     { 
  58.         this(split, t,l,b,r);
  59.         add(compnw, "nw");
  60.         add(compse, "se");
  61.     }
  62.  
  63.     public HSL(int split, int t, int l, int b, int r)
  64.     { 
  65.         super(t,l,b,r);
  66.         setLayout(new UISplitLayout(UISplitLayout.HORIZONTAL, split));
  67.     }
  68. }
  69.  
  70. class VSL extends LCInsetPanel
  71. {
  72.     public VSL() { this(100, 0,0,0,0); }
  73.  
  74.     public VSL(IUIComponent compnw, IUIComponent compse)
  75.     {
  76.         this(compnw, compse, 100, 0,0,0,0);
  77.     }
  78.  
  79.     public VSL(IUIComponent compnw, IUIComponent compse, int split)
  80.     {
  81.         this(compnw, compse, split, 0,0,0,0);
  82.     }
  83.  
  84.     public VSL(IUIComponent compnw, IUIComponent compse,
  85.                                 int split, int t, int l, int b, int r)
  86.     { 
  87.         this(split, t,l,b,r);
  88.         add(compnw, "nw");
  89.         add(compse, "se");
  90.     }
  91.  
  92.     public VSL(int split, int t, int l, int b, int r)
  93.     { 
  94.         super(t,l,b,r);
  95.         setLayout(new UISplitLayout(0, split));
  96.     }
  97. }
  98.  
  99. class FocusUIPanel extends UIPanel
  100. {
  101.     private boolean firsttime;
  102.     private LCCallbacks callback;
  103.  
  104.     public FocusUIPanel() { super(); firsttime = true; }
  105.  
  106.     public void addNotify()
  107.     {
  108.         super.addNotify();
  109.         if( firsttime ) { firsttime = false; setFocus(); }
  110.     }
  111.  
  112.     // This method will be overridden by subclasses of FocusUIPanel who desire 
  113.     //  setting focus
  114.     public void setFocus() { }
  115. }
  116.