RootDialog.java revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* ident "%Z%%M% %I% %E% SMI"
*
* Copyright (c) 2000 by Sun Microsystems, Inc.
* All rights reserved.
*/
/*
* Copyright (C) 1996 Active Software, Inc.
* All rights reserved.
*
* @(#) RootDialog.java 1.44 - last change made 06/19/97
*/
// For overriden pack() hack
private Thread eventThread;
initHelper();
}
initHelper();
}
private void initHelper() {
if (c != null) {
try {
}
}
}
}
// Workaround for idiotic JDK1.1 bug where if you add a
// component to a container that it is already in, then
// the component will be removed from the container!
//
// #ifdef JDK1.1
int index) {
}
// #endif
/**
* Make dialogs on Windows behave the same as
* dialogs on Motif.
*/
public void pack() {
}
addNotify();
}
Dimension d = getPreferredSize();
Point p = getDialogLocation(d);
// Adjust the location the first time the dialog is mapped after
// the peer has been created. There is an AWT bug that screws
// up the location of the dialog, so we
// have to make this adjustment.
p.x -= d.width/2;
p.y -= d.height/2;
}
setLocation(p.x, p.y);
validate();
}
return p;
}
/**
* Make sure the insets aren't screwed up on Windows. The dialog
* will come up too small the first time it is shown if we don't
* fix the insets here.
*/
}
return insets;
}
/**
* Event forwarding to groups.
*
* (see comment in GBPanel.java)
*/
/* BEGIN JSTYLED */
// AWT Bug: JDK-1.0 AWT gives a WINDOW_ICONIFY event to a Dialog
// when it is shown (causing us to obediently iconify the windows in the
// dialog's group, including the dialog iteself.) AWT then gives a
// WINDOW_DEICONFY event to the same Dialog, resulting in a show and an
// infinite loop of hiding and showing. Dialogs can't be iconfied
// anyway, so just what is this event doing here!!?
//
// Work-around: throw away these two spurious events on Dialogs before
// they can muck up the works.
//
/* END JSTYLED */
return true;
if (marked)
return handled;
}
public void select() {
}
public void unselect() {
}
public void layoutMode() {
helper.layoutMode();
}
public void previewMode() {
}
public Dimension previewSize() {
return helper.previewSize();
else
return null;
}
public void addNotify() {
super.addNotify();
}
public void removeNotify() {
reshapeZero(this);
super.removeNotify();
}
/**
* Recursively reshapes the component and all its children to zero.
* You need to do this on Windows when removeNotify is called.
* Otherwise when you call addNotify, the children are offset
* about 25 extra pixels from the top on the window, and the bottom
* 25 pixels will get clipped off. I don't know why this happens,
* but I do know that reshaping everything back to zero avoids
* the problem. I noticed the problem on WindowsNT, but not as
* often on Windows95.
*/
for (int i = 0; i < count; i++)
}
}
public void layout() {
super.layout();
}
g = getGraphics();
super.paint(g);
}
return false;
}
}