home *** CD-ROM | disk | FTP | other *** search
- package sun.awt.motif;
-
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Font;
- import java.awt.Insets;
- import java.awt.Window;
- import java.awt.event.ComponentEvent;
- import java.awt.event.WindowEvent;
- import java.awt.peer.WindowPeer;
- import java.util.Vector;
-
- class MWindowPeer extends MPanelPeer implements WindowPeer {
- Insets insets = new Insets(0, 0, 0, 0);
- static Vector allWindows = new Vector();
-
- native void create(MComponentPeer var1);
-
- native void pShow();
-
- native void pHide();
-
- native void pReshape(int var1, int var2, int var3, int var4);
-
- native void pDispose();
-
- MWindowPeer(Window var1) {
- super(var1);
- allWindows.addElement(this);
- Font var2 = ((Component)var1).getFont();
- if (var2 == null) {
- var2 = new Font("Dialog", 0, 12);
- ((Component)var1).setFont(var2);
- ((MComponentPeer)this).setFont(var2);
- }
-
- Color var3 = ((Component)var1).getBackground();
- if (var3 == null) {
- ((Component)var1).setBackground(Color.lightGray);
- ((MComponentPeer)this).setBackground(Color.lightGray);
- }
-
- var3 = ((Component)var1).getForeground();
- if (var3 == null) {
- ((Component)var1).setForeground(Color.black);
- ((MComponentPeer)this).setForeground(Color.black);
- }
-
- }
-
- public void dispose() {
- allWindows.removeElement(this);
- super.dispose();
- }
-
- public void toFront() {
- this.pShow();
- }
-
- public native void toBack();
-
- public Insets getInsets() {
- return this.insets;
- }
-
- public void handleQuit() {
- ((MComponentPeer)this).postEvent(new WindowEvent((Window)super.target, 201));
- }
-
- public void handleIconify() {
- ((MComponentPeer)this).postEvent(new WindowEvent((Window)super.target, 203));
- }
-
- public void handleDeiconify() {
- ((MComponentPeer)this).postEvent(new WindowEvent((Window)super.target, 204));
- }
-
- public synchronized void handleResize(int var1, int var2) {
- ((MComponentPeer)this).postEvent(new ComponentEvent(super.target, 101));
- }
-
- public Insets insets() {
- return this.getInsets();
- }
- }
-