es.prodevelop.gvsig.mobile.gui.canvas
Class MapControl

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended byes.prodevelop.gvsig.mobile.gui.canvas.MapControl
All Implemented Interfaces:
javax.accessibility.Accessible, Animable, java.awt.event.ComponentListener, java.util.EventListener, GPSRelevantEventsListener, java.awt.image.ImageObserver, java.awt.MenuContainer, Refreshable, SelectionListener, java.io.Serializable, ViewPortListener

public class MapControl
extends java.awt.Panel
implements ViewPortListener, Refreshable, Animable, SelectionListener, GPSRelevantEventsListener, java.awt.event.ComponentListener

This class is the canvas of the application, where layers and drawn. It receives events from: the viewport (extent events), the mapcontext (selection events) and the GPS device (when new GPS data is available). It holds also a reference to the tools (toolbars) and owns the project and the TOC.

Author:
jldominguez
See Also:
ViewPort, MapContext, GPSManagementEventsListener, Serialized Form

Field Summary
 MapCursor gps_cursor
           
 GroupToolbar groupButtons
          A reference to the group button tool bar
 Project project
           
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
MapControl(MainWindow mw, int w)
          Constructor.
 
Method Summary
 void addGroupButton(ToolBarGroupButton gb, boolean b)
          Adds a new group button in the group button bar (left side of the window)
 void addLayer(FLayer lyr, boolean repaint)
          Add a new layer to the map.
 void cancelDrawing()
          Used to cancel the drawing.
 void clearCanvass()
          Clears this component with the backgrouond color
 void clearSelection()
          This method performs the "clear selection" action.
 void closeDataSources()
          Closes current datasources.
 void componentHidden(java.awt.event.ComponentEvent arg0)
           
 void componentMoved(java.awt.event.ComponentEvent arg0)
           
 void componentResized(java.awt.event.ComponentEvent arg0)
           
 void componentShown(java.awt.event.ComponentEvent arg0)
           
 boolean draw(boolean doClear)
          Main method to draw the map.
 void extentChanged(ExtentEvent e, boolean repaint)
          Called when the extent changes (part of viewport listener)
 int[] getCurrentColumn(int x, int y, int len)
          Gets a column of pixels from the current image map.
 java.awt.Image getCurrentImage()
          Gets the image of the current map
 int[] getCurrentRow(int x, int y, int len)
          Gets a row of pixels from the current image map.
 TBButton getCurrentTool()
          Returns the active Tool associated to the Listener in MapToolListener Only tools of type TBSelectableTool (subclass of TBButton) registers listeners, so only this objects will be real active tools
 GPSRelevantEventsListener getGPSListener()
          Gets the GPS event listener
 FLayer[] getInfoableLayers(boolean only_vect)
          Gets an array with the layers that are infoable.
 FLayer getLayer(int index)
          Gets i-th layer
 int getLayerCount()
          Gets number of layers in current map
 MapContext getMapContext()
          Gets the map context object
 MainWindow getParentFrame()
          Gets parent main window.
 Project getProject()
          Gets the current project
 IProjection getProjection()
          Gets current projection (gets the data from the project)
 FLayer getSelectedLayer(boolean only_vect)
          Gets currently selected layer (in TOC), or null if there is no selection
 TransparentCanvas getSymbolsCanvas()
          Gets the object where measurement symbols are drawn.
 LayersTable getToc()
          Get the TOC object (table of current layers)
 ViewPort getViewPort()
          Get the viewport
 void gpsNewAltitude(double altitude)
          New GPS event : altitude
 void gpsNewHeading(double heading)
          Returns a new heading
 void gpsNewPDOP(double pdop)
          New GPS event : PDOP value
 void gpsNewPosition(double longitude, double latitude)
          New GPS event: new position (this is the main GPS event)
 void gpsNewQuality(int quality)
          New GPS event : quality value
 void gpsNewSatsUsed(int satUsed)
          New GPS event : satellites used
 void gpsNewSecondsFromMidnight(int seconds)
          New GPS event: time
 void gpsNewSpeed(double speed)
          New GPS event: new speed data
 void gpsNewStatus(int status)
          New GPS event : status value
 boolean isGpsPositionVisible()
          Tells whether the GPS icon is currently visible
 boolean isProcessing()
          Used to know if the canvas (this object) is currently in the drawing process.
 void paint(java.awt.Graphics g)
          Overriden paint method.
 void recenter(int x_, int y_)
          Tells the map control to recenter the map at the given pixel.
 void redraw(boolean clear)
          Used to redraw the map
 void refresh(boolean update)
          Used to refresh the map
 void refresh(int x, int y, int w, int h)
          Forces a refresh fo the MapControl given the top-left corner and the size
 void refresh(java.awt.Rectangle rectangle)
          Forces a refresh fo the MapControl given a rectangle with the area to refresh
 void refreshGPSCursor()
          Tells the map copntrol to redraw the GPS cursor
 void removeLayer(FLayer lyr)
          Remove one layer from the current map.
 void saveAsPng()
          Saves current map as PNG (tells user output file name)
 void selectionChanged(SelectionEvent e)
          Called when the selection changed a map has to be refreshed (part of selection listener)
 void setCurrentColumn(int x, int y, int[] pix)
          Sets RGBA values in a column of the map
 void setCurrentRow(int x, int y, int[] pix)
          Sets RGBA values in a row of the map
 boolean setDistanceGeometry(IGeometry ig, int ref_minx, int ref_miny, int ref_maxx, int ref_maxy)
          Sets the new multiline geometry while using the measure distance tool
 void setListener(TBButton button, boolean clearStatusBar)
          Sets a new active button by assigning it to a new Listener
 void setOffsetAndRefresh(int offsetx, int offsety, boolean refresh)
          Sets a new offset for the image (used with pan tool)
 void setProcessing(boolean b)
          Used when drawing process begins or ends.
 void setProject(Project project)
          Sets the current project
 void setProjection(IProjection proj)
          Sets the current projection (sets the data in the project)
 void setStatusBarIcon(int id, java.lang.String dir, java.lang.String filename)
          Set a new icon in the status bar
 void setStatusBarSubIcon(int id, java.lang.String dir, java.lang.String filename)
          Set a new subicon in the status bar
 void setStatusBarText(int id, java.lang.String txt)
          Set text in status bar.
 void setSymbolGeometryAreaInStatusBar()
          Tells the mapcontrol to write the area measurements as string in the status bar
 void setSymbolGeometryLengthAsDistanceInStatusBar()
          Tells the mapcontrol to write the distance measurements as string in the status bar
 void setToolBar(ToolBar t, int w)
          Set a new tool bar as the one selected.
 void setToolsImageForPanDrag(boolean set)
          Method used to warn this components that the pan tool starts to be in use, (mouse down), so drawing method will behave in a different way.
 void startGraphics(boolean initial)
          Thsi method initializes the graphics of this component.
 void step(int qty)
          Increases slightly the position of the group button bar
 void swap(int a, int b, boolean repaint)
          Swap order of the layers (arrow buttons in TOC)
 void switchTracklog()
          Switch tracklog activation button.
 void switchViewGPSPosition()
          Switch GPS visibility
 void switchViewGPSPositionOff()
          Force deactivation of GPS position visibility
 void switchViewGPSPositionOn()
          Force activation of GPS position visibility
 void update(java.awt.Graphics g)
          Overriden method to refresh component.
 void xorAndRepaint(int x, int y, int signed_w, int signed_h)
          Compute the XOR pixels of a region of the map.
 void zoomToSelection()
          This method performs the "zoom to selection" action.
 
