home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / javax / swing / Box.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  2.0 KB  |  70 lines

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