Re: [OpenMap Users] How to close panels?

From: Bart Jourquin <bart.jourquin_at_fucam.ac.be>
Date: Fri, 24 Dec 2004 11:13:10 +0100

Solved: needs the palette, not the gui...

Layer layer[] = myOpenMapFrame.getLayerHandler().getMapLayers();
      for (int i = 0 ; i < layer.length ; i++) {
        Container c = layer[i].getPalette();
        if (c != null) {
          c.setVisible(false);
        }
      }

Bart

Bart Jourquin wrote:

> Hi all,
>
> My app allows the user to open and close "projects" (basically a list
> of layers). I would like that, when a project is closed, all the
> sub-windows are also closed, before a new project can be opened.
>
> This is relatively simple for frames (and dialogs), as their list can
> be retrieved with a call to Frame.getFrames(), but the returned list
> doesn't include the panels opened by a "getGUI()" used in many layers
> and plugins.
>
> I've tested a lot of tricks around the following idea...
>
> Layer layer[] = myOpenMapFrame.getLayerHandler().getMapLayers();
> for (int i = 0 ; i < layer.length ; i++) {
> Component c[] = layer[i].getComponents();
> for (int j = 0 ; j < c.length ; j++) {
> c[i].setVisible(false);
> }
> }
> or even layer[i].getGUI().setVisible(false) .... but without success.
>
> Is there a way to obtain a reference to these particular windows, so
> that I could close them?
>
> Many thanks
>


-- 
Prof Dr Bart Jourquin
F.U.Ca.M. - G.T.M.
Chaussée de Binche, 151a, B7000 Mons (Belgium)
Tel. : +32 65 323293, Fax. : +32 65 315691
http://www.fucam.ac.be/jourquin
--
[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 Fri Dec 24 2004 - 05:14:35 EST

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