## com.bbn.openmap.plugin.graphicLoader
Class GraphicLoaderConnector

    java.lang.Object
      com.bbn.openmap.MapHandlerChild
          com.bbn.openmap.OMComponent
              com.bbn.openmap.plugin.graphicLoader.GraphicLoaderConnector

All Implemented Interfaces:
  java.beans.beancontext.BeanContextChild, java.beans.beancontext.BeanContextMembershipListener, java.util.EventListener, LightMapHandlerChild, PropertyConsumer

Direct Known Subclasses:
  NetMapConnectionHandler

public class GraphicLoaderConnector
extends OMComponent

The GraphicLoaderConnector is a MapHandler membership listener, looking for GraphicLoaders without receivers. This class uses the MapHandler to find GraphicLoaders, and requires the LayerHandler to be added to the MapHandler, also.

If the GraphicLoaderCOnnector finds a GraphicLoader that is not hooked up to a recevier, it creates a GraphicLoaderPlugIn and PlugInLayer, and adds the PlugInLayer to the LayerHandler. This causes the LayerHandler to add the layer to the application. If the GraphicLoaderConnector doesn't have a handle to the LayerHandler when it finds a GraphicLoader, it adds the PlugInLayer it created to an internal list to add to the LayerHandler when the connector finds one.

Field Summary
`protected LayerHandler` `layerHandler`
`protected int` `newLayerIndex`
`static java.lang.String` `NewLayerIndexProperty`
`protected boolean` `newLayerVisible`
`static java.lang.String` `NewLayerVisibleProperty`
`protected java.util.List` `orphanGraphicLoaderPlugIns`

Fields inherited from class com.bbn.openmap.OMComponent
`i18n, propertyPrefix`

Fields inherited from class com.bbn.openmap.MapHandlerChild
`beanContextChildSupport`

Fields inherited from interface com.bbn.openmap.PropertyConsumer
`EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty`

Constructor Summary
`GraphicLoaderConnector()`

Method Summary
`void` `checkGraphicLoader(GraphicLoader gl)` Check to see if the GraphicLoader already has a receiver set inside it.
`void` `findAndInit(java.lang.Object obj)` Find GraphicLoaders and LayerHandler in the MapHandler.
`void` `findAndUndo(java.lang.Object obj)` The childrenRemoved has been changed to go through its iterator to call this method with every object.
`LayerHandler` `getLayerHandler()`
`int` `getNewLayerIndex()`
`java.util.Properties` `getProperties(java.util.Properties props)` PropertyConsumer method, to fill in a Properties object, reflecting the current values of the OMComponent.
`java.util.Properties` `getPropertyInfo(java.util.Properties list)` Method to fill in a Properties object with values reflecting the properties able to be set on this PropertyConsumer.
`void` `hookUpGraphicLoaderWithLayer(GraphicLoader gl)` Assumes that the GraphicLoader doesn't already have a receiver.
`void` `setLayerHandler(LayerHandler lh)` Set the LayerHandler to be notified with any new PlugIn layers containing the new GraphicLoaderPlugIns.
`void` `setNewLayerIndex(int i)` Set the index of any new layers to be added to the LayerHandler.
`boolean` `setNewLayerVisible()`
`void` `setNewLayerVisible(boolean set)` Set whether the new layers should initially be visible when they are added to the map.
`void` `setProperties(java.lang.String prefix, java.util.Properties props)` Sets the properties for the OMComponent.

Methods inherited from class com.bbn.openmap.OMComponent
`getPropertyPrefix, setProperties, setPropertyPrefix`

Methods inherited from class com.bbn.openmap.MapHandlerChild
`addPropertyChangeListener, addVetoableChangeListener, childrenAdded, childrenRemoved, findAndInit, firePropertyChange, fireVetoableChange, getBeanContext, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### layerHandler

    protected LayerHandler layerHandler

### newLayerIndex

    protected int newLayerIndex

### newLayerVisible

    protected boolean newLayerVisible

### orphanGraphicLoaderPlugIns

    protected java.util.List orphanGraphicLoaderPlugIns

### NewLayerIndexProperty

    public static final java.lang.String NewLayerIndexProperty

See Also:
  Constant Field Values

### NewLayerVisibleProperty

    public static final java.lang.String NewLayerVisibleProperty

See Also:
  Constant Field Values

Constructor Detail

### GraphicLoaderConnector

    public GraphicLoaderConnector()

Method Detail

### setNewLayerIndex

    public void setNewLayerIndex(int i)

  Set the index of any new layers to be added to the LayerHandler. Negative numbers put the layer on top of the map.

### getNewLayerIndex

    public int getNewLayerIndex()

### setNewLayerVisible

    public void setNewLayerVisible(boolean set)

  Set whether the new layers should initially be visible when they are added to the map.

### setNewLayerVisible

    public boolean setNewLayerVisible()

### setLayerHandler

    public void setLayerHandler(LayerHandler lh)

  Set the LayerHandler to be notified with any new PlugIn layers containing the new GraphicLoaderPlugIns.

### getLayerHandler

    public LayerHandler getLayerHandler()

### checkGraphicLoader

    public void checkGraphicLoader(GraphicLoader gl)

  Check to see if the GraphicLoader already has a receiver set inside it. If it doesn't call hookUpGraphicLoaderWithLayer();

### hookUpGraphicLoaderWithLayer

    public void hookUpGraphicLoaderWithLayer(GraphicLoader gl)

  Assumes that the GraphicLoader doesn't already have a receiver. Creates a GraphicLoaderPlugIn, and a PlugInLayer, and hooks everything up. Then hands the PlugInLayer to the LayerHandler to get set on the map.

### findAndInit

    public void findAndInit(java.lang.Object obj)

  Find GraphicLoaders and LayerHandler in the MapHandler.

  Specified by:
    `findAndInit` in interface `LightMapHandlerChild`
  Overrides:
    `findAndInit` in class `MapHandlerChild`

### findAndUndo

    public void findAndUndo(java.lang.Object obj)

  Description copied from class: `MapHandlerChild`
  The childrenRemoved has been changed to go through its iterator to call this method with every object. This lets subclasses call this method on their super class, so it can handle what it needs to with objects it may be interested in.

  Specified by:
    `findAndUndo` in interface `LightMapHandlerChild`
  Overrides:
    `findAndUndo` in class `MapHandlerChild`

### setProperties

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

  Description copied from class: `OMComponent`
  Sets the properties for the OMComponent.

  Specified by:
    `setProperties` in interface `PropertyConsumer`
  Overrides:
    `setProperties` in class `OMComponent`
  Parameters:
    `prefix` - the token to prefix the property names
    `props` - the `Properties` object

### getProperties

    public java.util.Properties getProperties(java.util.Properties props)

  Description copied from class: `OMComponent`
  PropertyConsumer method, to fill in a Properties object, reflecting the current values of the OMComponent. If the component has a propertyPrefix set, the property keys should have that prefix plus a separating '.' prepended to each propery key it uses for configuration.

  Specified by:
    `getProperties` in interface `PropertyConsumer`
  Overrides:
    `getProperties` in class `OMComponent`
  Parameters:
    `props` - a Properties object to load the PropertyConsumer properties into. If props equals null, then a new Properties object should be created.
  Returns:
    Properties object containing PropertyConsumer property values. If getList was not null, this should equal getList. Otherwise, it should be the Properties object created by the PropertyConsumer.

### getPropertyInfo

    public java.util.Properties getPropertyInfo(java.util.Properties list)

  Description copied from class: `OMComponent`
  Method to fill in a Properties object with values reflecting the properties able to be set on this PropertyConsumer. The key for each property should be the raw property name (without a prefix) with a value that is a String that describes what the property key represents, along with any other information about the property that would be helpful (range, default value, etc.). For Layer, this method should at least return the 'prettyName' property.

  Specified by:
    `getPropertyInfo` in interface `PropertyConsumer`
  Overrides:
    `getPropertyInfo` in class `OMComponent`
  Parameters:
    `list` - a Properties object to load the PropertyConsumer properties into. If getList equals null, then a new Properties object should be created.
  Returns:
    Properties object containing PropertyConsumer property values. If getList was not null, this should equal getList. Otherwise, it should be the Properties object created by the PropertyConsumer.

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