## com.bbn.openmap.layer.link
Class LinkLayer

    java.lang.Object
      java.awt.Component
          java.awt.Container
              javax.swing.JComponent
                  com.bbn.openmap.Layer
                      com.bbn.openmap.layer.OMGraphicHandlerLayer
                          com.bbn.openmap.layer.link.LinkLayer

All Implemented Interfaces:
  java.awt.event.ActionListener, java.beans.beancontext.BeanContextChild, java.beans.beancontext.BeanContextMembershipListener, DrawingToolRequestor, java.util.EventListener, GestureResponsePolicy, java.awt.image.ImageObserver, LinkActionConstants, LinkPropertiesConstants, MapMouseListener, java.awt.MenuContainer, ProjectionListener, ProjectionPainter, PropertyConsumer, java.io.Serializable

Direct Known Subclasses:
  AmpLinkLayer, BufferedLinkLayer, DrawLinkLayer

public class LinkLayer
extends OMGraphicHandlerLayer
implements MapMouseListener, LinkPropertiesConstants, LinkActionConstants, DrawingToolRequestor

The LinkLayer is a Swing component, and an OpenMap layer, that communicates with a server via the Link protocol. It transmits graphics requests and gesture information, and handles the responses to those queries. The entry in the openmap.properties file looks like this:

           # port number of server
           link.port=3031

           # host name of server
           link.host=host.com

           # URL of properties file for server attributes.  Properties
           # contained in this file are passed directly to the server to provide
           # additional information to the server about how to provide the
           # graphics.  Some standard properties are listed in the
           # LinkPropertiesConstants file, but any property can be passed to the
           # server.  How the server handles the property depends on the server,
           # but non-applicable properties are ignored.
           link.propertiesURL=http://location.of.properties.file.com

You have to call setProperties() on this layer to set its parameters, and to start the thread that listens to updates from the server.

See Also:
  Serialized Form

Nested Class Summary

Nested classes inherited from class javax.swing.JComponent
`javax.swing.JComponent.AccessibleJComponent`

Nested classes inherited from class java.awt.Container
`java.awt.Container.AccessibleAWTContainer`

Nested classes inherited from class java.awt.Component
`java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy`

Field Summary
`protected LinkProperties` `args` The special parameters (attributes) transmitted to the server with every query.
`static java.lang.String` `ArgsProperty` The property name to specify a URL of a properties file containing properties that will be sent to the server within requests to it.
`protected OMGridGenerator` `currentGenerator` The generator to use with LinkGrid objects.
`static int` `DEFAULT_DISTANCE_LIMIT`
`protected int` `distanceLimit` The maximum distance away a mouse event can happen away from a graphic in order for it to be considered to have touched.
`static java.lang.String` `DistanceLimitProperty` The property to set a pixel distance limit for gestures.
`static java.lang.String` `ExitOnCommandProperty` The property to set to true if the server should be able to decide when to kill the client, the overall application.
`protected int` `gestureDescriptor` A masked integer describing which gestures should be sent to the server.
`static java.lang.String` `GridGeneratorProperty` The property to specify which grid generator to use for grid objects.
`protected java.lang.String` `host` The host where the server is running.
`static java.lang.String` `HostProperty` The property name to specify the hostname the server is running on.
`protected LinkManager` `linkManager` The object that provides a link to the layer (and its various threads) on a coordinateed basis.
`protected LinkListener` `listener` The thread listener used to communicate asynchronously.
`protected int` `port` The port to connect to the server on.
`static java.lang.String` `PortProperty` The property name to specify what port the server is running on.
`protected boolean` `quiet` The flag to supress pop-up messages.
`static java.lang.String` `QuietProperty` The property to make the layer quiet.
`static java.lang.String` `ServerLocationProperty`

Fields inherited from class com.bbn.openmap.layer.OMGraphicHandlerLayer
`consumeEvents, ConsumeEventsProperty, filter, interruptable, InterruptableProperty, layerWorker, LAYERWORKER_LOCK, mouseEventInterpreter, mouseModeIDs, MouseModesProperty, projectionChangePolicy, ProjectionChangePolicyProperty, renderPolicy, RenderPolicyProperty, selectedList, TransparencyProperty`

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.layer.link.LinkPropertiesConstants