Methods inherited from class java.awt.Panel
addNotify, getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

gps_cursor

public MapCursor gps_cursor

project

public Project project

groupButtons

public GroupToolbar groupButtons
A reference to the group button tool bar

Constructor Detail

MapControl

public MapControl(MainWindow mw,
                  int w)
Constructor. Initializes the TOC, all the listeners and the GPS device.

Parameters:
mw - the main window that owns this control
w - the width of the main window that owns this control
Method Detail

step

public void step(int qty)
Description copied from interface: Animable
Increases slightly the position of the group button bar

Specified by:
step in interface Animable
Parameters:
qty - amount in pixels

update

public void update(java.awt.Graphics g)
Overriden method to refresh component.


setToolBar

public void setToolBar(ToolBar t,
                       int w)
Set a new tool bar as the one selected.

Parameters:
t - the tool bar to be set as selected
w - canvas width (unused parameter)

getParentFrame

public MainWindow getParentFrame()
Gets parent main window.

Returns:
parent main window

paint

public void paint(java.awt.Graphics g)
Overriden paint method. Deals with: pan mode (drag-and-drop the map), paints the tools and the GPS cursor if necessary.


setToolsImageForPanDrag

public void setToolsImageForPanDrag(boolean set)
Method used to warn this components that the pan tool starts to be in use, (mouse down), so drawing method will behave in a different way.

