Re: [OpenMap Users] Newbie PlugIn queries

From: Don Dietrick <dietrick_at_bbn.com>
Date: Thu, 30 Mar 2006 11:39:34 -0500

Hi Sean,

I would do something a little different. I would subclass
OMGraphicHandlerLayer, and override the prepare() method. See enclosed:




The prepare() method in the layer is where the magic happens, when
the map's projection changes (pan, zoom). You can return the list
you want displayed/managed depending on the projection parameters.

Hope this helps,

Don

On Mar 30, 2006, at 8:32 AM, Donohue Sean wrote:

> Hi,
>
> I'm new to Java programming, so in a bit at the deep end, but I've
> got to display some ship track data over DTED, and I was very happy
>
> when I found OpenMap and all the functionality it had. I've got
> the examples up and running and now the time has come to modify the
>
> main app I have a few questions that I'd appreciate some help on
> please:-)
>
>
>
> My users are going to be running the program as a client-side
> executable, so I need to let them select the data files with an Open
>
> File dialog rather than having to edit the properties file each time.
>
>
>
> Since the track data is quite large, I like the idea of using a
> PlugIn to automatically thread the process. I've added an 'Open Track
>
> Data' menu to the file menu, and a new package
> com.bbn.openmap.plugin.shipTracks (no copyright infringement
> intended but I'm having
>
> enough trouble with classpaths without adding in code from another
> root directory!)
>
>
>
> Then I created class TrackPlugIn which extends AbstractPlugIn and
> implemented getRectangle, but I'm stuck on how to proceed..
>
>
>
> From a design perspective, should the TrackPlugIn be responsible
> for opening and parsing the track file? At what point does the new
>
> thread get created, because I'd like the parsing to occur in that
> thread.
>
>
>
> If LoadTrackMenuItem.actionPerformed looks like:-
>
>
>
> JFileChooser fileChooser = FileUtils.getChooser("Open Assignment
> File");
>
> int retvalue = fileChooser.showOpenDialog(null);
>
> if (retvalue != JFileChooser.APPROVE_OPTION) {
>
> TrackPlugIn trackpi=new TrackPlugIn(fileChooser.getName
> ());
>
> }
>
>
>
> Will anything nasty happen when trackpi goes out of scope, or will
> a reference to it be kept somewhere else?
>
>
>
> TrackPlugIn looks like:-
>
> public class TrackPlugIn extends AbstractPlugIn{
>
>
>
> /** Creates a new instance of TrackPlugIn */
>
> public TrackPlugIn(String filename) {
>
> TrackFileParser tfp = new TrackFileParser(filename); //
> opens and reads the track file
>
> gl = tfp.getGraphicList(); // constructs a list of
> OMGraphic objects from track coordinates
>
>
>
> MapHandler mh = ? // how do I access the map handler
> object?
>
> PlugInLayer pil = new PlugInLayer();
>
> pil.setPlugIn(this);
>
> mh.add(pil); // is this all I need to do?
>
>
>
> // I'd like to zoom in on the region bounding the
> tracks, how would I go about that please?
>
> }
>
> protected OMGraphicList gl; // list of the track coordinates
>
>
>
> public OMGraphicList getRectangle(Projection p) {
>
>
>
> // loop through gl
>
> // call generate on each graphic
>
>
>
> return gl;
>
> }
>
> }
>
>
>
> Does this look like a reasonable first step?
>
> Once I get this working the next step will be to add a GUI so that
> the user can see a table of tracks and use filters on that to
>
> change the visibility. Because of the size of the track list it
> would be nice if a single set of coordinates was used and the
>
> OMGraphicList and table data pointed to this. Is it going to be
> tricky to implement this?
>
>
>
> Thanks for any suggestions!
>
>
>
> Sean
>
>
>
> The information contained in this E-Mail and any subsequent
> correspondence is private and is intended solely for the intended
> recipient(s). The information in this communication may be
> confidential
> and/or legally privileged. Nothing in this e-mail is intended to
> conclude a contract on behalf of QinetiQ or make QinetiQ subject to
> any
> other legally binding commitments, unless the e-mail contains an
> express
> statement to the contrary or incorporates a formal Purchase Order.
>
> For those other than the recipient any disclosure, copying,
> distribution, or any action taken or omitted to be taken in
> reliance on
> such information is prohibited and may be unlawful.
>
> Emails and other electronic communication with QinetiQ may be
> monitored
> and recorded for business purposes including security, audit and
> archival purposes. Any response to this email indicates consent to
> this.
>
> Telephone calls to QinetiQ may be monitored or recorded for quality
> control, security and other business purposes.
>
>



--
[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 Thu Mar 30 2006 - 11:40:09 EST

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