Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] More questions about maps and projects

I think I'll babble a little bit and maybe you'll be able to come up with some ideas or at least more questions.

Projects can contain anything that is a ProjectElement object so if your object is a ProjectElement (they are EObjects so beware) then you can add them to a project. In order to open them in an editor you have to create a net.refractions.udig.project.ui.editorInputs extension that is responsible for converting the ProjectElement to a IEditorInput object. Once you've done that you can use the normal eclipse editor extension point to define an editor for the IEditorInput.

There are "layers" call MapGraphics which can be used to draw anything you want onto the map. The interface is basically just a paint method that is called each time the layer is rendered. A commonly seen pattern is a mapgraphic that displays data that is on its blackboard or on the containing map's blackboard. For example if someone wanted to make a drawing layer where some one can draw lines with out having to write to a shapefile or some other datastore, a Scribble map graphic (doesn't actually exist as of yet) could be added to that map and when the user selects the Scribble tool the scribble tool would add data to the MapGraphic's blackboard (see getProperties()) and trigger a refresh on that layer. The MapGraphic would search its blackboard each time it renders and draws the data in some manner on the Graphics object.


Is part of the problem the udig notion of "projects" not fitting in very well with the user doing File... Open... and opening an outside EMF file not directly connected with a project? Or is there a good way of making all this fit together? Is it possible to use udig with no projects whatsoever and
just a single map display or is this unadvisable?

You could create a perspective that doesn't contain the ProjectExplorer so that the user doesn't even know about projects. The Startup extension point could check the existing projects to see if your map exists if it doesn't it can create "THE" map and open it (after adding all the layers to it). You can add a WorkbenchPart listeners or maybe it is a page listener, that listens to all the opens, closes, activation of all the workbenchparts and if the map is closed maybe you can reopen it... There may also be a way to make a map not be closeable... I've never researched that issue.

Jesse


Back to the top