`LPC_BACKWARD_DIAG_PATTERN, LPC_CENTER_LAT, LPC_CENTER_LONG, LPC_CLEAR_PROPERTIES, LPC_CLEAR_PROPERTIES_CHAR, LPC_CROSS_PATTERN, LPC_DASH, LPC_DASH_DOT, LPC_DASH_DOT_DOT, LPC_DIAG_CROSS_PATTERN, LPC_DOT, LPC_FILLCOLOR, LPC_FILLPATTERN, LPC_FORWARD_DIAG_PATTERN, LPC_GRAPHICID, LPC_HEIGHT, LPC_HIGHLIGHTCOLOR, LPC_HORIZONTAL_PATTERN, LPC_HTML, LPC_INFO, LPC_LATMAX, LPC_LATMIN, LPC_LINECOLOR, LPC_LINESTYLE, LPC_LINEWIDTH, LPC_LINKRASTERIMAGEURL, LPC_LINKROTATION, LPC_LINKTEXTBASELINE, LPC_LINKTEXTFONT, LPC_LINKTEXTSTRING, LPC_LONG_DASH, LPC_LONMAX, LPC_LONMIN, LPC_MESSAGE, LPC_OLD_FILLCOLOR, LPC_OLD_FILLPATTERN, LPC_OLD_HIGHLIGHTCOLOR, LPC_OLD_LINECOLOR, LPC_OLD_LINESTYLE, LPC_OLD_LINEWIDTH, LPC_OLD_LINKTEXTFONT, LPC_OLD_LINKTEXTSTRING, LPC_PROJECTION, LPC_PROPERY_MANAGEMENT_POLICY, LPC_PROPERY_MANAGEMENT_POLICY_CHAR, LPC_REUSE_PROPERTIES, LPC_REUSE_PROPERTIES_CHAR, LPC_SCALE, LPC_SOLID, LPC_SOLID_PATTERN, LPC_TIME, LPC_URL, LPC_VERTICAL_PATTERN, LPC_WIDTH`

Fields inherited from interface com.bbn.openmap.layer.link.LinkActionConstants

`ACTION_GRAPHICS, ACTION_GUI, ACTION_MAP, CLIENT_NOTIFICATION_MASK, GRAPHIC_ID_MASK, KEY_PRESSED_MASK, KEY_RELEASED_MASK, MODIFY_DELETE_GRAPHIC_MASK, MODIFY_DESELECT_GRAPHIC_MASK, MODIFY_DESELECTALL_GRAPHIC_MASK, MODIFY_LOWER_GRAPHIC_MASK, MODIFY_RAISE_GRAPHIC_MASK, MODIFY_SELECT_GRAPHIC_MASK, MOUSE_CLICKED_MASK, MOUSE_DRAGGED_MASK, MOUSE_ENTERED_MASK, MOUSE_EXITED_MASK, MOUSE_MOVED_MASK, MOUSE_PRESSED_MASK, MOUSE_RELEASED_MASK, SERVER_NOTIFICATION_MASK, UPDATE_ADD_GRAPHIC_MASK, UPDATE_GRAPHIC_MASK`

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
`LinkLayer()` The default constructor for the Layer.
`LinkLayer(java.lang.String host, int port, java.lang.String propertiesURL)` Constructor to use when LinkLayer is not being used with OpenMap application.

