|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
jp.sf.mapswidgets.GoogleMaps
public class GoogleMaps
Instances of this class implement the Google Maps browser.
Note that although this class is a subclass of Composite
,
it does not make sense to set a layout on it.
IMPORTANT: This class is not intended to be subclassed.
Field Summary |
---|
Fields inherited from class org.eclipse.swt.widgets.Control |
---|
handle |
Constructor Summary | |
---|---|
GoogleMaps(org.eclipse.swt.widgets.Composite parent,
int style)
Constructs a new instance of this class given its parent and a style value describing its behavior and appearance. |
|
GoogleMaps(org.eclipse.swt.widgets.Composite parent,
int style,
java.lang.String url)
Constructs a new instance of this class given its parent and a style value describing its behavior and appearance. |
Method Summary | |
---|---|
void |
addGoogleMapsListener(GoogleMapsListener listener)
Adds the listener to the collection of listeners who will be notified when the Google Maps status is changed, by sending it one of the messages defined in the GoogleMapsListener
interface. |
void |
addOverlay(Overlay added)
Adds the given overlay object (Marker or Polyline) to the map. |
boolean |
execute(java.lang.String script)
Executes a java script code |
java.lang.String |
executeWithResult(java.lang.String script)
Executes a java script code and get a result. |
Point |
getCenter()
Returns the center point of the map viewport in latitude/longitude coordinates. |
Bounds |
getMapBounds()
Returns the latitude/longitude bounds of the map viewport. |
Size |
getMapSpan()
Returns the width and height of the map viewport in latitude/longitude ticks. |
MapType |
getMapType()
Returns the map type currently in use. |
MapType[] |
getSupportedMapTypes()
Returns an array of map types supported by this map. |
int |
getZoomLevel()
Returns the integer zoom level of the map. |
void |
hideWindow()
Closes the window if it is open. |
boolean |
isDraggingEnabled()
Returns true if dynamic dragging is enabled. |
boolean |
isInfoWindowEnabled()
Returns true if the info window is enabled on this map. |
boolean |
isLargeMapControlVisible()
Returns true if the large pan/zoom map control is showed. |
boolean |
isMapTypeControlVisible()
Returns true if the map type control is showed. |
boolean |
isSmallMapControlVisible()
Returns true if the small pan/zoom map control is showed. |
boolean |
isSmallZoomControlVisible()
Returns true if the small zoom map control (no panning control) is showed. |
void |
moveTo(Point targetPoint)
Centers the map at the given point, doing a fluid pan to the point if it is within the current map viewport. |
void |
removeAllOverlays()
Removes all of the overlays from the map. |
void |
removeGoogleMapsListener(GoogleMapsListener listener)
Removes the listener from the collection of listeners who will be notified when the Google Maps status is changed. |
void |
removeOverlay(Overlay removed)
Removes the given overlay object from the map. |
void |
runAfterLoading(java.lang.Runnable runAfterLoading)
Set the code running after this component is initialized (Google Maps page loading finished). |
void |
setCenter(Point newPoint)
Centers the map at the given point. |
void |
setDebug(boolean on)
Turns on/off the debug mode. |
void |
setDraggingEnabled(boolean on)
Enables/Disables dynamic dragging (enabled by default). |
void |
setInfoWindowEnabled(boolean on)
Enables/Disables the info window on this map (enabled by default). |
void |
setLargeMapControlVisible(boolean on)
Shows/Hieds the large pan/zoom map control. |
void |
setMapType(MapType newMapType)
Switches this map to the given map type. |
void |
setMapTypeControlVisible(boolean on)
Shows/Hieds the map type control. |
void |
setSmallMapControlVisible(boolean on)
Shows/Hieds the small pan/zoom map control. |
void |
setSmallZoomControlVisible(boolean on)
Shows/Hieds the small zoom map control (no panning control). |
void |
setZoomLevel(int newLevel)
Zooms to the given integer zoom level, ignoring the request if the given zoom level is outside the bounds of the current map type. |
void |
showInfoWindow(Point point,
java.lang.String html)
Displays the info window with the given HTML content at the given point. |
void |
showInfoWindow(Point point,
java.lang.String html,
Size offset)
Displays the info window with the given HTML content at the given point. |
void |
showMapWindow(Point point)
Shows a blowup of the map at the given point. |
void |
showMapWindow(Point point,
int zoomLevel)
Shows a blowup of the map at the given point. |
void |
showMapWindow(Point point,
int zoomLevel,
MapType type)
Shows a blowup of the map at the given point. |
void |
showMapWindow(Point point,
int zoomLevel,
MapType type,
Size offset)
Shows a blowup of the map at the given point. |
Methods inherited from class org.eclipse.swt.widgets.Composite |
---|
changed, computeSize, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setFocus, setLayout, setLayoutDeferred, setTabList |
Methods inherited from class org.eclipse.swt.widgets.Scrollable |
---|
computeTrim, getClientArea, getHorizontalBar, getVerticalBar |
Methods inherited from class org.eclipse.swt.widgets.Control |
---|
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBounds, setBounds, setCapture, setCursor, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update |
Methods inherited from class org.eclipse.swt.widgets.Widget |
---|
addDisposeListener, addListener, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, setData, setData, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GoogleMaps(org.eclipse.swt.widgets.Composite parent, int style)
The style value is either one of the style constants defined in
class SWT
which is applicable to instances of this
class, or must be built by bitwise OR'ing together
(that is, using the int
"|" operator) two or more
of those SWT
style constants. The class description
lists the style constants that are applicable to the class.
Style bits are also inherited from superclasses.
parent
- a widget which will be the parent of the new instance (cannot be null)style
- the style of widget to construct
java.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- org.eclipse.swt.SWTError
- Widget.getStyle()
public GoogleMaps(org.eclipse.swt.widgets.Composite parent, int style, java.lang.String url)
The style value is either one of the style constants defined in
class SWT
which is applicable to instances of this
class, or must be built by bitwise OR'ing together
(that is, using the int
"|" operator) two or more
of those SWT
style constants. The class description
lists the style constants that are applicable to the class.
Style bits are also inherited from superclasses.
parent
- a widget which will be the parent of the new instance (cannot be null)style
- the style of widget to constructurl
- the url of a Google Maps included page
java.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- org.eclipse.swt.SWTError
- Widget.getStyle()
Method Detail |
---|
public void addGoogleMapsListener(GoogleMapsListener listener)
GoogleMapsListener
interface.
See Google Maps API documentation [Class Reference > GMap > Events].
clicked(Overlay clicked)
is called when the user clicks the overlay on the map.
clicked(Point point)
is called when the user clicks the map.
moved()
is called when the map is moving. This event is triggered continuously as the map is dragged.
moveStarted()
is called at the beginning of a continuous pan/drag movement. This event is not triggered when the map moves discretely.
moveEnded()
is called at the end of a discrete or continuous map movement. This event is triggered once at the end of a continuous pan.
zoomed(int oldZoomLevel, int newZoomLevel)
is called after the map zoom level changes.
mapTypeChanged()
is called after the map type (Map, Hybrid, or Satellite) changes.
windowOpend()
is called after the info window is displayed.
windowClosed()
is called after the info window is closed.
overlayAdded(Overlay added)
is called after an overlay is added to the map.
overlayRemoved(Overlay removed)
is called after an overlay is removed from the map.
allOverlaysRemoved()
is called after all overlays are cleared from the map.
listener
- the listener which should be notified
java.lang.IllegalArgumentException
- GoogleMapsListener
,
GoogleMapsAdapter
,
removeGoogleMapsListener(jp.sf.mapswidgets.GoogleMapsListener)
public void addOverlay(Overlay added)
See Google Maps API documentation [Class Reference > GMap > addOverlay(overlay)].
added
- an added overlaypublic boolean execute(java.lang.String script)
script
- a java script code
public java.lang.String executeWithResult(java.lang.String script)
If you want to get a result value from a java script code, you must set the status bar by code.
script
- a java script code
public Point getCenter()
See Google Maps API documentation [Class Reference > GMap > getCenterLatLng()].
public Bounds getMapBounds()
See Google Maps API documentation [Class Reference > GMap > getBoundsLatLng()].
public Size getMapSpan()
See Google Maps API documentation [Class Reference > GMap > getSpanLatLng()].
public MapType getMapType()
See Google Maps API documentation [Class Reference > GMap > getCurrentMapType()].
public MapType[] getSupportedMapTypes()
See Google Maps API documentation [Class Reference > GMap > getMapTypes()].
public int getZoomLevel()
See Google Maps API documentation [Class Reference > GMap > getZoomLevel()].
public void hideWindow()
See Google Maps API documentation [Class Reference > GMap > closeInfoWindow()].
public boolean isDraggingEnabled()
See Google Maps API documentation [Class Reference > GMap > draggingEnabled()].
public boolean isInfoWindowEnabled()
See Google Maps API documentation [Class Reference > GMap > infoWindowEnabled()].
public boolean isLargeMapControlVisible()
See Google Maps API documentation [API Overview > Controls > GLargeMapControl].
public boolean isMapTypeControlVisible()
See Google Maps API documentation [API Overview > Controls > GMapTypeControl].
public boolean isSmallMapControlVisible()
See Google Maps API documentation [API Overview > Controls > GSmallMapControl].
public boolean isSmallZoomControlVisible()
See Google Maps API documentation [API Overview > Controls > GSmallZoomControl].
public void moveTo(Point targetPoint)
See Google Maps API documentation [Class Reference > GMap > recenterOrPanToLatLng(latLng)].
targetPoint
- a new target pointpublic void removeAllOverlays()
See Google Maps API documentation [Class Reference > GMap > clearOverlays()].
public void removeGoogleMapsListener(GoogleMapsListener listener)
listener
- the listener which should no longer be notified
java.lang.IllegalArgumentException
- GoogleMapsListener
,
GoogleMapsAdapter
,
addGoogleMapsListener(jp.sf.mapswidgets.GoogleMapsListener)
public void removeOverlay(Overlay removed)
See Google Maps API documentation [Class Reference > GMap > removeOverlay(overlay)].
removed
- the removed overlaypublic void runAfterLoading(java.lang.Runnable runAfterLoading)
runAfterLoading
- the code after initialized
org.eclipse.swt.SWTException
- if the code is already settedpublic void setCenter(Point newPoint)
See Google Maps API documentation [Class Reference > GMap > centerAtLatLng(latLng)].
newPoint
- a new center pointpublic void setDebug(boolean on)
on
- public void setDraggingEnabled(boolean on)
See Google Maps API documentation [Class Reference > GMap > enableDragging()/disableDragging()].
on
- public void setInfoWindowEnabled(boolean on)
See Google Maps API documentation [Class Reference > GMap > enableInfoWindow()/disableInfoWindow()].
on
- public void setLargeMapControlVisible(boolean on)
See Google Maps API documentation [API Overview > Controls > GLargeMapControl].
on
- public void setMapType(MapType newMapType)
See Google Maps API documentation [Class Reference > GMap > setMapType(mapType)].
newMapType
- a new map typepublic void setMapTypeControlVisible(boolean on)
See Google Maps API documentation [API Overview > Controls > GMapTypeControl].
on
- public void setSmallMapControlVisible(boolean on)
See Google Maps API documentation [API Overview > Controls > GSmallMapControl].
on
- public void setSmallZoomControlVisible(boolean on)
See Google Maps API documentation [API Overview > Controls > GSmallZoomControl].
on
- public void setZoomLevel(int newLevel)
See Google Maps API documentation [Class Reference > GMap > zoomTo(zoomLevel)].
newLevel
- a new zoom levelpublic void showInfoWindow(Point point, java.lang.String html)
See Google Maps API documentation [Class Reference > GMap > openInfoWindowHtml(latLng, htmlStr)].
point
- the point of the info windowhtml
- the content of the info windowpublic void showInfoWindow(Point point, java.lang.String html, Size offset)
See Google Maps API documentation [Class Reference > GMap > openInfoWindowHtml(latLng, htmlStr, pixelOffset)].
point
- the point of the info windowhtml
- the content of the info windowoffset
- the offset of the info windowpublic void showMapWindow(Point point)
See Google Maps API documentation [Class Reference > GMap > showMapBlowup(point)].
point
- the point of the map windowpublic void showMapWindow(Point point, int zoomLevel)
See Google Maps API documentation [Class Reference > GMap > showMapBlowup(point, zoomLevel)].
point
- the point of the map windowzoomLevel
- the zoom level in the map windowpublic void showMapWindow(Point point, int zoomLevel, MapType type)
See Google Maps API documentation [Class Reference > GMap > showMapBlowup(point, zoomLevel, mapType)].
point
- the point of the map windowzoomLevel
- the zoom level in the map windowtype
- the map type in the map windowpublic void showMapWindow(Point point, int zoomLevel, MapType type, Size offset)
See Google Maps API documentation [Class Reference > GMap > showMapBlowup(point, zoomLevel, mapType, pixelOffset)].
point
- the point of the map windowzoomLevel
- the zoom level in the map windowtype
- the map type in the map windowoffset
- the offset of the map window
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |