com.bbn.openmap.layer.link.amp
Class AmpLinkLayer

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 com.bbn.openmap.layer.OMGraphicHandlerLayer
                      extended by com.bbn.openmap.layer.link.LinkLayer
                          extended by com.bbn.openmap.layer.link.amp.AmpLinkLayer
All Implemented Interfaces:
MapMouseListener, ProjectionListener, Tool, LinkActionConstants, LinkPropertiesConstants, GestureResponsePolicy, OMGraphicHandler, ProjectionPainter, PropertyConsumer, DrawingToolRequestor, java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.beancontext.BeanContextChild, java.beans.beancontext.BeanContextMembershipListener, java.io.Serializable, java.util.EventListener

public class AmpLinkLayer
extends LinkLayer
implements Tool

The AmpLinkLayer is an extension to the LinkLayer. The difference is that this layer provides some components to the ToolBar for the creation of certain graphics to be sent to the LinkServer. This layer also wants access to the DrawingTool.

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
    link.propertiesURL=http://location.of.properties.file.com
    
   
  
 

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  DrawingTool drawingTool
           
protected  OMGraphicList extraGraphics
           
protected  javax.swing.JButton eZone
           
protected  java.awt.Container gui
           
protected  java.lang.String key
           
protected  DrawingToolRequestor layer
           
protected  int orientation
           
protected  javax.swing.JButton rrButton
           
static java.lang.String RRIntervalProperty
           
static java.lang.String RRIntervalUnitsProperty
           
 
Fields inherited from class com.bbn.openmap.layer.link.LinkLayer
args, ArgsProperty, currentGenerator, DEFAULT_DISTANCE_LIMIT, distanceLimit, DistanceLimitProperty, ExitOnCommandProperty, gestureDescriptor, GridGeneratorProperty, host, HostProperty, linkManager, listener, port, PortProperty, quiet, QuietProperty, ServerLocationProperty
 
Fields inherited from class com.bbn.openmap.layer.OMGraphicHandlerLayer
consumeEvents, ConsumeEventsProperty, filter, interruptable, InterruptableProperty, layerWorker, LAYERWORKER_LOCK, layerWorkerQueue, logger, 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, coordTransform, DataPathPrefixProperty, DisplayPaletteCmd, DisplayPropertiesCmd, doHack, HidePaletteCmd, i18n, localHackList, maxScale, MaxScaleProperty, minScale, MinScaleProperty, palette, paletteListener, PrettyNameProperty, propertyPrefix, readyToPaint, RedrawCmd, removable, RemovableProperty, SWING_PACKAGE, TransformProperty, 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
AmpLinkLayer()
          The default constructor for the Layer.
