home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 March / pcp161a.iso / handson / files / copyjava.exe / com / sun / java / swing / JComponent$AccessibleJComponent.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-02-26  |  5.7 KB  |  223 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 com.sun.java.swing.border.Border;
  10. import com.sun.java.swing.border.TitledBorder;
  11. import java.awt.Color;
  12. import java.awt.Container;
  13. import java.awt.Cursor;
  14. import java.awt.Dimension;
  15. import java.awt.Font;
  16. import java.awt.FontMetrics;
  17. import java.awt.Point;
  18. import java.awt.Rectangle;
  19. import java.awt.event.FocusListener;
  20. import java.awt.event.MouseEvent;
  21. import java.io.Serializable;
  22. import java.util.Locale;
  23.  
  24. public abstract class JComponent$AccessibleJComponent extends AccessibleContext implements Serializable, AccessibleComponent {
  25.    // $FF: synthetic field
  26.    private final JComponent this$0;
  27.  
  28.    public String getAccessibleName() {
  29.       if (super.accessibleName != null) {
  30.          return super.accessibleName;
  31.       } else {
  32.          Border var1 = this.this$0.getBorder();
  33.          return var1 != null && var1 instanceof TitledBorder ? ((TitledBorder)var1).getTitle() : null;
  34.       }
  35.    }
  36.  
  37.    public String getAccessibleDescription() {
  38.       if (super.accessibleDescription != null) {
  39.          return super.accessibleDescription;
  40.       } else {
  41.          try {
  42.             String var1 = this.this$0.getToolTipText((MouseEvent)null);
  43.             if (var1 != null) {
  44.                return var1;
  45.             }
  46.          } catch (Exception var2) {
  47.          }
  48.  
  49.          return null;
  50.       }
  51.    }
  52.  
  53.    public AccessibleRole getAccessibleRole() {
  54.       return AccessibleRole.SWING_COMPONENT;
  55.    }
  56.  
  57.    public AccessibleStateSet getAccessibleStateSet() {
  58.       return SwingUtilities.getAccessibleStateSet(this.this$0);
  59.    }
  60.  
  61.    public Accessible getAccessibleParent() {
  62.       if (super.accessibleParent != null) {
  63.          return super.accessibleParent;
  64.       } else {
  65.          Container var1 = this.this$0.getParent();
  66.          return var1 instanceof Accessible ? (Accessible)var1 : null;
  67.       }
  68.    }
  69.  
  70.    public int getAccessibleIndexInParent() {
  71.       return SwingUtilities.getAccessibleIndexInParent(this.this$0);
  72.    }
  73.  
  74.    public int getAccessibleChildrenCount() {
  75.       return SwingUtilities.getAccessibleChildrenCount(this.this$0);
  76.    }
  77.  
  78.    public Accessible getAccessibleChild(int var1) {
  79.       return SwingUtilities.getAccessibleChild(this.this$0, var1);
  80.    }
  81.  
  82.    public Locale getLocale() {
  83.       return this.this$0.getLocale();
  84.    }
  85.  
  86.    public AccessibleComponent getAccessibleComponent() {
  87.       return this;
  88.    }
  89.  
  90.    public Color getBackground() {
  91.       return this.this$0.getBackground();
  92.    }
  93.  
  94.    public void setBackground(Color var1) {
  95.       this.this$0.setBackground(var1);
  96.    }
  97.  
  98.    public Color getForeground() {
  99.       return this.this$0.getForeground();
  100.    }
  101.  
  102.    public void setForeground(Color var1) {
  103.       this.this$0.setForeground(var1);
  104.    }
  105.  
  106.    public Cursor getCursor() {
  107.       return this.this$0.getCursor();
  108.    }
  109.  
  110.    public void setCursor(Cursor var1) {
  111.       this.this$0.setCursor(var1);
  112.    }
  113.  
  114.    public Font getFont() {
  115.       return this.this$0.getFont();
  116.    }
  117.  
  118.    public void setFont(Font var1) {
  119.       this.this$0.setFont(var1);
  120.    }
  121.  
  122.    public FontMetrics getFontMetrics(Font var1) {
  123.       return this.this$0.getFontMetrics(var1);
  124.    }
  125.  
  126.    public boolean isEnabled() {
  127.       return this.this$0.isEnabled();
  128.    }
  129.  
  130.    public void setEnabled(boolean var1) {
  131.       boolean var2 = this.this$0.isEnabled();
  132.       this.this$0.setEnabled(var1);
  133.       if (var1 != var2 && this.this$0.accessibleContext != null) {
  134.          if (var1) {
  135.             this.this$0.accessibleContext.firePropertyChange("AccessibleState", (Object)null, AccessibleState.ENABLED);
  136.             return;
  137.          }
  138.  
  139.          this.this$0.accessibleContext.firePropertyChange("AccessibleState", AccessibleState.ENABLED, (Object)null);
  140.       }
  141.  
  142.    }
  143.  
  144.    public boolean isVisible() {
  145.       return this.this$0.isVisible();
  146.    }
  147.  
  148.    public void setVisible(boolean var1) {
  149.       boolean var2 = this.this$0.isVisible();
  150.       this.this$0.setVisible(var1);
  151.       if (var1 != var2 && this.this$0.accessibleContext != null) {
  152.          if (var1) {
  153.             this.this$0.accessibleContext.firePropertyChange("AccessibleState", (Object)null, AccessibleState.VISIBLE);
  154.             return;
  155.          }
  156.  
  157.          this.this$0.accessibleContext.firePropertyChange("AccessibleState", AccessibleState.VISIBLE, (Object)null);
  158.       }
  159.  
  160.    }
  161.  
  162.    public boolean isShowing() {
  163.       return this.this$0.isShowing();
  164.    }
  165.  
  166.    public boolean contains(Point var1) {
  167.       return this.this$0.contains(var1);
  168.    }
  169.  
  170.    public Point getLocationOnScreen() {
  171.       return this.this$0.isShowing() ? this.this$0.getLocationOnScreen() : null;
  172.    }
  173.  
  174.    public Point getLocation() {
  175.       return this.this$0.getLocation();
  176.    }
  177.  
  178.    public void setLocation(Point var1) {
  179.       this.this$0.setLocation(var1);
  180.    }
  181.  
  182.    public Rectangle getBounds() {
  183.       return this.this$0.getBounds();
  184.    }
  185.  
  186.    public void setBounds(Rectangle var1) {
  187.       this.this$0.setBounds(var1);
  188.    }
  189.  
  190.    public Dimension getSize() {
  191.       return this.this$0.getSize();
  192.    }
  193.  
  194.    public void setSize(Dimension var1) {
  195.       this.this$0.setSize(var1);
  196.    }
  197.  
  198.    public Accessible getAccessibleAt(Point var1) {
  199.       return SwingUtilities.getAccessibleAt(this.this$0, var1);
  200.    }
  201.  
  202.    public boolean isFocusTraversable() {
  203.       return this.this$0.isFocusTraversable();
  204.    }
  205.  
  206.    public void requestFocus() {
  207.       this.this$0.requestFocus();
  208.    }
  209.  
  210.    public void addFocusListener(FocusListener var1) {
  211.       this.this$0.addFocusListener(var1);
  212.    }
  213.  
  214.    public void removeFocusListener(FocusListener var1) {
  215.       this.this$0.removeFocusListener(var1);
  216.    }
  217.  
  218.    public JComponent$AccessibleJComponent(JComponent var1) {
  219.       this.this$0 = var1;
  220.       this.this$0 = var1;
  221.    }
  222. }
  223.