home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 March / pcp161a.iso / handson / files / copyjava.exe / com / sun / java / swing / Box.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-02-26  |  2.3 KB  |  65 lines

  1. package com.sun.java.swing;
  2.  
  3. import com.sun.java.accessibility.Accessible;
  4. import com.sun.java.accessibility.AccessibleContext;
  5. import java.awt.AWTError;
  6. import java.awt.Component;
  7. import java.awt.Container;
  8. import java.awt.Dimension;
  9. import java.awt.LayoutManager;
  10.  
  11. public class Box extends Container implements Accessible {
  12.    private static final String base = "box";
  13.    private static int nameCounter;
  14.    protected AccessibleContext accessibleContext;
  15.  
  16.    public Box(int var1) {
  17.       ((Component)this).setName("box" + nameCounter++);
  18.       super.setLayout(new BoxLayout(this, var1));
  19.    }
  20.  
  21.    public static Box createHorizontalBox() {
  22.       return new Box(0);
  23.    }
  24.  
  25.    public static Box createVerticalBox() {
  26.       return new Box(1);
  27.    }
  28.  
  29.    public static Component createRigidArea(Dimension var0) {
  30.       return new Filler(var0, var0, var0);
  31.    }
  32.  
  33.    public static Component createHorizontalStrut(int var0) {
  34.       return new Filler(new Dimension(var0, 0), new Dimension(var0, 0), new Dimension(var0, 32767));
  35.    }
  36.  
  37.    public static Component createVerticalStrut(int var0) {
  38.       return new Filler(new Dimension(0, var0), new Dimension(0, var0), new Dimension(32767, var0));
  39.    }
  40.  
  41.    public static Component createGlue() {
  42.       return new Filler(new Dimension(0, 0), new Dimension(0, 0), new Dimension(32767, 32767));
  43.    }
  44.  
  45.    public static Component createHorizontalGlue() {
  46.       return new Filler(new Dimension(0, 0), new Dimension(0, 0), new Dimension(32767, 0));
  47.    }
  48.  
  49.    public static Component createVerticalGlue() {
  50.       return new Filler(new Dimension(0, 0), new Dimension(0, 0), new Dimension(0, 32767));
  51.    }
  52.  
  53.    public void setLayout(LayoutManager var1) {
  54.       throw new AWTError("Illegal request");
  55.    }
  56.  
  57.    public AccessibleContext getAccessibleContext() {
  58.       if (this.accessibleContext == null) {
  59.          this.accessibleContext = new AccessibleBox(this);
  60.       }
  61.  
  62.       return this.accessibleContext;
  63.    }
  64. }
  65.