home *** CD-ROM | disk | FTP | other *** search
- package com.sun.java.swing;
-
- import com.sun.java.accessibility.Accessible;
- import com.sun.java.accessibility.AccessibleContext;
- import java.applet.Applet;
- import java.awt.AWTEvent;
- import java.awt.BorderLayout;
- import java.awt.Component;
- import java.awt.Container;
- import java.awt.Graphics;
- import java.awt.LayoutManager;
- import java.awt.event.InputEvent;
- import java.awt.event.KeyEvent;
- import java.util.Vector;
-
- public class JApplet extends Applet implements Accessible, RootPaneContainer {
- private static final BorderLayout sharedBorderLayout = new BorderLayout();
- protected JRootPane rootPane;
- protected boolean rootPaneCheckingEnabled = false;
- protected AccessibleContext accessibleContext;
- // $FF: synthetic field
- static Class class$com$sun$java$swing$RootPaneContainer;
-
- public JApplet() {
- this.setLayout(sharedBorderLayout);
- this.setRootPane(this.createRootPane());
- this.setRootPaneCheckingEnabled(true);
- }
-
- public void addNotify() {
- super.addNotify();
- ((Component)this).enableEvents(8L);
- if (SwingUtilities.getAncestorOfClass(class$com$sun$java$swing$RootPaneContainer != null ? class$com$sun$java$swing$RootPaneContainer : (class$com$sun$java$swing$RootPaneContainer = class$("com.sun.java.swing.RootPaneContainer")), this) == null) {
- TimerQueue.initAppletTimer(this);
- }
-
- ((Component)this).setVisible(true);
- }
-
- public void removeNotify() {
- super.removeNotify();
- TimerQueue.removeAppletTimer(this);
- }
-
- protected JRootPane createRootPane() {
- return new JRootPane();
- }
-
- protected void processKeyEvent(KeyEvent var1) {
- super.processKeyEvent(var1);
- if (!((InputEvent)var1).isConsumed()) {
- JComponent.processKeyBindingsForAllComponents(var1, this, new Vector(), ((AWTEvent)var1).getID() == 401);
- }
-
- }
-
- public void update(Graphics var1) {
- ((Container)this).paint(var1);
- }
-
- public void setJMenuBar(JMenuBar var1) {
- this.getRootPane().setMenuBar(var1);
- }
-
- public JMenuBar getJMenuBar() {
- return this.getRootPane().getMenuBar();
- }
-
- protected boolean isRootPaneCheckingEnabled() {
- return this.rootPaneCheckingEnabled;
- }
-
- protected void setRootPaneCheckingEnabled(boolean var1) {
- this.rootPaneCheckingEnabled = var1;
- }
-
- private Error createRootPaneException(String var1) {
- String var2 = this.getClass().getName();
- return new Error("Do not use " + var2 + "." + var1 + "() use " + var2 + ".getContentPane()." + var1 + "() instead");
- }
-
- protected void addImpl(Component var1, Object var2, int var3) {
- if (this.isRootPaneCheckingEnabled()) {
- throw this.createRootPaneException("add");
- } else {
- super.addImpl(var1, var2, var3);
- }
- }
-
- public void setLayout(LayoutManager var1) {
- if (this.isRootPaneCheckingEnabled()) {
- throw this.createRootPaneException("setLayout");
- } else {
- super.setLayout(var1);
- }
- }
-
- public JRootPane getRootPane() {
- return this.rootPane;
- }
-
- protected void setRootPane(JRootPane var1) {
- if (this.rootPane != null) {
- ((Container)this).remove(this.rootPane);
- }
-
- this.rootPane = var1;
- if (this.rootPane != null) {
- boolean var2 = this.isRootPaneCheckingEnabled();
-
- try {
- this.setRootPaneCheckingEnabled(false);
- ((Container)this).add(this.rootPane, "Center");
- } finally {
- this.setRootPaneCheckingEnabled(var2);
- }
-
- }
- }
-
- public Container getContentPane() {
- return this.getRootPane().getContentPane();
- }
-
- public void setContentPane(Container var1) {
- this.getRootPane().setContentPane(var1);
- }
-
- public JLayeredPane getLayeredPane() {
- return this.getRootPane().getLayeredPane();
- }
-
- public void setLayeredPane(JLayeredPane var1) {
- this.getRootPane().setLayeredPane(var1);
- }
-
- public Component getGlassPane() {
- return this.getRootPane().getGlassPane();
- }
-
- public void setGlassPane(Component var1) {
- this.getRootPane().setGlassPane(var1);
- }
-
- public AccessibleContext getAccessibleContext() {
- if (this.accessibleContext == null) {
- this.accessibleContext = new AccessibleJApplet(this);
- }
-
- return this.accessibleContext;
- }
-
- // $FF: synthetic method
- static Class class$(String var0) {
- try {
- return Class.forName(var0);
- } catch (ClassNotFoundException var2) {
- throw new NoClassDefFoundError(((Throwable)var2).getMessage());
- }
- }
- }
-