public class GeoMapViewer
extends org.eclipse.jface.viewers.ContentViewer
Modifier and Type | Field and 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.
|
static int |
NO_CLIP
Constant indicating that location markers should not be clipped
|
Constructor and Description |
---|
GeoMapViewer(org.eclipse.swt.widgets.Composite parent,
int flags)
Creates a GeoMapViewer with a default GeoMap inside a specific Composite
|
GeoMapViewer(GeoMap geoMap)
Creates a GeoMapViewer for a specific GeoMap
|
Modifier and Type | Method and 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.widgets.Event e) |
(package private) void |
handleToolTip(org.eclipse.swt.events.MouseEvent 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.
|
getContentProvider, getInput, getLabelProvider, hookControl, labelProviderChanged, setContentProvider, setInput, setLabelProvider
public static int NO_CLIP
public static int CLIP_ON_ELEMENT_POSITION
public static int CLIP_ON_IMAGE_BOUNDS
public static final int MOVE_SELECTION_NONE
public static final int MOVE_SELECTION_ALLOW_CHECK_IMMEDIATE
public static final int MOVE_SELECTION_ALLOW_CHECK_LATE
public GeoMapViewer(GeoMap geoMap)
geoMap
- the GeoMappublic GeoMapViewer(org.eclipse.swt.widgets.Composite parent, int flags)
parent
- the parent Compositeflags
- the SWT optionsprotected void handleDispose(org.eclipse.swt.events.DisposeEvent event)
handleDispose
in class org.eclipse.jface.viewers.ContentViewer
protected void handleLabelProviderChanged(org.eclipse.jface.viewers.LabelProviderChangedEvent event)
handleLabelProviderChanged
in class org.eclipse.jface.viewers.ContentViewer
public LocationProvider getLocationProvider()
public void setLocationProvider(LocationProvider locationProvider)
locationProvider
- the location providerpublic java.lang.Object getElementAt(int x, int y, int thumbSize)
x
- the x coordinate of center of the rectangley
- the y coordinate of center of the rectanglethumbSize
- the width and height of the rectanglepublic void setClipRule(int clipRule)
clipRule
- the clipping rule, one of the constants NO_CLIP,
CLIP_ON_ELEMENT_POSITION or CLIP_ON_IMAGE_BOUNDSpublic org.eclipse.swt.widgets.Control getControl()
getControl
in class org.eclipse.jface.viewers.Viewer
public GeoMap getGeoMap()
public org.eclipse.jface.viewers.ISelection getSelection()
getSelection
in interface org.eclipse.jface.viewers.ISelectionProvider
getSelection
in class org.eclipse.jface.viewers.Viewer
public void refresh()
refresh
in class org.eclipse.jface.viewers.Viewer
protected void inputChanged(java.lang.Object input, java.lang.Object oldInput)
inputChanged
in class org.eclipse.jface.viewers.Viewer
public void setSelection(org.eclipse.jface.viewers.ISelection selection, boolean reveal)
setSelection
in class org.eclipse.jface.viewers.Viewer
public void reveal(java.lang.Object selection, boolean center)
selection
- the element to revealcenter
- whether to center on the elementpublic void revealAll()
public void setMoveSelectionMode(int moveSelectionMode)
moveSelectionMode
- public int getMoveSelectionMode()
public org.eclipse.jface.window.ToolTip getToolTip()
void handleToolTip(org.eclipse.swt.widgets.Event e)
void handleToolTip(org.eclipse.swt.events.MouseEvent e)
public void zoomTo(java.lang.Object[] elements, int maxZoom)
elements
- the elements to revealmaxZoom
- the maximum zoom