ilog.views.maps.beans
Class IlvCoordinateViewer

java.lang.Object
  extended by java.awt.Component
      extended by ilog.views.maps.beans.IlvCoordinateViewer
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public class IlvCoordinateViewer
extends Component

This class defines an AWT Component that can display the coordinates of the mouse when it is on top of an IlvManagerView displaying a map.

The coordinates can be displayed in two modes:

Note : Before JViews 5.0, georeferencing information used to be stored in an IlvProjectionProperty. As of JViews 5.0, IlvCoordinateSystemProperty must be used, and this class continues to work with an IlvProjectionProperty. This compatibility will be removed in the next version.
This component is packaged as a Bean and is designed to be used very easily in a JAVA development environment supporting visual programming with Beans.

Since:
JViews 5.0
See Also:
IlvProjectionProperty, IlvCoordinateSystemProperty, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static int CARTESIAN_MODE
          The mode used to display the mouse coordinates in the manager coordinate system.
static int DMS_MODE
          The mode used to display the mouse coordinates in degrees, minutes and seconds.
 
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
IlvCoordinateViewer()
          Creates a new coordinate viewer.
 
Method Summary
 String getEastingLabel()
          Returns the prompt string to be displayed before the easting value of the mouse coordinates.
 IlvGeographicCoordinateSystem getGeographicCoordinateSystem()
          Returns the geographic coordinate system used by this coordinate viewer.
 Dimension getMinimumSize()
          Returns the minimum size of the component.
 int getMode()
          Returns the display mode of the mouse coordinates.
 String getNoProjectionMessage()
          Returns the message to be displayed if the coordinate viewer is used in DMS mode on a manager that has no IlvCoordinateSystem that can be converted to georeferenced coordinates.
 String getNorthingLabel()
          Returns the prompt string to be displayed before the northing value of the mouse coordinates.
 Dimension getPreferredSize()
          Returns the preferred size of the component.
 IlvManagerView getView()
          Returns the IlvManagerView view that controls the coordinate viewer.
 boolean isDisplayEasting()
          Returns true if this coordinate viewer displays the easting value of the mouse coordinates.
 boolean isDisplayNorthing()
          Returns true if this coordinate viewer displays the northing value of the mouse coordinates.
 boolean isVertical()
          Returns the orientation of the display.
 void paint(Graphics g)
          Draws the component.
 void setDisplayEasting(boolean displayEasting)
          Specifies whether the coordinate viewer should display the easting value of the mouse coordinates.
 void setDisplayNorthing(boolean displayNorthing)
          Specifies whether the coordinate viewer should display the northing value of the mouse coordinates.
 void setEastingLabel(String label)
          Sets the prompt string to be displayed before the easting value of the mouse coordinates.
 void setGeographicCoordinateSystem(IlvGeographicCoordinateSystem gcs)
          Sets a geographic coordinate system on the coordinate viewer.
 void setMode(int mode)
          Specifies the display mode of the mouse coordinates.
 void setNoProjectionMessage(String message)
          Sets the message to be displayed if the coordinate viewer is used in DMS mode on a manager that has no IlvCoordinateSystem that can be converted to georeferenced coordinates.
 void setNorthingLabel(String label)
          Sets the prompt string to be displayed before the northing value of the mouse coordinates.
 void setVertical(boolean vertical)
          Sets the orientation of the display.
 void setView(IlvManagerView view)
          Sets the view for which coordinates are to be displayed.
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CARTESIAN_MODE

public static final int CARTESIAN_MODE
The mode used to display the mouse coordinates in the manager coordinate system.

See Also:
Constant Field Values

DMS_MODE

public static final int DMS_MODE
The mode used to display the mouse coordinates in degrees, minutes and seconds.

See Also:
Constant Field Values
Constructor Detail

IlvCoordinateViewer

public IlvCoordinateViewer()
Creates a new coordinate viewer. The instance is not active until it is associated with an IlvManagerView view.

See Also:
setView(ilog.views.IlvManagerView)
Method Detail

