RE: [OpenMap Users] JSplitPane in OpenMap?

From: Melvin, Derek R <derek.r.melvin_at_lmco.com>
Date: Wed, 08 Jul 2009 13:57:05 -0600

Mulone,

You are definitely on the right track by adding the MapBean to your JSplitPane. Chances are, the MapHandler object does not know what to do with the JSplitPane though. Try adding it to a Container like a JFrame. See Below.


JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.setSize(1000, 800);
frame.setLayout(new BorderLayout());

//YOUR CODE HERE, ILL JUST CONTINUE WITH THE SPLIT PANE

JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, mapBean, infoBr); frame.add(splitPane, BorderLayout.CENTER);

frame.setVisible(true);



I apologize the syntax may be off a little I just wrote this quickly to give you an idea of what I was talking about. Chances are you may need to extract the individual OpenMap components and add them to the container as well. Good luck.

Derek Melvin

-----Original Message-----
From: Mulone [mailto:andrea.ballatore_at_ucd.ie]
Sent: Wednesday, July 08, 2009 6:47 AM
To: openmap-users_at_bbn.com
Subject: [OpenMap Users] JSplitPane in OpenMap?


Hi guys,

Sorry to bother you again, but I would like to make the infobrowser in my
application resizable (look at the red arrows in this snapshot:
http://img5.imageshack.us/img5/8094/compasssnap.png ). At the moment that
panel is locked in that position. This is the code I use to create this GUI:

        mapHandler.add(mapBean);
        mapHandler.add(layerHandler);

        InformationDelegator1 id = new InformationDelegator1();
        mapHandler.add(id);

        mapHandler.add( new OSMPanMouseMode() );
        mapHandler.add(new MouseDelegator());
        ommodifications.OMToolSet omts = new ommodifications.OMToolSet();
        mapHandler.add(omts);
                
        // holder of tabbed panel
       InfoBrowserPanel infoBr = new InfoBrowserPanel();
       //InfoBrowserPanel extends JToolBar implements BeanContextChild,
       // BeanContextMembershipListener
        JTabbedPane jTabPane = //get a tabbed panel;
        infoBr.add(jTabPane);
       mapHandler.add( infoBr );

This layout is completely static and I’d like to update it to something more
flexible and intuitive (move the position and size of a panel by dragging
the corners, etc, move a component from left to right, etc).
For starters, I’ve tried to wrap the mapbean and the infobrowser in a split
panel with:

        JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, mapBean,
infoBr);
        //mapHandler.add( infoBr );
        mapHandler.add( splitPane );

The splitpane doesn’t even show up and I need something more generic.
Has openmap (or swing) something suitable for me?
Ideally I’d like to have the typical panel “view” with a list of panels to
show/hide.

Thanks for any hint,
Mulone

-- 
View this message in context: http://www.nabble.com/JSplitPane-in-OpenMap--tp24390845p24390845.html
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"]
--
[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 Jul 08 2009 - 15:58:08 EDT

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