Method Summary
`void` `checkAndReplaceOldPropertyName(LinkProperties props, java.lang.String oldPropertyName, java.lang.String newPropertyName)`
`void` `checkAndReplaceOldPropertyNames(LinkProperties props)` The LinkPropertiesConstants have changed in LinkProtocol version .6, to much small strings that don't match up with the DrawingAttributes properties.
`void` `drawingComplete(OMGraphic omg, OMAction action)` The method where a graphic, and an action to take on the graphic, arrives.
`int` `getDistanceLimit()` Get the search distance limit pixel distance for graphics searches.
`int` `getGestureDescriptor()` Gets the masked integer which indicates what types of events get sent to the server.
`LinkOMGraphicList` `getGraphicList()` Retrieves the current graphics list.
`protected LinkListener` `getListener()`
`MapMouseListener` `getMapMouseListener()` Return the MapMouseListener for the layer.
`java.lang.String[]` `getMouseModeServiceList()` Return the strings identifying the Mouse Modes that the MapMouseListener wants to receive gestures from.
`protected boolean` `graphicGestureReaction(OMGraphic graphic, int descriptor, java.awt.event.MouseEvent e)` Given a graphic and the type of gesture caught, react to it based on the properties object located in the Graphic.
`protected boolean` `handleGesture(int descriptor, java.awt.event.MouseEvent e)` Send the query, act on the response, and tell the caller if the gesture was consumed.
`void` `handleLinkActionList(LinkActionList lal)`
`void` `handleLinkActionRequest(LinkActionRequest lar)`
`void` `handleLinkGraphicList(LinkGraphicList lgl)`
`void` `handleMessages(LinkProperties props)` Looks at a properties object, and checks for the pre-defined messaging attributes.
`boolean` `mouseClicked(java.awt.event.MouseEvent e)` Invoked when the mouse has been clicked on a component.
`boolean` `mouseDragged(java.awt.event.MouseEvent e)` Invoked when a mouse button is pressed on a component and then dragged.
`void` `mouseEntered(java.awt.event.MouseEvent e)` Invoked when the mouse enters a component.
`void` `mouseExited(java.awt.event.MouseEvent e)` Invoked when the mouse exits a component.
`void` `mouseMoved()` Handle a mouse cursor moving without the button being pressed.
`boolean` `mouseMoved(java.awt.event.MouseEvent e)` Invoked when the mouse button has been moved on a component (with no buttons down).
`boolean` `mousePressed(java.awt.event.MouseEvent e)` Invoked when a mouse button has been pressed on a component.
`boolean` `mouseReleased(java.awt.event.MouseEvent e)` Invoked when a mouse button has been released on a component.
`OMGraphicList` `prepare()` Prepares the graphics for the layer.
`void` `removed(java.awt.Container cont)` Called when the layer is no longer part of the map.
`protected void` `sendMapRequest(ClientLink link, Projection proj)` Creates the LinkMapRequest.
`void` `setDistanceLimit(int limit)` Set the search distance limit pixel distance for graphics searches.
`void` `setGestureDescriptor(int descriptor)` Sets the masked integer which indicates what types of events get sent to the server.
`void` `setGraphicList(LinkOMGraphicList aList)` Sets the current graphics list to the given list.
`protected void` `setListener(LinkListener ll)`
`void` `setProperties(java.lang.String prefix, java.util.Properties properties)` Set all the Link properties from a properties object.
`void` `updateMap(LinkProperties props)` Looks at a properties object, and checks for map updates.

Methods inherited from class com.bbn.openmap.layer.OMGraphicHandlerLayer

`canSetList, copy, createLayerWorker, cut, deselect, doAction, doPrepare, filter, filter, filter, getConsumeEvents, getFilter, getInfoText, getItemsForMapMenu, getItemsForOMGraphicMenu, getLayerWorker, getList, getMouseEventInterpreter, getMouseModeIDsForEvents, getProjectionChangePolicy, getProperties, getPropertyInfo, getRenderPolicy, getSelected, getToolTipTextFor, getTransparency, getTransparencyAdjustmentPanel, highlight, interrupt, isCancelled, isHighlightable, isInterruptable, isSelectable, isWorking, leftClick, mouseOver, paint, paste, projectionChanged, receivesMapEvents, renderDataForProjection, resetFiltering, select, setCancelled, setConsumeEvents, setFilter, setInterruptable, setLayerWorker, setList, setMouseEventInterpreter, setMouseModeIDsForEvents, setProjectionChangePolicy, setRenderPolicy, setTransparency, supportsSQL, unhighlight, workerComplete`

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, getProjection, getPropertyPrefix, getWindowSupport, hasGUI, hidePalette, isAutoPalette, isProjectionOK, isRemovable, notifyHideHack, putAttribute, removeComponentListener, removeConfirmed, removeInfoDisplayListener, removeLayerStatusListener, removeVetoableChangeListener, repaint, resetPalette, setAddAsBackground, setAddToBeanContext, setAutoPalette, setBeanContext, setIcon, setMaxScale, setMinScale, setName, setPaletteVisible, setProjection, setProjection, setProperties, setPropertyPrefix, setRemovable, setVisible, setWindowSupport, showPalette`

Methods inherited from class javax.swing.JComponent

`addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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 com.bbn.openmap.tools.drawing.DrawingToolRequestor
`getName`

