Class GeoMapViewer

java.lang.Object
org.eclipse.jface.viewers.Viewer
org.eclipse.jface.viewers.ContentViewer
org.eclipse.nebula.widgets.geomap.jface.GeoMapViewer
All Implemented Interfaces:
org.eclipse.jface.viewers.IInputProvider, org.eclipse.jface.viewers.IInputSelectionProvider, org.eclipse.jface.viewers.ISelectionProvider

public class GeoMapViewer
extends org.eclipse.jface.viewers.ContentViewer
A JFace viewer for the GeoMap widget, that shows the geo-location of the input elements. The LocationProvider maps the input elements to geo-locations
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static int CLIP_ON_ELEMENT_POSITION
    Constant indicating the location markers should be clipped, based on their position
    static int CLIP_ON_IMAGE_BOUNDS
    Constant indicating the location markers should be clipped, based on the bounding box of their image
    static int MOVE_SELECTION_ALLOW_CHECK_IMMEDIATE
    Constant indicating the selection will be moved immediately, using the LocationProvider's set method
    static int MOVE_SELECTION_ALLOW_CHECK_LATE
    Constant indicating the selection will be moveable, but the actual move is performed using the LocationProvider's set method, when dropping
    static int MOVE_SELECTION_NONE
    Constant indicating the selection cannot be moved, i.e. its location is read-only
    static int NO_CLIP
    Constant indicating that location markers should not be clipped

    Fields inherited from class org.eclipse.jface.viewers.Viewer

    WIDGET_DATA_KEY
  • Constructor Summary

    Constructors 
    Constructor Description
    GeoMapViewer​(GeoMap geoMap)
    Creates a GeoMapViewer for a specific GeoMap
    GeoMapViewer​(org.eclipse.swt.widgets.Composite parent, int flags)
    Creates a GeoMapViewer with a default GeoMap inside a specific Composite
  • Method Summary

    Modifier and Type Method Description
    org.eclipse.swt.widgets.Control getControl()  
    java.lang.Object getElementAt​(int x, int y, int thumbSize)
    Gets the element found within the rectangle of the given position and size
    GeoMap getGeoMap()
    Returns the underlying GeoMap control
    LocationProvider getLocationProvider()
    Returns the location provider for this GeoMapViewer.
    int getMoveSelectionMode()
    Gets the current move mode
    org.eclipse.jface.viewers.ISelection getSelection()  
    org.eclipse.jface.window.ToolTip getToolTip()
    Gets the current ToolTip
    protected void handleDispose​(org.eclipse.swt.events.DisposeEvent event)  
    protected void handleLabelProviderChanged​(org.eclipse.jface.viewers.LabelProviderChangedEvent event)  
    (package private) void handleToolTip​(org.eclipse.swt.events.MouseEvent e)  
    (package private) void handleToolTip​(org.eclipse.swt.widgets.Event e)  
    protected void inputChanged​(java.lang.Object input, java.lang.Object oldInput)  
    void refresh()  
    void reveal​(java.lang.Object selection, boolean center)
    Pans the viewer so the element is revealed
    void revealAll()
    Pans and zooms so all elements are revealed.
    void setClipRule​(int clipRule)
    Sets the clipping rule
    void setLocationProvider​(LocationProvider locationProvider)
    Sets the location provider for this GeoMapViewer.
    void setMoveSelectionMode​(int moveSelectionMode)
    Sets the current move mode, one of MOVE_SELECTION_NONE, MOVE_SELECTION_ALLOW_CHECK_IMMEDIATE or MOVE_SELECTION_ALLOW_CHECK_LATE
    void setSelection​(org.eclipse.jface.viewers.ISelection selection, boolean reveal)  
    void zoomTo​(java.lang.Object[] elements, int maxZoom)
    Zooms out so all elements are revealed, but only upto a certain zoom level.

    Methods inherited from class org.eclipse.jface.viewers.ContentViewer

    getContentProvider, getInput, getLabelProvider, hookControl, labelProviderChanged, setContentProvider, setInput, setLabelProvider

    Methods inherited from class org.eclipse.jface.viewers.Viewer

    addHelpListener, addSelectionChangedListener, fireHelpRequested, fireSelectionChanged, getData, handleHelpRequest, removeHelpListener, removeSelectionChangedListener, scrollDown, scrollUp, setData, setSelection

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • NO_CLIP

      public static int NO_CLIP
      Constant indicating that location markers should not be clipped
    • CLIP_ON_ELEMENT_POSITION

      public static int CLIP_ON_ELEMENT_POSITION
      Constant indicating the location markers should be clipped, based on their position
    • CLIP_ON_IMAGE_BOUNDS

      public static int CLIP_ON_IMAGE_BOUNDS
      Constant indicating the location markers should be clipped, based on the bounding box of their image
    • MOVE_SELECTION_NONE

      public static final int MOVE_SELECTION_NONE
      Constant indicating the selection cannot be moved, i.e. its location is read-only
      See Also:
      Constant Field Values
    • MOVE_SELECTION_ALLOW_CHECK_IMMEDIATE

      public static final int MOVE_SELECTION_ALLOW_CHECK_IMMEDIATE
      Constant indicating the selection will be moved immediately, using the LocationProvider's set method
      See Also:
      Constant Field Values
    • MOVE_SELECTION_ALLOW_CHECK_LATE

      public static final int MOVE_SELECTION_ALLOW_CHECK_LATE
      Constant indicating the selection will be moveable, but the actual move is performed using the LocationProvider's set method, when dropping
      See Also:
      Constant Field Values
  • Constructor Details

    • GeoMapViewer

      public GeoMapViewer​(GeoMap geoMap)
      Creates a GeoMapViewer for a specific GeoMap
      Parameters:
      geoMap - the GeoMap
    • GeoMapViewer

      public GeoMapViewer​(org.eclipse.swt.widgets.Composite parent, int flags)
      Creates a GeoMapViewer with a default GeoMap inside a specific Composite
      Parameters:
      parent - the parent Composite
      flags - the SWT options
  • Method Details

    • handleDispose

      protected void handleDispose​(org.eclipse.swt.events.DisposeEvent event)
      Overrides:
      handleDispose in class org.eclipse.jface.viewers.ContentViewer
    • handleLabelProviderChanged

      protected void handleLabelProviderChanged​(org.eclipse.jface.viewers.LabelProviderChangedEvent event)
      Overrides:
      handleLabelProviderChanged in class org.eclipse.jface.viewers.ContentViewer
    • getLocationProvider

      public LocationProvider getLocationProvider()
      Returns the location provider for this GeoMapViewer.
      Returns:
      the location provider
    • setLocationProvider

      public void setLocationProvider​(LocationProvider locationProvider)
      Sets the location provider for this GeoMapViewer. The location provider determines where the icon for each element is placed.
      Parameters:
      locationProvider - the location provider
    • getElementAt

      public java.lang.Object getElementAt​(int x, int y, int thumbSize)
      Gets the element found within the rectangle of the given position and size
      Parameters:
      x - the x coordinate of center of the rectangle
      y - the y coordinate of center of the rectangle
      thumbSize - the width and height of the rectangle
      Returns:
      the element found or null, if none where found
    • setClipRule

      public void setClipRule​(int clipRule)
      Sets the clipping rule
      Parameters:
      clipRule - the clipping rule, one of the constants NO_CLIP, CLIP_ON_ELEMENT_POSITION or CLIP_ON_IMAGE_BOUNDS
    • getControl

      public org.eclipse.swt.widgets.Control getControl()
      Specified by:
      getControl in class org.eclipse.jface.viewers.Viewer
    • getGeoMap

      public GeoMap getGeoMap()
      Returns the underlying GeoMap control
      Returns:
      the underlying GeoMap control
    • getSelection

      public org.eclipse.jface.viewers.ISelection getSelection()
      Specified by:
      getSelection in interface org.eclipse.jface.viewers.ISelectionProvider
      Specified by:
      getSelection in class org.eclipse.jface.viewers.Viewer
    • refresh

      public void refresh()
      Specified by:
      refresh in class org.eclipse.jface.viewers.Viewer
    • inputChanged

      protected void inputChanged​(java.lang.Object input, java.lang.Object oldInput)
      Overrides:
      inputChanged in class org.eclipse.jface.viewers.Viewer
    • setSelection

      public void setSelection​(org.eclipse.jface.viewers.ISelection selection, boolean reveal)
      Specified by:
      setSelection in class org.eclipse.jface.viewers.Viewer
    • reveal

      public void reveal​(java.lang.Object selection, boolean center)
      Pans the viewer so the element is revealed
      Parameters:
      selection - the element to reveal
      center - whether to center on the element
    • revealAll

      public void revealAll()
      Pans and zooms so all elements are revealed.
    • setMoveSelectionMode

      public void setMoveSelectionMode​(int moveSelectionMode)
      Sets the current move mode, one of MOVE_SELECTION_NONE, MOVE_SELECTION_ALLOW_CHECK_IMMEDIATE or MOVE_SELECTION_ALLOW_CHECK_LATE
      Parameters:
      moveSelectionMode -
    • getMoveSelectionMode

      public int getMoveSelectionMode()
      Gets the current move mode
      Returns:
      the current move mode
    • getToolTip

      public org.eclipse.jface.window.ToolTip getToolTip()
      Gets the current ToolTip
      Returns:
      the current ToolTip
    • handleToolTip

      void handleToolTip​(org.eclipse.swt.widgets.Event e)
    • handleToolTip

      void handleToolTip​(org.eclipse.swt.events.MouseEvent e)
    • zoomTo

      public void zoomTo​(java.lang.Object[] elements, int maxZoom)
      Zooms out so all elements are revealed, but only upto a certain zoom level.
      Parameters:
      elements - the elements to reveal
      maxZoom - the maximum zoom