Parameters:
set - whether or not the pan tool is in use

startGraphics

public void startGraphics(boolean initial)
Thsi method initializes the graphics of this component.

Parameters:
initial - Whether it is the application startup

getProjection

public IProjection getProjection()
Gets current projection (gets the data from the project)

Returns:
the current projection

setProjection

public void setProjection(IProjection proj)
Sets the current projection (sets the data in the project)

Parameters:
proj - the new projection

cancelDrawing

public void cancelDrawing()
Used to cancel the drawing. Currently unused.


draw

public boolean draw(boolean doClear)
Main method to draw the map.

Parameters:
doClear - whether the canvas has to be cleared before drawing.
Returns:
whether there was more than one layer

getViewPort

public ViewPort getViewPort()
Get the viewport

Returns:
the viewport

extentChanged

public void extentChanged(ExtentEvent e,
                          boolean repaint)
Called when the extent changes (part of viewport listener)

Specified by:
extentChanged in interface ViewPortListener

refresh

public void refresh(boolean update)
Used to refresh the map

Specified by:
refresh in interface Refreshable
Parameters:
update - where to use the update method or just the repain

refresh

public void refresh(int x,
                    int y,
                    int w,
                    int h)
Forces a refresh fo the MapControl given the top-left corner and the size

Parameters:
x - X coordinate of the left border area to refresh
y - Y coordinate of the top border area to refresh
w - Width of the area to refresh
h - Height of the area to refresh

refresh

public void refresh(java.awt.Rectangle rectangle)
Forces a refresh fo the MapControl given a rectangle with the area to refresh

Parameters:
rectangle - Area to be refreshed

closeDataSources

public void closeDataSources()
Closes current datasources. It's called whenm application terminates.


addLayer

public void addLayer(FLayer lyr,
                     boolean repaint)
Add a new layer to the map.

Parameters:
lyr - the new layer to be added
repaint - whether or not to repaint after adding the layer

removeLayer

public void removeLayer(FLayer lyr)
Remove one layer from the current map.

Parameters:
lyr - the layer to be removed

swap

public void swap(int a,
                 int b,
                 boolean repaint)
Swap order of the layers (arrow buttons in TOC)

Parameters:
a - 0-based index of one of the layers
b - 0-based index of the other layer
repaint - whether or not the map has to be repainte

getLayerCount

public int getLayerCount()
Gets number of layers in current map

Returns:
number of layers in current map

getLayer

public FLayer getLayer(int index)
Gets i-th layer

Parameters:
index - index of the desired layer
Returns:
i-th layer

getSelectedLayer

public FLayer getSelectedLayer(boolean only_vect)
Gets currently selected layer (in TOC), or null if there is no selection

Parameters:
only_vect - whether we are interested only in vector layers
Returns:
currently selected layer (in TOC), or null if there is no selection

setListener

public void setListener(TBButton button,
                        boolean clearStatusBar)
Sets a new active button by assigning it to a new Listener

Parameters:
button - TBButton to set active and assign to the Listener
clearStatusBar - whether the status bar has to be cleared

getCurrentTool

public TBButton getCurrentTool()
Returns the active Tool associated to the Listener in MapToolListener

Only tools of type TBSelectableTool (subclass of TBButton) registers listeners, so only this objects will be real active tools

Returns:
the current tool (must be of type TBButton)

getMapContext

public MapContext getMapContext()
Gets the map context object

Returns:
the map context object

getCurrentImage

public java.awt.Image getCurrentImage()
Gets the image of the current map

Returns:
the image of the current map

setOffsetAndRefresh

public void setOffsetAndRefresh(int offsetx,
                                int offsety,
                                boolean refresh)
Sets a new offset for the image (used with pan tool)

Specified by:
setOffsetAndRefresh in interface Refreshable
Parameters:
offsetx - new x offset
offsety - new y offset
refresh - whether a new refresh has to be done

getCurrentRow

public int[] getCurrentRow(int x,
                           int y,
                           int len)
Gets a row of pixels from the current image map.