Methods inherited from interface java.beans.beancontext.BeanContextChild
`addPropertyChangeListener, removePropertyChangeListener`

Field Detail

### listener

    protected LinkListener listener

  The thread listener used to communicate asynchronously. The LinkLayer sends out requsts and notifications to the server, and the LinkListener reads any input from the server, making calls on the LinkLayer as appropriate.

### gestureDescriptor

    protected int gestureDescriptor

  A masked integer describing which gestures should be sent to the server.

### port

    protected int port

  The port to connect to the server on.

### host

    protected java.lang.String host

  The host where the server is running.

### args

    protected LinkProperties args

  The special parameters (attributes) transmitted to the server with every query.

### linkManager

    protected LinkManager linkManager

  The object that provides a link to the layer (and its various threads) on a coordinateed basis.

### quiet

    protected boolean quiet

  The flag to supress pop-up messages.

### currentGenerator

    protected OMGridGenerator currentGenerator

  The generator to use with LinkGrid objects.

### PortProperty

    public static final java.lang.String PortProperty

  The property name to specify what port the server is running on. "port"

  See Also:
    Constant Field Values

### HostProperty

    public static final java.lang.String HostProperty

  The property name to specify the hostname the server is running on. "host"

  See Also:
    Constant Field Values

### ArgsProperty

    public static final java.lang.String ArgsProperty

  The property name to specify a URL of a properties file containing properties that will be sent to the server within requests to it. The contents of this file depends on the server. "propertiesURL"

  See Also:
    Constant Field Values

### ServerLocationProperty

    public static final java.lang.String ServerLocationProperty

See Also:
  Constant Field Values

### QuietProperty

    public static final java.lang.String QuietProperty

  The property to make the layer quiet. "quiet"

  See Also:
    Constant Field Values

### GridGeneratorProperty

    public static final java.lang.String GridGeneratorProperty

  The property to specify which grid generator to use for grid objects. "gridGenerator"

  See Also:
    Constant Field Values

### DistanceLimitProperty

    public static final java.lang.String DistanceLimitProperty

  The property to set a pixel distance limit for gestures. "distanceLimit"

  See Also:
    Constant Field Values

### DEFAULT_DISTANCE_LIMIT

    public static final int DEFAULT_DISTANCE_LIMIT

See Also:
  Constant Field Values

### distanceLimit

    protected int distanceLimit

  The maximum distance away a mouse event can happen away from a graphic in order for it to be considered to have touched.

### ExitOnCommandProperty

    public static final java.lang.String ExitOnCommandProperty

  The property to set to true if the server should be able to decide when to kill the client, the overall application. False by default, only modified in setProperties. "exitOnCommand"

  See Also:
    Constant Field Values

Constructor Detail

### LinkLayer

    public LinkLayer()

  The default constructor for the Layer. All of the attributes are set to their default values.

### LinkLayer

    public LinkLayer(java.lang.String host,
                     int port,
                     java.lang.String propertiesURL)

  Constructor to use when LinkLayer is not being used with OpenMap application.

Parameters:
  `host` - the hostname of the server's computer.
  `port` - the port number of the server.
  `propertiesURL` - the URL of a properties file that contains parameters for the server.

Method Detail

### setGraphicList

    public void setGraphicList(LinkOMGraphicList aList)

  Sets the current graphics list to the given list.

  Parameters:
    `aList` - a list of OMGraphics

### getGraphicList

    public LinkOMGraphicList getGraphicList()

  Retrieves the current graphics list.

### removed

    public void removed(java.awt.Container cont)

  Called when the layer is no longer part of the map. In this case, we should disconnect from the server if we have a link.

  Overrides:
    `removed` in class `Layer`
  Parameters:
    `cont` - Container