setNoProjectionMessage

public void setNoProjectionMessage(String message)
Sets the message to be displayed if the coordinate viewer is used in DMS mode on a manager that has no IlvCoordinateSystem that can be converted to georeferenced coordinates.

Parameters:
message - The message to be displayed.

getNoProjectionMessage

public String getNoProjectionMessage()
Returns the message to be displayed if the coordinate viewer is used in DMS mode on a manager that has no IlvCoordinateSystem that can be converted to georeferenced coordinates.


setEastingLabel

public void setEastingLabel(String label)
Sets the prompt string to be displayed before the easting value of the mouse coordinates. The default value is "X = ".

Parameters:
label - The easting label.

getEastingLabel

public String getEastingLabel()
Returns the prompt string to be displayed before the easting value of the mouse coordinates.


setNorthingLabel

public void setNorthingLabel(String label)
Sets the prompt string to be displayed before the northing value of the mouse coordinates. The default value is "Y = ".

Parameters:
label - The northing label.

getNorthingLabel

public String getNorthingLabel()
Returns the prompt string to be displayed before the northing value of the mouse coordinates.

Returns:
The northing label.

setDisplayEasting

public void setDisplayEasting(boolean displayEasting)
Specifies whether the coordinate viewer should display the easting value of the mouse coordinates. The coordinate viewer can be used to display either the easting value or the northing value of the coordinates, or both.

Parameters:
displayEasting - If true, easting is displayed.

isDisplayEasting

public boolean isDisplayEasting()
Returns true if this coordinate viewer displays the easting value of the mouse coordinates.


setDisplayNorthing

public void setDisplayNorthing(boolean displayNorthing)
Specifies whether the coordinate viewer should display the northing value of the mouse coordinates. The coordinate viewer can be used to display either the easting value or the northing value of the coordinates, or both.

Parameters:
displayNorthing - If true, northing is displayed.

isDisplayNorthing

public boolean isDisplayNorthing()
Returns true if this coordinate viewer displays the northing value of the mouse coordinates.


setMode

public void setMode(int mode)
Specifies the display mode of the mouse coordinates.

Parameters:
mode - The display mode.
See Also:
IlvJCoordinateViewer.CARTESIAN_MODE, IlvJCoordinateViewer.DMS_MODE

getMode

public int getMode()
Returns the display mode of the mouse coordinates.

Returns:
The current display mode.

setView

public void setView(IlvManagerView view)
Sets the view for which coordinates are to be displayed.


getView

public IlvManagerView getView()
Returns the IlvManagerView view that controls the coordinate viewer.


getPreferredSize

public Dimension getPreferredSize()
Returns the preferred size of the component.

Overrides:
getPreferredSize in class Component

getMinimumSize

public Dimension getMinimumSize()
Returns the minimum size of the component.

Overrides:
getMinimumSize in class Component

setGeographicCoordinateSystem

public void setGeographicCoordinateSystem(IlvGeographicCoordinateSystem gcs)
Sets a geographic coordinate system on the coordinate viewer. In DMS_MODE, this coordinate system is used to compute the mouse location.

Parameters:
gcs - The geographic coordinate system.

getGeographicCoordinateSystem

public IlvGeographicCoordinateSystem getGeographicCoordinateSystem()
Returns the geographic coordinate system used by this coordinate viewer. The default geographic coordinate system is IlvGeographicCoordinateSystem.KERNEL.

See Also:
IlvJCoordinateViewer.setGeographicCoordinateSystem(ilog.views.maps.srs.coordsys.IlvGeographicCoordinateSystem)

setVertical

public void setVertical(boolean vertical)
Sets the orientation of the display.

Parameters:
vertical - If set to true the northing value is displayed under the easting value. If set to false, the northing value is displayed to the right of the easting value.

isVertical

public boolean isVertical()
Returns the orientation of the display.

See Also:
setVertical(boolean)

paint

public void paint(Graphics g)
Draws the component.

Overrides:
paint in class Component


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.