home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / javax / swing / JSeparator.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  2.4 KB  |  91 lines

  1. package javax.swing;
  2.  
  3. import java.awt.Component;
  4. import java.io.IOException;
  5. import java.io.ObjectOutputStream;
  6. import javax.accessibility.Accessible;
  7. import javax.accessibility.AccessibleContext;
  8. import javax.swing.plaf.SeparatorUI;
  9.  
  10. public class JSeparator extends JComponent implements SwingConstants, Accessible {
  11.    private static final String uiClassID = "SeparatorUI";
  12.    private int orientation;
  13.  
  14.    public JSeparator() {
  15.       this(0);
  16.    }
  17.  
  18.    public JSeparator(int var1) {
  19.       this.orientation = 0;
  20.       this.checkOrientation(var1);
  21.       this.orientation = var1;
  22.       this.updateUI();
  23.    }
  24.  
  25.    public SeparatorUI getUI() {
  26.       return (SeparatorUI)super.ui;
  27.    }
  28.  
  29.    public void setUI(SeparatorUI var1) {
  30.       super.setUI(var1);
  31.    }
  32.  
  33.    public void updateUI() {
  34.       this.setUI((SeparatorUI)UIManager.getUI(this));
  35.    }
  36.  
  37.    public String getUIClassID() {
  38.       return "SeparatorUI";
  39.    }
  40.  
  41.    private void writeObject(ObjectOutputStream var1) throws IOException {
  42.       var1.defaultWriteObject();
  43.       if (super.ui != null && this.getUIClassID().equals("SeparatorUI")) {
  44.          super.ui.installUI(this);
  45.       }
  46.  
  47.    }
  48.  
  49.    public int getOrientation() {
  50.       return this.orientation;
  51.    }
  52.  
  53.    public void setOrientation(int var1) {
  54.       if (this.orientation != var1) {
  55.          int var2 = this.orientation;
  56.          this.checkOrientation(var1);
  57.          this.orientation = var1;
  58.          ((JComponent)this).firePropertyChange("orientation", var2, var1);
  59.          ((JComponent)this).revalidate();
  60.          ((Component)this).repaint();
  61.       }
  62.    }
  63.  
  64.    private void checkOrientation(int var1) {
  65.       switch (var1) {
  66.          case 0:
  67.          case 1:
  68.             return;
  69.          default:
  70.             throw new IllegalArgumentException("orientation must be one of: VERTICAL, HORIZONTAL");
  71.       }
  72.    }
  73.  
  74.    protected String paramString() {
  75.       String var1 = this.orientation == 0 ? "HORIZONTAL" : "VERTICAL";
  76.       return super.paramString() + ",orientation=" + var1;
  77.    }
  78.  
  79.    public boolean isFocusTraversable() {
  80.       return false;
  81.    }
  82.  
  83.    public AccessibleContext getAccessibleContext() {
  84.       if (super.accessibleContext == null) {
  85.          super.accessibleContext = new AccessibleJSeparator(this);
  86.       }
  87.  
  88.       return super.accessibleContext;
  89.    }
  90. }
  91.