### setGestureDescriptor

    public void setGestureDescriptor(int descriptor)

  Sets the masked integer which indicates what types of events get sent to the server.

  Parameters:
    `descriptor` - masked int
  See Also:
    `LinkActionRequest`

### getGestureDescriptor

    public int getGestureDescriptor()

  Gets the masked integer which indicates what types of events get sent to the server.

  Returns:
    descriptor masked int
  See Also:
    `LinkActionRequest`

### setProperties

    public void setProperties(java.lang.String prefix,
                              java.util.Properties properties)

  Set all the Link properties from a properties object.

  Specified by:
    `setProperties` in interface `PropertyConsumer`
  Overrides:
    `setProperties` in class `OMGraphicHandlerLayer`
  Parameters:
    `prefix` - the prefix to the properties tha might individualize it to a particular layer.
    `properties` - the properties for the layer.

### checkAndReplaceOldPropertyNames

    public void checkAndReplaceOldPropertyNames(LinkProperties props)

  The LinkPropertiesConstants have changed in LinkProtocol version .6, to much small strings that don't match up with the DrawingAttributes properties. We need to check for the old property names and replace them with the new property names.

  Parameters:
    `props` -

### checkAndReplaceOldPropertyName

    public void checkAndReplaceOldPropertyName(LinkProperties props,
                                               java.lang.String oldPropertyName,
                                               java.lang.String newPropertyName)

### setListener

    protected void setListener(LinkListener ll)

### getListener

    protected LinkListener getListener()

### prepare

    public OMGraphicList prepare()

  Prepares the graphics for the layer. This is where the getRectangle() method call is made on the link.

  Occasionally it is necessary to abort a prepare call. When this happens, the map will set the cancel bit in the LayerThread, (the thread that is running the prepare). If this Layer needs to do any cleanups during the abort, it should do so, but return out of the prepare asap.

  Overrides:
    `prepare` in class `OMGraphicHandlerLayer`
  Returns:
    a list of graphics.

### sendMapRequest

    protected void sendMapRequest(ClientLink link,
                                  Projection proj)
                           throws java.io.IOException

  Creates the LinkMapRequest.

  Parameters:
    `link` - the link to communicate over.
    `proj` - the projection to give to the graphics.
  Returns:
    LinkOMGraphicList containing graphics from the server.
  Throws:
    `java.io.IOException`

### handleLinkGraphicList

    public void handleLinkGraphicList(LinkGraphicList lgl)

### handleLinkActionList

    public void handleLinkActionList(LinkActionList lal)

### handleLinkActionRequest

    public void handleLinkActionRequest(LinkActionRequest lar)

### handleMessages

    public void handleMessages(LinkProperties props)

  Looks at a properties object, and checks for the pre-defined messaging attributes. Then, the information delegator is called to handle their display.

  Parameters:
    `props` - LinkProperties containing messages.

### getMapMouseListener

    public MapMouseListener getMapMouseListener()

  Return the MapMouseListener for the layer.

  Overrides:
    `getMapMouseListener` in class `OMGraphicHandlerLayer`

### getMouseModeServiceList

    public java.lang.String[] getMouseModeServiceList()

  Return the strings identifying the Mouse Modes that the MapMouseListener wants to receive gestures from.

  Specified by:
    `getMouseModeServiceList` in interface `MapMouseListener`
  Returns:
    String[] of modeID's
  See Also:
    `NavMouseMode.modeID`, `SelectMouseMode.modeID`, `NullMouseMode.modeID`

### mousePressed

    public boolean mousePressed(java.awt.event.MouseEvent e)

  Description copied from interface: `MapMouseListener`
  Invoked when a mouse button has been pressed on a component.

  Specified by:
    `mousePressed` in interface `MapMouseListener`
  Parameters:
    `e` - MouseEvent
  Returns:
    true if the listener was able to process the event.

### mouseReleased

    public boolean mouseReleased(java.awt.event.MouseEvent e)

  Description copied from interface: `MapMouseListener`
  Invoked when a mouse button has been released on a component.

  Specified by:
    `mouseReleased` in interface `MapMouseListener`
  Parameters:
    `e` - MouseEvent
  Returns:
    true if the listener was able to process the event.

