|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.refractions.udig.project.ui.ApplicationGIS
public class ApplicationGIS
A facade into udig to simplify operations such as getting the active map and openning a map editor.
Nested Class Summary | |
---|---|
static class |
ApplicationGIS.DrawMapParameter
Parameter class for drawMap(net.refractions.udig.project.ui.ApplicationGIS.DrawMapParameter) |
Field Summary | |
---|---|
static Map |
NO_MAP
|
Constructor Summary | |
---|---|
ApplicationGIS()
|
Method Summary | |
---|---|
static java.util.List<? extends ILayer> |
addLayersToMap(IMap map,
java.util.List<IGeoResource> resourceList,
int startPosition)
Make layers from the resourceList and adds the layers to the map. |
static java.util.List<? extends ILayer> |
addLayersToMap(IMap map2,
java.util.List<IGeoResource> resourceList,
int startPosition2,
IProject project2,
boolean wait)
Make layers from the resourceList and adds the layers to the map. |
static java.util.List<? extends ILayer> |
addLayersToMap(IMap map,
java.util.List<IGeoResource> resourceList,
int startPosition,
Project project)
Deprecated. |
static java.util.List<? extends ILayer> |
addLayersToMap(IProject project,
java.util.List<IGeoResource> resourceList)
Make layers from the resourceList, creates a new map, adds layers to map and adds map to the project. |
static void |
createAndOpenMap(java.util.List<IGeoResource> resources)
creates a map and opens an editor for the map. |
static void |
createAndOpenMap(java.util.List<IGeoResource> resources,
IProject owner)
creates a map and opens an editor for the map. |
static void |
createAndOpenMap(java.util.List<IGeoResource> resources,
IProject owner,
boolean wait)
creates a map and opens an editor for the map. |
static IToolContext |
createContext(IMap map)
Creates a Tools Context out of Map. |
static IMap |
drawMap(ApplicationGIS.DrawMapParameter params2)
Renders the provided map on to the provided graphics2D object. |
static IMap |
getActiveMap()
Returns the active map. |
static IProject |
getActiveProject()
Obtains the current project. |
static java.util.List<UDIGEditorInputDescriptor> |
getEditorInputs(java.lang.Class<? extends IProjectElement> type)
Returns an editor input for the type passed in. |
static UDIGEditorInput |
getInput(IProjectElement element)
Returns the IEditorInput instance that wraps the element argument. |
static java.util.Collection<? extends IMap> |
getOpenMaps()
Returns all open maps. |
static java.util.List<? extends IProject> |
getProjects()
Return all Projects. |
static IToolManager |
getToolManager()
Returns the ToolManager singleton. |
static IViewPart |
getView(boolean show,
java.lang.String id)
Gets a reference to a view. |
static java.util.Collection<? extends IMap> |
getVisibleMaps()
Returns all visible maps. |
static IProjectElement |
loadProjectElement(java.net.URL url,
IProject project)
Loads the project element indicated by the url and adds the map to the provided project. |
static void |
openMap(IMap map)
Opens a Map editor for the provided map, This is a non-blocking call. |
static void |
openMap(IMap map,
boolean wait)
Opens a Map editor for the provided map. |
static void |
openProjectElement(IProjectElement obj,
boolean wait)
Opens a IProjectElement for editing/viewing. |
static void |
run(ISafeRunnable request)
Runs the given runnable in a protected mode. |
static void |
setActiveMapTracker(ActiveMapTracker activeMapTrackerToSet)
This method should only be called by uDig. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Map NO_MAP
Constructor Detail |
---|
public ApplicationGIS()
Method Detail |
---|
public static IProject getActiveProject()
public static java.util.List<? extends IProject> getProjects()
public static IMap getActiveMap()
NO_MAP
if there is no open map.
public static java.util.Collection<? extends IMap> getOpenMaps()
public static java.util.Collection<? extends IMap> getVisibleMaps()
public static void openMap(IMap map)
map
- the map to open. Must be an instance of Map.public static void openMap(IMap map, boolean wait)
map
- the map to open. Must be an instance of Map.wait
- indicates whether to wait for the map to open before returning.public static void createAndOpenMap(java.util.List<IGeoResource> resources)
a
- list of IGeoResources. Each resource will be a layer in the created map.public static void createAndOpenMap(java.util.List<IGeoResource> resources, IProject owner)
a
- list of IGeoResources. Each resource will be a layer in the created map.owner
- the project that will contain the map. owner must be an instance of Project. If
it is obtained using the framework then this will always be the case.public static void createAndOpenMap(java.util.List<IGeoResource> resources, IProject owner, boolean wait)
a
- list of IGeoResources. Each resource will be a layer in the created map.owner
- the project that will contain the map. owner must be an instance of Project. If
it is obtained using the framework then this will always be the case.wait
- indicates whether to wait for the map to open before returning.public static IViewPart getView(boolean show, java.lang.String id)
show
- whether to show the view or not.id
- the id of the view to show.
public static void run(ISafeRunnable request)
public static java.util.List<UDIGEditorInputDescriptor> getEditorInputs(java.lang.Class<? extends IProjectElement> type)
type
-
public static IToolManager getToolManager()
public static UDIGEditorInput getInput(IProjectElement element)
public static IToolContext createContext(IMap map)
map
- that the context interacts with
ToolContext
public static java.util.List<? extends ILayer> addLayersToMap(IMap map, java.util.List<IGeoResource> resourceList, int startPosition)
NOTE map may be null. If it is then the current open map will be used (see
getActiveMap()
or a new map will be created if that is null.
map
- the map to add the layers to. If null the current active map will be used or a new
one will be createdresourceList
- Resources to add to the map.startPosition
- z-position of the layers to add. if -1 it will be added to the top of the
map (0 is the bottom of the map and map.getMapLayer.size() is the top of the map).
public static java.util.List<? extends ILayer> addLayersToMap(IProject project, java.util.List<IGeoResource> resourceList)
project
- project that new map should be added toresourceList
- Resources to add to the map.startPosition
- z-position of the layers to add. if -1 it will be added to the top of the
map (0 is the bottom of the map and map.getMapLayer.size() is the top of the map).
public static java.util.List<? extends ILayer> addLayersToMap(IMap map, java.util.List<IGeoResource> resourceList, int startPosition, Project project)
NOTE map may be null. If it is then the current open map will be used (see
getActiveMap()
or a new map will be created if that is null.
map
- the map to add the layers to. If null the current active map will be used or a new
one will be createdresourceList
- Resources to add to the map.startPosition
- z-position of the layers to add. if -1 it will be added to the top of the
map (0 is the bottom of the map and map.getMapLayer.size() is the top of the map).project
- project that map should be added to... Only used if there is no current map.
If project is then the default project is used.
public static java.util.List<? extends ILayer> addLayersToMap(IMap map2, java.util.List<IGeoResource> resourceList, int startPosition2, IProject project2, boolean wait)
NOTE map may be null. If it is then the current open map will be used (see
getActiveMap()
or a new map will be created if that is null.
map
- the map to add the layers to. If null the current active map will be used or a new
one will be createdresourceList
- Resources to add to the map.startPosition
- z-position of the layers to add. if -1 it will be added to the top of the
map (0 is the bottom of the map and map.getMapLayer.size() is the top of the map).project
- project that map should be added to... Only used if there is no current map.
If project is then the default project is used.wait
- if true then method will block until map has been opened otherwise will return without blocking.public static IProjectElement loadProjectElement(java.net.URL url, IProject project) throws java.io.IOException, java.lang.IllegalArgumentException
url
- the project element to loadproject
- the project to add the project element to.
java.io.IOException
- thrown if there is a problem reading the project element file
java.lang.IllegalArgumentException
- thrown if the file indicated by the URL is not a project
element file.public static void openProjectElement(IProjectElement obj, boolean wait)
IProjectElement
for editing/viewing.
obj
- object to openwait
- whether or not to perform the action asynchronouslypublic static IMap drawMap(ApplicationGIS.DrawMapParameter params2) throws RenderException
params
- parameters that describe how and where to draw the map
RenderException
- Thrown if an error occurs such as a unreachable server.public static void setActiveMapTracker(ActiveMapTracker activeMapTrackerToSet)
activeMapTracker
- the tracker that managers
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |