home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 14 / IOPROG_14.ISO / soft / sdkjava / sdkjava.exe / SDKJava.cab / Samples / AFC / Puzzle15 / Src / SDKInsetPanel.java < prev   
Encoding:
Java Source  |  1998-03-05  |  2.2 KB  |  99 lines

  1. //
  2. // (c) 1998 Microsoft Corporation.  All rights reserved.
  3. //
  4. import java.awt.Insets;
  5. import com.ms.ui.*;
  6.  
  7. public class SDKInsetPanel extends UIPanel
  8. {
  9.     private int t,l,b,r;
  10.  
  11.     public SDKInsetPanel() { this(0,0,0,0); }
  12.  
  13.     public SDKInsetPanel(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 SDKInsetPanelVFL extends SDKInsetPanel
  23. {
  24.     public SDKInsetPanelVFL(int t, int l, int b, int r)
  25.     { 
  26.         super(t,l,b,r);
  27.         setLayout(new UIVerticalFlowLayout(UIVerticalFlowLayout.FILL, 0));
  28.     }
  29. }
  30.  
  31. class SDKInsetPanelGL extends SDKInsetPanel
  32. {
  33.     public SDKInsetPanelGL(int t, int l, int b, int r)
  34.     { 
  35.         super(t,l,b,r);
  36.         setLayout(new UIGridLayout(0, 1, 0, 1));
  37.     }
  38. }
  39.  
  40. class SDKInsetPanelBL extends SDKInsetPanel
  41. {
  42.     public SDKInsetPanelBL() { this(0,0,0,0); }
  43.  
  44.     public SDKInsetPanelBL(IUIComponent comp) { this(comp,0,0,0,0); }
  45.  
  46.     public SDKInsetPanelBL(IUIComponent comp, int t, int l, int b, int r)
  47.     { 
  48.         this(t,l,b,r);
  49.         add(comp, "center");
  50.     }
  51.  
  52.     public SDKInsetPanelBL(int t, int l, int b, int r)
  53.     { 
  54.         super(t,l,b,r);
  55.         setLayout(new UIBorderLayout());
  56.     }
  57. }
  58.  
  59. class SDKInsetPanelHSL extends SDKInsetPanel
  60. {
  61.     public SDKInsetPanelHSL() { this(100, 0,0,0,0); }
  62.  
  63.     public SDKInsetPanelHSL(IUIComponent compnw, IUIComponent compse)
  64.     {
  65.         this(compnw, compse, 100, 0,0,0,0);
  66.     }
  67.  
  68.     public SDKInsetPanelHSL(IUIComponent compnw, IUIComponent compse, int split)
  69.     {
  70.         this(compnw, compse, split, 0,0,0,0);
  71.     }
  72.  
  73.     public SDKInsetPanelHSL(IUIComponent compnw, IUIComponent compse,
  74.                                 int split, int t, int l, int b, int r)
  75.     { 
  76.         this(split, t,l,b,r);
  77.         add(compnw, "nw");
  78.         add(compse, "se");
  79.     }
  80.  
  81.     public SDKInsetPanelHSL(int split, int t, int l, int b, int r)
  82.     { 
  83.         super(t,l,b,r);
  84.         setLayout(new UISplitLayout(UISplitLayout.HORIZONTAL, split));
  85.     }
  86. }
  87.  
  88. class SDKInsetGroup extends UIGroup
  89. {
  90.     private int t, l, b, r;
  91.  
  92.     public SDKInsetGroup(String title, int t, int l, int b, int r)
  93.     {
  94.         super(title);
  95.         this.t = t; this.l = l; this.b = b; this.r = r;
  96.     }
  97.  
  98.     public Insets getInsets() { return new Insets(t, l, b, r); }
  99. }