### mouseClicked

    public boolean mouseClicked(java.awt.event.MouseEvent e)

  Description copied from interface: `MapMouseListener`
  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.

  NOTE: We have noticed that this method can sometimes be erroneously invoked. It seems to occur when a light-weight AWT component (like an internal window or menu) closes (removes itself from the window hierarchy). A specific OpenMap example is when you make a menu selection when the MenuItem you select is above the MapBean canvas. After making the selection, the mouseClicked() gets invoked on the MouseDelegator, which passes it to the appropriate listeners depending on the MouseMode. The best way to avoid this problem is to not implement anything crucial in this method. Use a combination of `mousePressed()` and `mouseReleased()` instead.

  Specified by:
    `mouseClicked` in interface `MapMouseListener`
  Parameters:
    `e` - MouseEvent
  Returns:
    true if the listener was able to process the event.

### mouseEntered

    public void mouseEntered(java.awt.event.MouseEvent e)

  Description copied from interface: `MapMouseListener`
  Invoked when the mouse enters a component.

  Specified by:
    `mouseEntered` in interface `MapMouseListener`
  Parameters:
    `e` - MouseEvent

### mouseExited

    public void mouseExited(java.awt.event.MouseEvent e)

  Description copied from interface: `MapMouseListener`
  Invoked when the mouse exits a component.

  Specified by:
    `mouseExited` in interface `MapMouseListener`
  Parameters:
    `e` - MouseEvent

### mouseDragged

    public boolean mouseDragged(java.awt.event.MouseEvent e)

  Description copied from interface: `MapMouseListener`
  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 `MapMouseListener`
  Parameters:
    `e` - MouseEvent
  Returns:
    true if the listener was able to process the event.

### mouseMoved

    public boolean mouseMoved(java.awt.event.MouseEvent e)

  Description copied from interface: `MapMouseListener`
  Invoked when the mouse button has been moved on a component (with no buttons down).

  Specified by:
    `mouseMoved` in interface `MapMouseListener`
  Parameters:
    `e` - MouseEvent
  Returns:
    true if the listener was able to process the event.

### mouseMoved

    public void mouseMoved()

  Description copied from interface: `MapMouseListener`
  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 `MapMouseListener`

### graphicGestureReaction

    protected boolean graphicGestureReaction(OMGraphic graphic,
                                             int descriptor,
                                             java.awt.event.MouseEvent e)

  Given a graphic and the type of gesture caught, react to it based on the properties object located in the Graphic. The default behavior here is that if the gesture is a MouseMoved, select the graphic, and if there is an info line, show it. If the gesture is a MouseRelease, display the info line, and also check the following, in this order: url and then html. If there is a message property, the message is sent in a pop-up window.

  Parameters:
    `graphic` - the graphic to check out.
    `descriptor` - the type of gesture.
    `e` - mouse event, to get location.
  Returns:
    true if the server still needs to be told - per descriptor bit 11.

### handleGesture

    protected boolean handleGesture(int descriptor,
                                    java.awt.event.MouseEvent e)

  Send the query, act on the response, and tell the caller if the gesture was consumed. The Link actually gets a copy of the layer to handle communication with the InformationDelegator. The GraphicUpdates are handled in this method - the graphics list is modified.

  Parameters:
    `descriptor` - a masked integer telling the type of gesture.
    `e` - the MouseEvent.
  Returns:
    true if the event was consumed.

### drawingComplete

    public void drawingComplete(OMGraphic omg,
                                OMAction action)

  Description copied from interface: `DrawingToolRequestor`
  The method where a graphic, and an action to take on the graphic, arrives.

  Specified by:
    `drawingComplete` in interface `DrawingToolRequestor`

### setDistanceLimit

    public void setDistanceLimit(int limit)

  Set the search distance limit pixel distance for graphics searches. When the graphics list is checked for a graphic that is closest to a mouse event, this is the pixel limit within hits are considered.

  Parameters:
    `limit` - the pixel limit to consider something "closest".

### getDistanceLimit

    public int getDistanceLimit()

  Get the search distance limit pixel distance for graphics searches.

### updateMap

    public void updateMap(LinkProperties props)

  Looks at a properties object, and checks for map updates.

  Parameters:
    `props` - LinkProperties containing map parameters.

Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details