Re: [OpenMap Users] OM Dialogs Issue

From: Don Dietrick <dietrick_at_bbn.com>
Date: Wed, 13 Dec 2006 11:00:28 -0500

Hi Carsten,

Thanks for pointing this out, I'll take a look at it.

- Don

On Dec 12, 2006, at 10:24 AM, oland wrote:

>
> Not sure this is a general problem but when the LayersPanel toolbar
> button
> launches the layers dialog it gets the parent frame from the bean
> context
> but when using, e .g., BasicMapPanel there is no frame in the bean
> context
> which causes at least the LayersPanel dialog to be without a
> parent. If
> there are other dialogs created in a simmilar way they will also be
> created
> without a parent.
>
> So why is the bean context used for finding the parent frame?
>
> Something like
>
> http://weblogs.java.net/blog/hansmuller/
>
> Frame frameForActionEvent(ActionEvent e) {
> if (e.getSource() instanceof Component) {
> Component c = (Component)e.getSource();
> while(c != null) {
> if (c instanceof Frame) {
> return (Frame)c;
> }
> c = (c instanceof JPopupMenu) ? ((JPopupMenu)
> c).getInvoker() :
> c.getParent();
> }
> }
> return null;
> }
>
> public void showMyDialog(ActionEvent e) {
> Window dialogOwner = frameForActionEvent(e);
> JDialog dialog = new MyDialog(dialogOwner, true);
> dialog.pack();
> aboutBox.setLocationRelativeTo(dialogOwner);
> dialog.setVisible(true);
> }
>
> should do the trick.
>
> The workaround is to just put the parent frame into the bean
> context by
> hand.
>
> regards
> /carsten
> --
> View this message in context: http://www.nabble.com/OM-Dialogs-
> Issue-tf2808112.html#a7835155
> Sent from the OpenMap mailing list archive at Nabble.com.
>
> --
> [To unsubscribe to this list send an email to "majdart_at_bbn.com"
> with the following text in the BODY of the message "unsubscribe
> openmap-users"]



=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, dietrick_at_bbn.com
BBN Technologies, Cambridge, MA
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Wed Dec 13 2006 - 11:00:44 EST

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:08 EDT