fr.ifremer.isisfish.map
Class CellSelectionLayer

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by com.bbn.openmap.Layer
                  extended by fr.ifremer.isisfish.map.ZoneDelimiterLayer
                      extended by fr.ifremer.isisfish.map.CellSelectionLayer
All Implemented Interfaces:
com.bbn.openmap.event.MapMouseListener, com.bbn.openmap.event.ProjectionListener, com.bbn.openmap.ProjectionPainter, com.bbn.openmap.PropertyConsumer, ActionListener, ImageObserver, MenuContainer, BeanContextChild, BeanContextMembershipListener, Serializable, EventListener, org.nuiton.topia.event.TopiaTransactionListener

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: 2771 $ Last update : $Date: 2009-11-23 16:03:22 +0100 (lun., 23 nov. 2009) $ By : $Author: chatellier $
Author:
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static int MULT_SELECTION
          Multi selection enabled.
static int NO_SELECTION
          No selection enabled.
protected  int selectionMode
          Current layer selection mode.
static int SINGLE_SELECTION
          Only single celle selection enabled.
 
Fields inherited from class fr.ifremer.isisfish.map.ZoneDelimiterLayer
cells, fisheryRegion, graphics, pasMailleLatitude, pasMailleLongitude, proj
 
Fields inherited from class com.bbn.openmap.Layer
addAsBackground, AddAsBackgroundProperty, addToBeanContext, AddToBeanContextProperty, attributes, autoPalette, AutoPaletteProperty, beanContextChildSupport, DisplayPaletteCmd, DisplayPropertiesCmd, doHack, HidePaletteCmd, i18n, IDListeners, localHackList, lsListeners, maxScale, MaxScaleProperty, minScale, MinScaleProperty, palette, paletteListener, PrettyNameProperty, propertyPrefix, RedrawCmd, removable, RemovableProperty, SWING_PACKAGE, windowSupport
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface com.bbn.openmap.PropertyConsumer
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
CellSelectionLayer(FisheryRegion fisheryRegion, int selectionMode)
           
 
Method Summary
 com.bbn.openmap.omGraphics.OMGraphic findXY(com.bbn.openmap.LatLonPoint pt)
          Permet de retrouver le carre incluant le point donne.
 com.bbn.openmap.event.MapMouseListener getMapMouseListener()
          Note: A layer interested in receiving amouse events should implement this function .
 String[] getMouseModeServiceList()
          Return a list of the modes that are interesting to the MapMouseListener.
 List<com.bbn.openmap.LatLonPoint> getSelected()
          Renvoie tous les carres selectionnes.
 int getSelectionMode()
          Get the value of selectionMode.
 boolean mouseClicked(MouseEvent e)
          Invoked when the mouse has been clicked on a component.
 boolean mouseDragged(MouseEvent e)
          Invoked when a mouse button is pressed on a component and then dragged.
 void mouseEntered(MouseEvent e)
          Invoked when the mouse enters a component.
 void mouseExited(MouseEvent e)
          Invoked when the mouse exits a component.
 void mouseMoved()
          Handle a mouse cursor moving without the button being pressed.
 boolean mouseMoved(MouseEvent e)
          Invoked when the mouse tton has been moved on a component (with no buttons no down).
 boolean mousePressed(MouseEvent e)
          Invoked when a mouse button has been pressed on a component.
 boolean mouseReleased(MouseEvent e)
          Invoked when a mouse button has been released on a component.
 boolean select(float latitude, float longitude)
          Permet de selectionner le carre incluant le point donne en latitude et longitude.
 boolean select(com.bbn.openmap.LatLonPoint pt)
          Permet de selectionner le carre incluant le point donne.
 void setSelectionMode(int v)
          Set the value of selectionMode.
 boolean unSelect(float latitude, float longitude)
          Permet de deselectionner le carre incluant le point donne en latitude et longitude.
 boolean unSelect(com.bbn.openmap.LatLonPoint pt)
          Permet de deselectionner le carre incluant le point donne.
 void unSelectAll()
          Deselectionne tous les carres.
 
Methods inherited from class fr.ifremer.isisfish.map.ZoneDelimiterLayer
commit, generateGraphics, getProjection, paint, projectionChanged, refresh, renderDataForProjection, rollback, setProjection
 
Methods inherited from class com.bbn.openmap.Layer
actionPerformed, addComponentListener, added, addInfoDisplayListener, addLayerStatusListener, addMouseListener, addVetoableChangeListener, childrenAdded, childrenRemoved, clearListeners, connectToBeanContext, createWindowSupport, finalize, findAndInit, findAndInit, findAndUndo, fireHideToolTip, firePaletteEvent, fireRequestBrowserContent, fireRequestBrowserContent, fireRequestCursor, fireRequestInfoLine, fireRequestInfoLine, fireRequestInfoLine, fireRequestMessage, fireRequestMessage, fireRequestToolTip, fireRequestToolTip, fireRequestURL, fireRequestURL, fireStatusUpdate, fireStatusUpdate, fireVetoableChange, getAddAsBackground, getAddToBeanContext, getAttribute, getBeanContext, getGUI, getIcon, getMaxScale, getMinScale, getPackage, getPalette, getProperties, getPropertyInfo, getPropertyPrefix, getWindowSupport, hasGUI, hidePalette, isAutoPalette, isProjectionOK, isRemovable, notifyHideHack, putAttribute, removeComponentListener, removeConfirmed, removed, removeInfoDisplayListener, removeLayerStatusListener, removeVetoableChangeListener, repaint, resetPalette, setAddAsBackground, setAddToBeanContext, setAutoPalette, setBeanContext, setIcon, setLayerProperties, setMaxScale, setMinScale, setName, setPaletteVisible, setProjection, setProperties, setProperties, setPropertyPrefix, setRemovable, setVisible, setWindowSupport, showPalette
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.beans.beancontext.BeanContextChild
addPropertyChangeListener, removePropertyChangeListener
 

Field Detail

selectionMode

protected int selectionMode
Current layer selection mode.


NO_SELECTION

public static final int NO_SELECTION
No selection enabled.

See Also:
Constant Field Values

SINGLE_SELECTION

public static final int SINGLE_SELECTION
Only single celle selection enabled.

See Also:
Constant Field Values

MULT_SELECTION

public static final int MULT_SELECTION
Multi selection enabled.

See Also:
Constant Field Values
Constructor Detail

CellSelectionLayer

public CellSelectionLayer(FisheryRegion fisheryRegion,
                          int selectionMode)
                   throws org.nuiton.topia.TopiaException
Throws:
org.nuiton.topia.TopiaException
Method Detail

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.OMGraphic findXY(com.bbn.openmap.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.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.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.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 tton 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


Copyright © 1999-2010 CodeLutin. All Rights Reserved.