Parameters:
x - x coordinate of the beginning of the row
y - y coordinate of the beginning of the row
len - length of the row
Returns:
array of RGBA values

getCurrentColumn

public int[] getCurrentColumn(int x,
                              int y,
                              int len)
Gets a column of pixels from the current image map.

Parameters:
x - x coordinate of the beginning of the column
y - y coordinate of the beginning of the column
len - length of the column
Returns:
array of RGBA values

setCurrentRow

public void setCurrentRow(int x,
                          int y,
                          int[] pix)
Sets RGBA values in a row of the map

Parameters:
x - x coordinate of the beginning of the row
y - y coordinate of the beginning of the row
pix - array of RGBA values to be written

setCurrentColumn

public void setCurrentColumn(int x,
                             int y,
                             int[] pix)
Sets RGBA values in a column of the map

Parameters:
x - x coordinate of the beginning of the column
y - y coordinate of the beginning of the column
pix - array of RGBA values to be written

xorAndRepaint

public void xorAndRepaint(int x,
                          int y,
                          int signed_w,
                          int signed_h)
Compute the XOR pixels of a region of the map. Uses signed width and height to be more flexible

Parameters:
x - x coordinate of the origin of the zone
y - y coordinate of the origin of the zone
signed_w - signed width of the region
signed_h - signed height of the region

clearCanvass

public void clearCanvass()
Clears this component with the backgrouond color


addGroupButton

public void addGroupButton(ToolBarGroupButton gb,
                           boolean b)
Adds a new group button in the group button bar (left side of the window)

Parameters:
gb - a new group button to be added
b - whether the new group button is selected

selectionChanged

public void selectionChanged(SelectionEvent e)
Called when the selection changed a map has to be refreshed (part of selection listener)

Specified by:
selectionChanged in interface SelectionListener
Parameters:
e -

zoomToSelection

public void zoomToSelection()
This method performs the "zoom to selection" action.


clearSelection

public void clearSelection()
This method performs the "clear selection" action.


setProcessing

public void setProcessing(boolean b)
Used when drawing process begins or ends. The process icon will show.

Specified by:
setProcessing in interface Refreshable
Parameters:
b - true when the process begins, false when it ends.

isProcessing

public boolean isProcessing()
Used to know if the canvas (this object) is currently in the drawing process.

Specified by:
isProcessing in interface Refreshable
Returns:
the value of the processing switch

getInfoableLayers

public FLayer[] getInfoableLayers(boolean only_vect)
Gets an array with the layers that are infoable.

Parameters:
only_vect - whether only vector layers have to be included
Returns:
an array with the layers that are infoable.

redraw

public void redraw(boolean clear)
Used to redraw the map

Specified by:
redraw in interface Refreshable
Parameters:
clear - whether the object has to be cleared before drawing again

getToc

public LayersTable getToc()
Get the TOC object (table of current layers)

Returns:
the TOC object

setDistanceGeometry

public boolean setDistanceGeometry(IGeometry ig,
                                   int ref_minx,
                                   int ref_miny,
                                   int ref_maxx,
                                   int ref_maxy)
Sets the new multiline geometry while using the measure distance tool

Parameters:
ig - the new multiline geometry
ref_minx - extent of the geometry in screen pixel coordinates
ref_miny - extent of the geometry in screen pixel coordinates
ref_maxx - extent of the geometry in screen pixel coordinates
ref_maxy - extent of the geometry in screen pixel coordinates
Returns:
whether the map ndeeds to be repainted

setSymbolGeometryLengthAsDistanceInStatusBar

public void setSymbolGeometryLengthAsDistanceInStatusBar()
Tells the mapcontrol to write the distance measurements as string in the status bar


setSymbolGeometryAreaInStatusBar

public void setSymbolGeometryAreaInStatusBar()
Tells the mapcontrol to write the area measurements as string in the status bar


setStatusBarText

public void setStatusBarText(int id,
                             java.lang.String txt)
Set text in status bar.

Parameters:
id - ID the the status bar
txt - text to be written

setStatusBarIcon

public void setStatusBarIcon(int id,
                             java.lang.String dir,
                             java.lang.String filename)
Set a new icon in the status bar

Parameters:
id - ID of the status bar
dir - folder where the image is
filename - file nameof the icon

setStatusBarSubIcon

public void setStatusBarSubIcon(int id,
                                java.lang.String dir,
                                java.lang.String filename)