AmpLinkLayer(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 drawingComplete(OMGraphic omg, OMAction action)
          The method where a graphic, and an action to take on the graphic, arrives.
 void findAndInit(java.lang.Object someObj)
          This method is called by the findAndInit(Iterator) method, once for every object inside the iterator.
 void findAndUndo(java.lang.Object someObj)
          This is the method that does the opposite as the findAndInit(Object).
 DrawingTool getDrawingTool()
           
 java.awt.Container getFace()
          The retrieval tool's interface.
 java.lang.String getKey()
          The retrieval key for this tool
 int getOrientation()
          Set the orientation for the GUI of the Tool, SwingConstants.HORIZONTAL or SwingConstants.VERTICAL.
 boolean mouseClicked(java.awt.event.MouseEvent e)
          Just need to check here if one of the new extra graphics (range ring) was clicked on, so that it can be sent to the drawing tool for modification if desired.
 void paint(java.awt.Graphics g)
          Paints the layer.
 OMGraphicList prepare()
          Prepares the graphics for the layer.
 void setDrawingTool(DrawingTool dt)
           
 void setKey(java.lang.String aKey)
          Set the retrieval key for this tool
 void setOrientation(int orientation)
          Set the orientation for the GUI of the Tool, SwingConstants.HORIZONTAL or SwingConstants.VERTICAL.
 void setProperties(java.lang.String prefix, java.util.Properties properties)
          Set all the Link properties from a properties object.
 
Methods inherited from class com.bbn.openmap.layer.link.LinkLayer
checkAndReplaceOldPropertyName, checkAndReplaceOldPropertyNames, getDistanceLimit, getGestureDescriptor, getGraphicList, getListener, getMapMouseListener, getMouseModeServiceList, graphicGestureReaction, handleGesture, handleLinkActionList, handleLinkActionRequest, handleLinkGraphicList, handleMessages, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseMoved, mousePressed, mouseReleased, removed, sendMapRequest, setDistanceLimit, setGestureDescriptor, setGraphicList, setListener, updateMap
 
Methods inherited from class com.bbn.openmap.layer.OMGraphicHandlerLayer
actionPerformed, canSetList, copy, createLayerWorker, cut, deselect, dispose, doAction, doPrepare, filter, filter, filter, getConsumeEvents, getDefaultSettingsPanel, getFilter, getInfoText, getItemsForMapMenu, getItemsForOMGraphicMenu, getLayerWorker, getList, getMouseEventInterpreter, getMouseModeIDsForEvents, getProjectionChangePolicy, getProperties, getPropertyInfo, getRedrawButton, getRenderPolicy, getSelected, getSettingsButton, getToolTipTextFor, getTransparency, getTransparencyAdjustmentPanel, highlight, isCancelled, isHighlightable, isInterruptable, isSelectable, isWorking, leftClick, mouseOver, paste, projectionChanged, receivesMapEvents, renderDataForProjection, resetFiltering, select, setConsumeEvents, setFilter, setInterruptable, setLayerWorker, setList, setMouseEventInterpreter, setMouseModeIDsForEvents, setProjectionChangePolicy, setRenderPolicy, setTransparency, supportsSQL, unhighlight, workerComplete
 
Methods inherited from class com.bbn.openmap.Layer
addComponentListener, added, addInfoDisplayListener, addLayerStatusListener, addMouseListener, addVetoableChangeListener, childrenAdded, childrenRemoved, clearListeners, connectToBeanContext, createWindowSupport, disconnectFromBeanContext, finalize, findAndInit, fireHideToolTip, firePaletteEvent, fireRequestBrowserContent, fireRequestBrowserContent, fireRequestCursor, fireRequestInfoLine, fireRequestInfoLine, fireRequestInfoLine, fireRequestMessage, fireRequestMessage, fireRequestToolTip, fireRequestToolTip, fireRequestURL, fireRequestURL, fireStatusUpdate, fireStatusUpdate, fireVetoableChange, getAddAsBackground, getAddToBeanContext, getAttribute, getBeanContext, getCoordTransform, getGUI, getIcon, getMaxScale, getMinScale, getPackage, getPalette, getProjection, getPropertyPrefix, getWindowSupport, hasGUI, hidePalette, isAutoPalette, isProjectionOK, isReadyToPaint, isRemovable, notifyHideHack, prependDataPathPrefix, putAttribute, removeComponentListener, removeConfirmed, removeInfoDisplayListener, removeLayerStatusListener, removeVetoableChangeListener, repaint, resetPalette, setAddAsBackground, setAddToBeanContext, setAutoPalette, setBeanContext, setCoordTransform, setIcon, setLayerProperties, setMaxScale, setMinScale, setName, setPaletteVisible, setProjection, setProjection, setProperties, setPropertyPrefix, setReadyToPaint, 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 com.bbn.openmap.tools.drawing.DrawingToolRequestor
getName
 
Methods inherited from interface java.beans.beancontext.BeanContextChild
addPropertyChangeListener, removePropertyChangeListener
 

Field Detail

RRIntervalUnitsProperty

public static final java.lang.String RRIntervalUnitsProperty
See Also:
Constant Field Values

RRIntervalProperty

public static final java.lang.String RRIntervalProperty
See Also:
Constant Field Values

extraGraphics

protected OMGraphicList extraGraphics

drawingTool

protected DrawingTool drawingTool

orientation

protected int orientation

layer

protected final DrawingToolRequestor layer

gui

protected java.awt.Container gui

rrButton

protected javax.swing.JButton rrButton

eZone

protected javax.swing.JButton eZone

key

protected java.lang.String key
Constructor Detail

AmpLinkLayer

public AmpLinkLayer()
The default constructor for the Layer. All of the attributes are set to their default values.


AmpLinkLayer

public AmpLinkLayer(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

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 LinkLayer
Parameters:
prefix - the prefix to the properties that might individualize it to a particular layer.
properties - the properties for the layer.

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 LinkLayer
Returns:
a list of graphics.

paint

public void paint(java.awt.Graphics g)
Paints the layer.

Overrides:
paint in class OMGraphicHandlerLayer
Parameters:
g - the Graphics context for painting

mouseClicked

public boolean mouseClicked(java.awt.event.MouseEvent e)
Just need to check here if one of the new extra graphics (range ring) was clicked on, so that it can be sent to the drawing tool for modification if desired.

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

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
Overrides:
drawingComplete in class LinkLayer

getFace

public java.awt.Container getFace()
The retrieval tool's interface. This is added to the tool bar.

Specified by:
getFace in interface Tool
Returns:
String The key for this tool.

getKey

public java.lang.String getKey()
The retrieval key for this tool

Specified by:
getKey in interface Tool
Returns:
String The key for this tool.

setKey

public void setKey(java.lang.String aKey)
Set the retrieval key for this tool

Specified by:
setKey in interface Tool
Parameters:
aKey - The key for this tool.

findAndInit

public void findAndInit(java.lang.Object someObj)
Description copied from class: Layer
This method is called by the findAndInit(Iterator) method, once for every object inside the iterator. It's here to allow subclasses a way to receive objects and still let the super classes have a shot at the object. So, you can override this method can call super.findAndInit(obj), or override the findAndInit(Iterator) method and call super.findAndInit(obj). Whatever.

Overrides:
findAndInit in class Layer

findAndUndo

public void findAndUndo(java.lang.Object someObj)
Description copied from class: Layer
This is the method that does the opposite as the findAndInit(Object). Lets you call super classes with objects that need to be removed. At this level, if the layer detects that it is being removed from the MapHandler, it calls dispose on itself.

Overrides:
findAndUndo in class Layer

setDrawingTool

public void setDrawingTool(DrawingTool dt)

getDrawingTool

public DrawingTool getDrawingTool()

getOrientation

public int getOrientation()
Description copied from interface: Tool
Set the orientation for the GUI of the Tool, SwingConstants.HORIZONTAL or SwingConstants.VERTICAL.

Specified by:
getOrientation in interface Tool
Returns:
orientation that is set on tool

setOrientation

public void setOrientation(int orientation)
Description copied from interface: Tool
Set the orientation for the GUI of the Tool, SwingConstants.HORIZONTAL or SwingConstants.VERTICAL.

Specified by:
setOrientation in interface Tool
Parameters:
orientation - that should be set on tool.


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