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 / JTabbedPane$Page.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  4.8 KB  |  217 lines

  1. package javax.swing;
  2.  
  3. import java.awt.Color;
  4. import java.awt.Component;
  5. import java.awt.Cursor;
  6. import java.awt.Dimension;
  7. import java.awt.Font;
  8. import java.awt.FontMetrics;
  9. import java.awt.Point;
  10. import java.awt.Rectangle;
  11. import java.awt.event.FocusListener;
  12. import java.io.Serializable;
  13. import java.util.Locale;
  14. import javax.accessibility.Accessible;
  15. import javax.accessibility.AccessibleComponent;
  16. import javax.accessibility.AccessibleContext;
  17. import javax.accessibility.AccessibleRole;
  18. import javax.accessibility.AccessibleState;
  19. import javax.accessibility.AccessibleStateSet;
  20.  
  21. class JTabbedPane$Page extends AccessibleContext implements Serializable, Accessible, AccessibleComponent {
  22.    String title;
  23.    Color background;
  24.    Color foreground;
  25.    Icon icon;
  26.    Icon disabledIcon;
  27.    JTabbedPane parent;
  28.    Component component;
  29.    String tip;
  30.    boolean enabled;
  31.    boolean needsUIUpdate;
  32.    // $FF: synthetic field
  33.    private final JTabbedPane this$0;
  34.  
  35.    JTabbedPane$Page(JTabbedPane var1, JTabbedPane var2, String var3, Icon var4, Icon var5, Component var6, String var7) {
  36.       this.this$0 = var1;
  37.       this.enabled = true;
  38.       this.title = var3;
  39.       this.icon = var4;
  40.       this.disabledIcon = var5;
  41.       this.parent = var2;
  42.       ((AccessibleContext)this).setAccessibleParent(var2);
  43.       this.component = var6;
  44.       this.tip = var7;
  45.       if (var6 instanceof Accessible) {
  46.          AccessibleContext var8 = ((Accessible)var6).getAccessibleContext();
  47.          if (var8 != null) {
  48.             var8.setAccessibleParent(this);
  49.          }
  50.       }
  51.  
  52.    }
  53.  
  54.    public AccessibleContext getAccessibleContext() {
  55.       return this;
  56.    }
  57.  
  58.    public String getAccessibleName() {
  59.       if (super.accessibleName != null) {
  60.          return super.accessibleName;
  61.       } else {
  62.          return this.title != null ? this.title : null;
  63.       }
  64.    }
  65.  
  66.    public String getAccessibleDescription() {
  67.       if (super.accessibleDescription != null) {
  68.          return super.accessibleDescription;
  69.       } else {
  70.          return this.tip != null ? this.tip : null;
  71.       }
  72.    }
  73.  
  74.    public AccessibleRole getAccessibleRole() {
  75.       return AccessibleRole.PAGE_TAB;
  76.    }
  77.  
  78.    public AccessibleStateSet getAccessibleStateSet() {
  79.       AccessibleStateSet var1 = this.parent.getAccessibleContext().getAccessibleStateSet();
  80.       var1.add(AccessibleState.SELECTABLE);
  81.       int var2 = this.parent.indexOfTab(this.title);
  82.       if (var2 == this.parent.getSelectedIndex()) {
  83.          var1.add(AccessibleState.SELECTED);
  84.       }
  85.  
  86.       return var1;
  87.    }
  88.  
  89.    public int getAccessibleIndexInParent() {
  90.       return this.parent.indexOfTab(this.title);
  91.    }
  92.  
  93.    public int getAccessibleChildrenCount() {
  94.       return this.component instanceof Accessible ? 1 : 0;
  95.    }
  96.  
  97.    public Accessible getAccessibleChild(int var1) {
  98.       return this.component instanceof Accessible ? (Accessible)this.component : null;
  99.    }
  100.  
  101.    public Locale getLocale() {
  102.       return this.parent.getLocale();
  103.    }
  104.  
  105.    public AccessibleComponent getAccessibleComponent() {
  106.       return this;
  107.    }
  108.  
  109.    public Color getBackground() {
  110.       return this.background != null ? this.background : this.parent.getBackground();
  111.    }
  112.  
  113.    public void setBackground(Color var1) {
  114.       this.background = var1;
  115.    }
  116.  
  117.    public Color getForeground() {
  118.       return this.foreground != null ? this.foreground : this.parent.getForeground();
  119.    }
  120.  
  121.    public void setForeground(Color var1) {
  122.       this.foreground = var1;
  123.    }
  124.  
  125.    public Cursor getCursor() {
  126.       return this.parent.getCursor();
  127.    }
  128.  
  129.    public void setCursor(Cursor var1) {
  130.       this.parent.setCursor(var1);
  131.    }
  132.  
  133.    public Font getFont() {
  134.       return this.parent.getFont();
  135.    }
  136.  
  137.    public void setFont(Font var1) {
  138.       this.parent.setFont(var1);
  139.    }
  140.  
  141.    public FontMetrics getFontMetrics(Font var1) {
  142.       return this.parent.getFontMetrics(var1);
  143.    }
  144.  
  145.    public boolean isEnabled() {
  146.       return this.enabled;
  147.    }
  148.  
  149.    public void setEnabled(boolean var1) {
  150.       this.enabled = var1;
  151.    }
  152.  
  153.    public boolean isVisible() {
  154.       return this.parent.isVisible();
  155.    }
  156.  
  157.    public void setVisible(boolean var1) {
  158.       this.parent.setVisible(var1);
  159.    }
  160.  
  161.    public boolean isShowing() {
  162.       return this.parent.isShowing();
  163.    }
  164.  
  165.    public boolean contains(Point var1) {
  166.       Rectangle var2 = this.getBounds();
  167.       return var2.contains(var1);
  168.    }
  169.  
  170.    public Point getLocationOnScreen() {
  171.       Point var1 = this.parent.getLocationOnScreen();
  172.       Point var2 = this.getLocation();
  173.       var2.translate(var1.x, var1.y);
  174.       return var2;
  175.    }
  176.  
  177.    public Point getLocation() {
  178.       Rectangle var1 = this.getBounds();
  179.       return new Point(var1.x, var1.y);
  180.    }
  181.  
  182.    public void setLocation(Point var1) {
  183.    }
  184.  
  185.    public Rectangle getBounds() {
  186.       return this.parent.getUI().getTabBounds(this.parent, this.parent.indexOfTab(this.title));
  187.    }
  188.  
  189.    public void setBounds(Rectangle var1) {
  190.    }
  191.  
  192.    public Dimension getSize() {
  193.       Rectangle var1 = this.getBounds();
  194.       return new Dimension(var1.width, var1.height);
  195.    }
  196.  
  197.    public void setSize(Dimension var1) {
  198.    }
  199.  
  200.    public Accessible getAccessibleAt(Point var1) {
  201.       return this.component instanceof Accessible ? (Accessible)this.component : null;
  202.    }
  203.  
  204.    public boolean isFocusTraversable() {
  205.       return false;
  206.    }
  207.  
  208.    public void requestFocus() {
  209.    }
  210.  
  211.    public void addFocusListener(FocusListener var1) {
  212.    }
  213.  
  214.    public void removeFocusListener(FocusListener var1) {
  215.    }
  216. }
  217.