Set a new subicon in the status bar

Parameters:
id - ID of the status bar
dir - folder where the image is
filename - file nameof the subicon

switchTracklog

public void switchTracklog()
Switch tracklog activation button. Active: start doing the track log, Inactive: stop


isGpsPositionVisible

public boolean isGpsPositionVisible()
Tells whether the GPS icon is currently visible

Returns:
whether the GPS icon is visible

switchViewGPSPosition

public void switchViewGPSPosition()
Switch GPS visibility


switchViewGPSPositionOff

public void switchViewGPSPositionOff()
Force deactivation of GPS position visibility


switchViewGPSPositionOn

public void switchViewGPSPositionOn()
Force activation of GPS position visibility


getGPSListener

public GPSRelevantEventsListener getGPSListener()
Gets the GPS event listener

Returns:
the GPS event listener

gpsNewSecondsFromMidnight

public void gpsNewSecondsFromMidnight(int seconds)
New GPS event: time

Parameters:
seconds - number of seconds since last midnight

gpsNewPosition

public void gpsNewPosition(double longitude,
                           double latitude)
New GPS event: new position (this is the main GPS event)

Specified by:
gpsNewPosition in interface GPSRelevantEventsListener
Parameters:
longitude - in EPSG:4326 (WGS84 datum)
latitude - in EPSG:4326 (WGS84 datum)

gpsNewSpeed

public void gpsNewSpeed(double speed)
New GPS event: new speed data

Parameters:
speed - the speed computed by the GPS device

refreshGPSCursor

public void refreshGPSCursor()
Tells the map copntrol to redraw the GPS cursor


saveAsPng

public void saveAsPng()
Saves current map as PNG (tells user output file name)


componentResized

public void componentResized(java.awt.event.ComponentEvent arg0)
Specified by:
componentResized in interface java.awt.event.ComponentListener

componentShown

public void componentShown(java.awt.event.ComponentEvent arg0)
Specified by:
componentShown in interface java.awt.event.ComponentListener

componentHidden

public void componentHidden(java.awt.event.ComponentEvent arg0)
Specified by:
componentHidden in interface java.awt.event.ComponentListener

componentMoved

public void componentMoved(java.awt.event.ComponentEvent arg0)
Specified by:
componentMoved in interface java.awt.event.ComponentListener

getProject

public Project getProject()
Gets the current project

Returns:
the current project

setProject

public void setProject(Project project)
Sets the current project

Parameters:
project - the new project

getSymbolsCanvas

public TransparentCanvas getSymbolsCanvas()
Gets the object where measurement symbols are drawn.

Returns:
the object where measurement symbols are drawn.

gpsNewAltitude

public void gpsNewAltitude(double altitude)
New GPS event : altitude

Specified by:
gpsNewAltitude in interface GPSRelevantEventsListener
Parameters:
altitude - the new altitude computed by the GPS device

gpsNewSatsUsed

public void gpsNewSatsUsed(int satUsed)
New GPS event : satellites used

Specified by:
gpsNewSatsUsed in interface GPSRelevantEventsListener
Parameters:
satUsed - the number of satellites currently detected and used by the GPS device

gpsNewPDOP

public void gpsNewPDOP(double pdop)
New GPS event : PDOP value

Specified by:
gpsNewPDOP in interface GPSRelevantEventsListener
Parameters:
pdop - a value regarding the quality of the GPS data

gpsNewQuality

public void gpsNewQuality(int quality)
New GPS event : quality value

Specified by:
gpsNewQuality in interface GPSRelevantEventsListener
Parameters:
quality - a value regarding the quality of the GPS data

gpsNewStatus

public void gpsNewStatus(int status)
New GPS event : status value

Specified by:
gpsNewStatus in interface GPSRelevantEventsListener
Parameters:
status - a value regarding the state of the GPS device

recenter

public void recenter(int x_,
                     int y_)
Tells the map control to recenter the map at the given pixel. It's the screen pixel where the user has clicked while using the recenter tool

Parameters:
x_ - coordinates to recenter to (screen pixel reference system)
y_ - coordinates to recenter to (screen pixel reference system)

gpsNewHeading

public void gpsNewHeading(double heading)
Description copied from interface: GPSRelevantEventsListener
Returns a new heading

Specified by:
gpsNewHeading in interface GPSRelevantEventsListener
Parameters:
heading - heading in degrees