The way I did it (may not be the best way!) was to implement findAndInit
in my layer. It would check if a ToolPanel was added, and then add stuff
to it:
public void findAndInit(Object someObj)
{
if (someObj instanceof ToolPanel)
{
JButton button = new JButton("Foo");
((ToolPanel) someObj).add(button);
// could also save a reference to the tool panel to add
stuff later.
}
}
-Hugh
________________________________
From: owner-openmap-users_at_bbn.com [mailto:owner-openmap-users_at_bbn.com]
On Behalf Of Gatrell, Mark (SELEX) (UK)
Sent: Tuesday, December 12, 2006 9:19 AM
To: openmap-users_at_bbn.com
Subject: [OpenMap Users] Adding Buttons to GUI
Hi all
I would like to add some OMToolComponent control buttons alongside the
existing buttons on the main map gui.
I have added them by modifying the properties file (openmap.components =
existing plus myNewButton..extended OMToolComponent).
I would like to programaticaly add these tool components from my
extended OMGraphicsHandlerLayer class , but do not know how to add them
to the tool bar once I have instatiated the class within my layer.
I would be gratefull if someone could explain how I do this.. I could
then change the icons etc on the fly using logic from my layer class..
thankyou in advance
regards
Mark
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************
--
[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 Tue Dec 12 2006 - 12:47:29 EST