Skip navigation links
org.eclipse.nebula.widgets.geomap

Class GeoMap

    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String ABOUT_MSG
      About message.
      • Fields inherited from class org.eclipse.swt.widgets.Control

        handle
    • Constructor Summary

      Constructors 
      Constructor and Description
      GeoMap(org.eclipse.swt.widgets.Composite parent, int style)
      Creates a new GeoMap using the default size for its internal cache of tiles.
      GeoMap(org.eclipse.swt.widgets.Composite parent, int style, org.eclipse.swt.graphics.Point mapPosition, int zoom)
      Creates a new GeoMap using the default size for its internal cache of tiles
      GeoMap(org.eclipse.swt.widgets.Composite parent, int style, org.eclipse.swt.graphics.Point mapPosition, int zoom, int cacheSize)
      Creates a new GeoMap using the default size for its internal cache of tiles
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addGeoMapListener(GeoMapListener listener)
      Adds a GeoMapListener, that will be notified of changes to the position and zoom level
      void addMouseHandler(java.util.EventListener listener)
      Adds listener to appropriate listener lists depending on the listener interfaces that are implemented.
      org.eclipse.swt.graphics.Point computeSize(int wHint, int hHint) 
      org.eclipse.swt.graphics.Point computeSize(int wHint, int hHint, boolean changed) 
      org.eclipse.swt.graphics.Point getCenterPosition()
      Returns the position of the center of this GeoMap.
      org.eclipse.swt.graphics.Point getCursorPosition()
      Returns the map position of the mouse cursor.
      DefaultMouseHandler getDefaultMouseHandler()
      Returns the default mouse handler, so it may be configured or removed.
      TileServer getTileServer()
      Returns the current TileServer of this GeoMap.
      void removeGeoMapListener(GeoMapListener listener)
      Removes a GeoMapListener, so it no longer will be notified of changes to the position and zoom level
      void removeMouseHandler(java.util.EventListener listener)
      Removes listener from appropriate listener lists depending on the listener interfaces that are implemented.
      void setCenterPosition(org.eclipse.swt.graphics.Point mapPosition)
      Sets the position of the center of this GeoMap, without any panning effect.
      void setMapPosition(int x, int y)
      Sets the position of the upper left corner of this GeoMap, without any panning effect.
      void setMapPosition(org.eclipse.swt.graphics.Point mapPosition)
      Sets the position of the upper left corner of this GeoMap, without any panning effect.
      void setTileServer(TileServer tileServer)
      Sets the current TileServer of this GeoMap.
      void setZoom(int zoom)
      Sets the zoom level, without any transition effect.
      void translateMapPosition(int tx, int ty)
      Translates the position of the upper left corner of this GeoMap, without any panning effect.
      void zoomIn(org.eclipse.swt.graphics.Point pivot)
      Zooms in, while ensuring that the pivot point remains at the same screen location.
      void zoomOut(org.eclipse.swt.graphics.Point pivot)
      Zooms out, while ensuring that the pivot point remains at the same screen location.
      void zoomTo(org.eclipse.swt.graphics.Rectangle rect)
      Zooms into and centers on the specified rectangle.
      • Methods inherited from class org.eclipse.swt.widgets.Canvas

        drawBackground, getCaret, getIME, scroll, setCaret, setFont, setIME
      • Methods inherited from class org.eclipse.swt.widgets.Composite

        changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
      • Methods inherited from class org.eclipse.swt.widgets.Scrollable

        computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
      • Methods inherited from class org.eclipse.swt.widgets.Control

        addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
      • Methods inherited from class org.eclipse.swt.widgets.Widget

        addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.eclipse.swt.graphics.Drawable

        isAutoScalable
    • Field Detail

      • ABOUT_MSG

        public static final java.lang.String ABOUT_MSG
        About message.
        See Also:
        Constant Field Values
    • Constructor Detail

      • GeoMap

        public GeoMap(org.eclipse.swt.widgets.Composite parent,
                      int style)
        Creates a new GeoMap using the default size for its internal cache of tiles. The map is showing the position (275091, 180145 at zoom level 11. In other words this constructor is best used only in debugging scenarios.
        Parameters:
        parent - SWT parent Composite
        style - SWT style as in Canvas, since this class inherits from it. Double buffering is always enabed.
      • GeoMap

        public GeoMap(org.eclipse.swt.widgets.Composite parent,
                      int style,
                      org.eclipse.swt.graphics.Point mapPosition,
                      int zoom)
        Creates a new GeoMap using the default size for its internal cache of tiles
        Parameters:
        parent - SWT parent Composite
        style - SWT style as in Canvas, since this class inherits from it. Double buffering is always enabed.
        mapPosition - initial mapPosition.
        zoom - initial map zoom
      • GeoMap

        public GeoMap(org.eclipse.swt.widgets.Composite parent,
                      int style,
                      org.eclipse.swt.graphics.Point mapPosition,
                      int zoom,
                      int cacheSize)
        Creates a new GeoMap using the default size for its internal cache of tiles
        Parameters:
        parent - SWT parent Composite
        style - SWT style as in Canvas, since this class inherits from it. Double buffering is always enabed.
        mapPosition - initial mapPosition.
        zoom - initial map zoom
        cacheSize - initial cache size, eg number of tile-images that are kept in cache to prevent reloading from the network.
    • Method Detail

      • getDefaultMouseHandler

        public DefaultMouseHandler getDefaultMouseHandler()
        Returns the default mouse handler, so it may be configured or removed.
        Returns:
        the default mouse handler
      • addMouseHandler

        public void addMouseHandler(java.util.EventListener listener)
        Adds listener to appropriate listener lists depending on the listener interfaces that are implemented.
        Parameters:
        listener - the listener
      • removeMouseHandler

        public void removeMouseHandler(java.util.EventListener listener)
        Removes listener from appropriate listener lists depending on the listener interfaces that are implemented.
        Parameters:
        listener - the listener
      • getTileServer

        public TileServer getTileServer()
        Returns the current TileServer of this GeoMap.
        Returns:
        the current TileServer
      • setTileServer

        public void setTileServer(TileServer tileServer)
        Sets the current TileServer of this GeoMap. Note that this will clear the map and reload the tiles using the new TileServer.
        Parameters:
        tileServer - the TileServer
      • addGeoMapListener

        public void addGeoMapListener(GeoMapListener listener)
        Adds a GeoMapListener, that will be notified of changes to the position and zoom level
        Parameters:
        listener - the GeoMapListener
      • removeGeoMapListener

        public void removeGeoMapListener(GeoMapListener listener)
        Removes a GeoMapListener, so it no longer will be notified of changes to the position and zoom level
        Parameters:
        listener - the GeoMapListener
      • setMapPosition

        public void setMapPosition(org.eclipse.swt.graphics.Point mapPosition)
        Sets the position of the upper left corner of this GeoMap, without any panning effect.
        Parameters:
        mapPosition - the new position
      • setMapPosition

        public void setMapPosition(int x,
                                   int y)
        Sets the position of the upper left corner of this GeoMap, without any panning effect.
        Specified by:
        setMapPosition in interface GeoMapPositioned
        Overrides:
        setMapPosition in class InternalGeoMap
        Parameters:
        x - the x-coordinate of the position
        y - the y-coordinate of the position
      • translateMapPosition

        public void translateMapPosition(int tx,
                                         int ty)
        Translates the position of the upper left corner of this GeoMap, without any panning effect.
        Parameters:
        tx - the relative distance in x-direction
        ty - the relative distance in y-direction
      • setZoom

        public void setZoom(int zoom)
        Sets the zoom level, without any transition effect.
        Specified by:
        setZoom in interface GeoMapPositioned
        Overrides:
        setZoom in class InternalGeoMap
        Parameters:
        zoom - the new zoom level
      • zoomIn

        public void zoomIn(org.eclipse.swt.graphics.Point pivot)
        Zooms in, while ensuring that the pivot point remains at the same screen location.
        Parameters:
        pivot - the point that will remain at the same screen location.
      • zoomOut

        public void zoomOut(org.eclipse.swt.graphics.Point pivot)
        Zooms out, while ensuring that the pivot point remains at the same screen location.
        Parameters:
        pivot - the point that will remain at the same screen location.
      • zoomTo

        public void zoomTo(org.eclipse.swt.graphics.Rectangle rect)
        Zooms into and centers on the specified rectangle.
        Parameters:
        rect - the rectangle
      • getCenterPosition

        public org.eclipse.swt.graphics.Point getCenterPosition()
        Returns the position of the center of this GeoMap. The coordinates depend on the zoom level.
        Returns:
        the position of the center of this GeoMap
      • setCenterPosition

        public void setCenterPosition(org.eclipse.swt.graphics.Point mapPosition)
        Sets the position of the center of this GeoMap, without any panning effect.
        Parameters:
        mapPosition - the new position
      • getCursorPosition

        public org.eclipse.swt.graphics.Point getCursorPosition()
        Returns the map position of the mouse cursor.
        Returns:
        the map position of the mouse cursor
      • computeSize

        public org.eclipse.swt.graphics.Point computeSize(int wHint,
                                                          int hHint,
                                                          boolean changed)
        Overrides:
        computeSize in class org.eclipse.swt.widgets.Control
      • computeSize

        public org.eclipse.swt.graphics.Point computeSize(int wHint,
                                                          int hHint)
        Overrides:
        computeSize in class org.eclipse.swt.widgets.Control