|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.refractions.udig.project.ui.viewers.MapViewer
public class MapViewer
A concrete viewer based on a ViewportPane widget.
In order to facilitate experimentation with a range of GIS widgets we have created a JFace "viewer" for working with a Map.
Field Summary | |
---|---|
protected Map |
map
This is the current map. |
protected ViewportPane |
viewport
This viewer's ViewportPane control. |
Constructor Summary | |
---|---|
MapViewer(Composite parent)
Creates a map viewer on a newly-created viewport pane under the given parent. |
|
MapViewer(Composite parent,
int style)
Creates a table viewer on a newly-created table control under the given parent. |
Method Summary | |
---|---|
void |
dispose()
|
Control |
getControl()
Access to the control (often this is the same as getViewport(). |
Map |
getMap()
This is the Map; you can send addLayer commands and so forth to this. |
Menu |
getMenu()
|
RenderManager |
getRenderManager()
The render manager responsible for rendering items in this view. |
protected ToolContext |
getToolContext()
|
ViewportPane |
getViewport()
Access to the ViewportPane |
void |
init(WorkbenchPart part)
Used to internal "MapPart" to the provided WorkbenchPart (any status messages etc.. |
void |
openContextMenu()
Will open the menu provided by getMenu(). |
void |
setFont(Control control)
|
void |
setMap(Map map)
Used to ask the widget to display the provided map. |
void |
setMenu(Menu contextMenu)
Context menu to be made visible as needed by tools. |
void |
setModalTool(ModalTool tool)
Accept the provided tool; call setContext; and activate the tool. |
void |
setResolutions(double[] resolutions)
For resolutions consider: |
void |
setSelectionProvider(IMapEditorSelectionProvider selectionProvider)
|
void |
zoomTo(int level)
Will zoom to the appropriate level (if a zoom model has been provided by setResolutions call). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ViewportPane viewport
protected Map map
Constructor Detail |
---|
public MapViewer(Composite parent)
The viewport pane is created using the SWT style bits
MULTI, H_SCROLL, V_SCROLL,
and BORDER
. The
viewer has no input, no content provider, a default label provider, no
sorter, and no filters. The table has no columns.
parent
- the parent controlpublic MapViewer(Composite parent, int style)
parent
- the parent controlstyle
- Use SWT.SINGLE or SWT.MULTI to control the use of tiles,
SWT.DOUBLE_BUFFERED and SWT.NO_BACKGROUND can be used to configure the canvas.Method Detail |
---|
public void init(WorkbenchPart part)
This is an *optional* step; if you can call this method setSelectionProvider will work.
part
- Editor or View workbench partpublic ViewportPane getViewport()
The Viewport is usually an SWT widget; to be sure check getControl().
public Control getControl()
You use this to work with DnD or context menu integration tasks.
public RenderManager getRenderManager()
public Map getMap()
public void setMap(Map map)
This method will register a listener on the provided map and the viewer will refresh as the map state changes.
map
- to display; or null for none.public void setMenu(Menu contextMenu)
contextMenu
- public Menu getMenu()
public void openContextMenu()
This method is called by tools to open the context menu
public void setModalTool(ModalTool tool)
The tool is responsible for registering any mouse listeners it requires when setActive( true ) is called. When the tool is replaced setActive( false ) will be called allowing you to clean up your listeners.
tool
- protected ToolContext getToolContext()
public void setFont(Control control)
public void setSelectionProvider(IMapEditorSelectionProvider selectionProvider)
public void dispose()
public void setResolutions(double[] resolutions)
WMSTileSet tileSet = (res.resolve( WMSTileSet.class, null ));
theResolutions = tileSet.getResolutions();
public void zoomTo(int level)
level
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |