Class CellSelectionLayer

All Implemented Interfaces:
com.bbn.openmap.event.MapMouseListener, com.bbn.openmap.event.ProjectionListener, com.bbn.openmap.ProjectionPainter, com.bbn.openmap.PropertyConsumer, MapDataListener, ActionListener, ImageObserver, MenuContainer, BeanContextChild, BeanContextMembershipListener, Serializable, EventListener

public class CellSelectionLayer extends ZoneDelimiterLayer implements com.bbn.openmap.event.MapMouseListener
Ce layer permet de dessinner un cadrillage avec une latitude/longitude max et min, ainsi qu'un pas de maille. Dans ce cadrillage, il est ensuite possible de selectionner des carres. Cette selection peut se faire avec la souris. Il y a diiferents mode de de selections qui sont NO_SELECTION, SINGLE_SELECTION et MULT_SELECTION. Created: Mon Jan 21 13:42:55 2002
Version:
$Revision$ Last update : $Date$ By : $Author$
Author:
See Also:
  • Field Details

    • selectionMode

      protected int selectionMode
      Current layer selection mode.
    • NO_SELECTION

      public static final int NO_SELECTION
      No selection enabled.
      See Also:
    • SINGLE_SELECTION

      public static final int SINGLE_SELECTION
      Only single celle selection enabled.
      See Also:
    • MULT_SELECTION

      public static final int MULT_SELECTION
      Multi selection enabled.
      See Also:
  • Constructor Details

    • CellSelectionLayer

      public CellSelectionLayer(MapDataProvider mapDataProvider, int selectionMode) throws org.nuiton.topia.TopiaException
      Throws:
      org.nuiton.topia.TopiaException
  • Method Details

    • getSelectionMode

      public int getSelectionMode()
      Get the value of selectionMode.
      Returns:
      value of selectionMode.
    • setSelectionMode

      public void setSelectionMode(int v)
      Set the value of selectionMode.
      Parameters:
      v - Value to assign to selectionMode.
    • findXY

      public com.bbn.openmap.omGraphics.OMRect findXY(com.bbn.openmap.proj.coords.LatLonPoint pt)
      Permet de retrouver le carre incluant le point donne.
      Parameters:
      pt - le point pour lequel on cherche le carre correspondant
      Returns:
      le carre correspondant au point donne sinon renvoie null.
    • getSelected

      public List<com.bbn.openmap.proj.coords.LatLonPoint> getSelected()
      Renvoie tous les carres selectionnes.
      Returns:
      le vecteur contenant des LatLonPoint des carres selectionnes.
    • unSelectAll

      public void unSelectAll()
      Deselectionne tous les carres.
    • select

      public boolean select(com.bbn.openmap.proj.coords.LatLonPoint pt)
      Permet de selectionner le carre incluant le point donne.
      Parameters:
      pt - le point pour lequel on cherche le carre correspondant
      Returns:
      true si reussi sinon false.
    • select

      public boolean select(float latitude, float longitude)
      Permet de selectionner le carre incluant le point donne en latitude et longitude.
      Parameters:
      latitude - la latitude du point
      longitude - la longitude du point
      Returns:
      true si reussi sinon false.
    • unSelect

      public boolean unSelect(com.bbn.openmap.proj.coords.LatLonPoint pt)
      Permet de deselectionner le carre incluant le point donne.
      Parameters:
      pt - le point pour lequel on cherche le carre correspondant
      Returns:
      true si reussi sinon false.
    • unSelect

      public boolean unSelect(float latitude, float longitude)
      Permet de deselectionner le carre incluant le point donne en latitude et longitude.
      Parameters:
      latitude - la latitude du point
      longitude - la longitude du point
      Returns:
      true si reussi sinon false.
    • getMouseModeServiceList

      public String[] getMouseModeServiceList()
      Return a list of the modes that are interesting to the MapMouseListener. The source MouseEvents will only get sent to the MapMouseListener if the mode is set to one that the listener is interested in. Layers interested in receiving events should register for receiving events in "select" mode.
        return new String[1] {
            SelectMouseMode.modeID
       };
       
      Specified by:
      getMouseModeServiceList in interface com.bbn.openmap.event.MapMouseListener
      See Also:
      • NavMouseMode.modeID
      • SelectMouseMode.modeID
      • NullMouseMode.modeID
    • getMapMouseListener

      public com.bbn.openmap.event.MapMouseListener getMapMouseListener()
      Note: A layer interested in receiving amouse events should implement this function . Otherwise, return the default, which is null.
      Overrides:
      getMapMouseListener in class com.bbn.openmap.Layer
    • mousePressed

      public boolean mousePressed(MouseEvent e)
      Invoked when a mouse button has been pressed on a component.
      Specified by:
      mousePressed in interface com.bbn.openmap.event.MapMouseListener
      Parameters:
      e - MouseEvent
      Returns:
      true if the listener was able to process the event.
    • mouseReleased

      public boolean mouseReleased(MouseEvent e)
      Invoked when a mouse button has been released on a component.
      Specified by:
      mouseReleased in interface com.bbn.openmap.event.MapMouseListener
      Parameters:
      e - MouseEvent
      Returns:
      true if the listener was able to process the event.
    • mouseClicked

      public boolean mouseClicked(MouseEvent e)
      Invoked when the mouse has been clicked on a component. The listener will receive this event if it successfully processed mousePressed(), or if no other listener processes the event. If the listener successfully processes mouseClicked(), then it will receive the next mouseClicked() notifications that have a click count greater than one.
      Specified by:
      mouseClicked in interface com.bbn.openmap.event.MapMouseListener
      Parameters:
      e - MouseListener MouseEvent to handle.
      Returns:
      true if the listener was able to process the event.
    • mouseEntered

      public void mouseEntered(MouseEvent e)
      Invoked when the mouse enters a component.
      Specified by:
      mouseEntered in interface com.bbn.openmap.event.MapMouseListener
      Parameters:
      e - MouseListener MouseEvent to handle.
    • mouseExited

      public void mouseExited(MouseEvent e)
      Invoked when the mouse exits a component.
      Specified by:
      mouseExited in interface com.bbn.openmap.event.MapMouseListener
      Parameters:
      e - MouseListener MouseEvent to handle.
    • mouseDragged

      public boolean mouseDragged(MouseEvent e)
      Invoked when a mouse button is pressed on a component and then dragged. The listener will receive these events if it successfully processes mousePressed(), or if no other listener processes the event.
      Specified by:
      mouseDragged in interface com.bbn.openmap.event.MapMouseListener
      Parameters:
      e - MouseMotionListener MouseEvent to handle.
      Returns:
      true if the listener was able to process the event.
    • mouseMoved

      public boolean mouseMoved(MouseEvent e)
      Invoked when the mouse button has been moved on a component (with no buttons no down).
      Specified by:
      mouseMoved in interface com.bbn.openmap.event.MapMouseListener
      Parameters:
      e - MouseListener MouseEvent to handle.
      Returns:
      true if the listener was able to process the event.
    • mouseMoved

      public void mouseMoved()
      Handle a mouse cursor moving without the button being pressed. This event is intended to tell the listener that there was a mouse movement, but that the event was consumed by another layer. This will allow a mouse listener to clean up actions that might have happened because of another motion event response.
      Specified by:
      mouseMoved in interface com.bbn.openmap.event.MapMouseListener