home *** CD-ROM | disk | FTP | other *** search
- package netscape.application;
-
- import java.awt.Component;
- import java.awt.Container;
- import java.awt.Event;
- import java.awt.Frame;
- import java.awt.Graphics;
- import java.awt.Panel;
-
- public class FoundationPanel extends Panel {
- RootView rootView;
-
- public FoundationPanel() {
- this.setRootView(new RootView());
- }
-
- public FoundationPanel(int var1, int var2) {
- this.setRootView(new RootView(0, 0, var1, var2));
- this.resize(var1, var2);
- }
-
- public RootView rootView() {
- return this.rootView;
- }
-
- public void setRootView(RootView var1) {
- Application var2 = Application.application();
- if (this.rootView != null) {
- var2.removeRootView(this.rootView);
- }
-
- this.rootView = var1;
- var1.setPanel(this);
- var1.setVisible(!var2.isPaused);
- var2.addRootView(var1);
- }
-
- public void resize(int var1, int var2) {
- Application var3 = Application.application();
- super.resize(var1, var2);
- if (var3 != null && var3.eventLoop.shouldProcessSynchronously()) {
- this.rootView.processEvent(ApplicationEvent.newResizeEvent(var1, var2));
- } else {
- this.addEvent(ApplicationEvent.newResizeEvent(var1, var2));
- }
- }
-
- public void reshape(int var1, int var2, int var3, int var4) {
- Application var5 = Application.application();
- super.reshape(var1, var2, var3, var4);
- if (var5 != null && var5.eventLoop.shouldProcessSynchronously()) {
- this.rootView.processEvent(ApplicationEvent.newResizeEvent(var3, var4));
- } else {
- this.addEvent(ApplicationEvent.newResizeEvent(var3, var4));
- }
- }
-
- public void update(Graphics var1) {
- this.paint(var1);
- }
-
- public void paint(Graphics var1) {
- if (JDK11AirLock.isPrintGraphics(var1)) {
- Application var2 = Application.application();
- if (var2 != null) {
- if (var2.eventLoop.shouldProcessSynchronously()) {
- Rect var5 = new Rect(0, 0, this.rootView.width(), this.rootView.height());
- netscape.application.Graphics var4 = new netscape.application.Graphics(var5, var1);
- this.rootView.redraw(var4, var5);
- this.rootView.redrawTransparentWindows(var4, var5, (InternalWindow)null);
- } else {
- ApplicationEvent var3 = ApplicationEvent.newPrintEvent(var1);
- var3.processor = this.rootView;
- var2.eventLoop().addEventAndWait(var3);
- }
- } else {
- System.err.println("Can't print with no application");
- }
- } else {
- this.addEvent(ApplicationEvent.newUpdateEvent(var1));
- super.paint(var1);
- }
- }
-
- public boolean mouseDown(Event var1, int var2, int var3) {
- ((Component)this).requestFocus();
- this.addEvent(new MouseEvent(var1.when, -1, var2, var3, var1.modifiers));
- return true;
- }
-
- public boolean mouseDrag(Event var1, int var2, int var3) {
- this.addEvent(new MouseEvent(var1.when, -2, var2, var3, var1.modifiers));
- return true;
- }
-
- public boolean mouseUp(Event var1, int var2, int var3) {
- this.addEvent(new MouseEvent(var1.when, -3, var2, var3, var1.modifiers));
- return true;
- }
-
- public boolean mouseEnter(Event var1, int var2, int var3) {
- this.addEvent(new MouseEvent(var1.when, -4, var2, var3, var1.modifiers));
- return true;
- }
-
- public boolean mouseMove(Event var1, int var2, int var3) {
- this.addEvent(new MouseEvent(var1.when, -5, var2, var3, var1.modifiers));
- return true;
- }
-
- public boolean mouseExit(Event var1, int var2, int var3) {
- this.addEvent(new MouseEvent(var1.when, -6, var2, var3, var1.modifiers));
- return true;
- }
-
- public boolean keyDown(Event var1, int var2) {
- if (var1.target == this) {
- this.addEvent(new KeyEvent(var1.when, var2, var1.modifiers, true));
- return true;
- } else {
- return super.keyDown(var1, var2);
- }
- }
-
- public boolean keyUp(Event var1, int var2) {
- if (var1.target == this) {
- this.addEvent(new KeyEvent(var1.when, var2, var1.modifiers, false));
- return true;
- } else {
- return super.keyUp(var1, var2);
- }
- }
-
- public synchronized boolean lostFocus(Event var1, Object var2) {
- this.addEvent(ApplicationEvent.newFocusEvent(false));
- return true;
- }
-
- public boolean gotFocus(Event var1, Object var2) {
- this.addEvent(ApplicationEvent.newFocusEvent(true));
- return true;
- }
-
- private synchronized void addEvent(netscape.application.Event var1) {
- if (var1.processor() == null) {
- var1.setProcessor(this.rootView);
- }
-
- if (this.rootView != null && this.rootView.application() != null) {
- this.rootView.application().eventLoop().addEvent(var1);
- }
-
- }
-
- Frame frame() {
- Container var1;
- for(var1 = ((Component)this).getParent(); var1 != null && !(var1 instanceof Frame); var1 = ((Component)var1).getParent()) {
- }
-
- return var1 != null ? (Frame)var1 : null;
- }
-
- public void setCursor(int var1) {
- Frame var2 = this.frame();
- if (var2 != null) {
- var2.setCursor(var1);
- }
-
- }
-
- public void layout() {
- }
-
- public void printAll(Graphics var1) {
- this.paint(var1);
- }
- }
-