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

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