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 / DefaultPopupFactory$WindowPopup.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  2.2 KB  |  89 lines

  1. package javax.swing;
  2.  
  3. import java.awt.Component;
  4. import java.awt.Container;
  5. import java.awt.Graphics;
  6. import java.awt.Rectangle;
  7. import java.awt.Window;
  8. import java.awt.event.KeyEvent;
  9. import java.io.Serializable;
  10. import javax.accessibility.Accessible;
  11. import javax.accessibility.AccessibleContext;
  12.  
  13. public class DefaultPopupFactory$WindowPopup extends JWindow implements Popup, Serializable, Accessible {
  14.    int saveX;
  15.    int saveY;
  16.    boolean firstShow;
  17.    // $FF: synthetic field
  18.    private final DefaultPopupFactory this$0;
  19.  
  20.    public DefaultPopupFactory$WindowPopup(DefaultPopupFactory var1, Window var2) {
  21.       super(var2);
  22.       this.this$0 = var1;
  23.       this.firstShow = true;
  24.    }
  25.  
  26.    protected void processKeyEvent(KeyEvent var1) {
  27.       MenuSelectionManager.defaultManager().processKeyEvent(var1);
  28.    }
  29.  
  30.    public Component getComponent() {
  31.       return this;
  32.    }
  33.  
  34.    public int getWidth() {
  35.       return ((Component)this).getBounds().width;
  36.    }
  37.  
  38.    public int getHeight() {
  39.       return ((Component)this).getBounds().height;
  40.    }
  41.  
  42.    public void update(Graphics var1) {
  43.       ((Container)this).paint(var1);
  44.    }
  45.  
  46.    public void show(Component var1) {
  47.       ((Component)this).setLocation(this.saveX, this.saveY);
  48.       ((Component)this).setVisible(true);
  49.       if (this.firstShow) {
  50.          this.hide();
  51.          ((Component)this).setVisible(true);
  52.          this.firstShow = false;
  53.       }
  54.  
  55.    }
  56.  
  57.    public void hide() {
  58.       super.hide();
  59.       ((Container)this).removeNotify();
  60.    }
  61.  
  62.    public Rectangle getBoundsOnScreen() {
  63.       return ((Component)this).getBounds();
  64.    }
  65.  
  66.    public void setLocationOnScreen(int var1, int var2) {
  67.       ((Component)this).setLocation(var1, var2);
  68.       this.saveX = var1;
  69.       this.saveY = var2;
  70.    }
  71.  
  72.    public void addComponent(Component var1, Object var2) {
  73.       ((JWindow)this).getContentPane().add(var1, var2);
  74.    }
  75.  
  76.    public void removeComponent(Component var1) {
  77.       ((JWindow)this).getContentPane().remove(var1);
  78.       DefaultPopupFactory.recyclePopup(this);
  79.    }
  80.  
  81.    public AccessibleContext getAccessibleContext() {
  82.       if (super.accessibleContext == null) {
  83.          super.accessibleContext = new DefaultPopupFactory.WindowPopup.AccessibleWindowPopup(this);
  84.       }
  85.  
  86.       return super.accessibleContext;
  87.    }
  88. }
  89.