Class AbstractRenderableLayer<S,​T extends gov.nasa.worldwind.render.Renderable>

  • All Implemented Interfaces:
    gov.nasa.worldwind.avlist.AVList, gov.nasa.worldwind.Disposable, gov.nasa.worldwind.event.MessageListener, gov.nasa.worldwind.layers.Layer, gov.nasa.worldwind.Restorable, gov.nasa.worldwind.WWObject, PropertyChangeListener, EventListener, IDisplayLayer<T>
    Direct Known Subclasses:
    NetworkLayerGIS, PlaceMarkLayer, SurfaceShapeLayer

    public abstract class AbstractRenderableLayer<S,​T extends gov.nasa.worldwind.render.Renderable>
    extends gov.nasa.worldwind.layers.RenderableLayer
    implements IDisplayLayer<T>
    Abstract base class for WorldWind GIS display Renderable layers.
    Author:
    Eric Tatara
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void addObject​(Object o)
      Adds the specified object to the layer.
      void applyUpdates()
      No-op for WWJ based code as the displaying the Renderable will reflect the updates.
      protected abstract void applyUpdatesToShape​(Object o)
      Defines how the implementing subclasses apply updates to Renderables, e.g.
      protected abstract T createVisualItem​(Object o)
      Defines how the implementing subclasses create Renderables for objects in the display
      void dispose()  
      Object findObjectForRenderable​(gov.nasa.worldwind.render.Renderable renderable)
      Returns the object that is associated with the renderable argument.
      S getStyle()
      Gets the style used by this display layer.
      T getVisualItem​(Object o)
      Gets the visual representation of this object.
      protected void processAddedObjects()
      Create visual items for each object added since the last update.
      protected void processRemovedObjects()
      Remove any items and their renderables since the last update.
      void removeObject​(Object o)
      Removes this specified object from this layer.
      void setGeography​(Geography geography)
      Set the geography for this display.
      void setStyle​(S style)
      Sets the style used by this display layer.
      void update​(LayoutUpdater updater)
      Updates the displayed nodes by applying styles etc.
      protected void updateObjects​(LayoutUpdater updater)
      Apply style to all objects that exist in the layer
      • Methods inherited from class gov.nasa.worldwind.layers.RenderableLayer

        addRenderable, addRenderable, addRenderables, clearRenderables, disposeRenderables, doPick, doPick, doPreRender, doPreRender, doRender, doRender, getActiveRenderables, getNumRenderables, getOpacity, getRenderables, onMessage, removeAllRenderables, removeRenderable, setOpacity, setRenderables, toString
      • Methods inherited from class gov.nasa.worldwind.layers.AbstractLayer

        createLayerConfigElements, getDataFileStore, getExpiryTime, getLayerConfigParams, getMaxActiveAltitude, getMaxEffectiveAltitude, getMinActiveAltitude, getMinEffectiveAltitude, getName, getRestorableState, getScale, getScreenCredit, isAtMaxResolution, isEnabled, isLayerActive, isLayerConfigDocument, isLayerInView, isMultiResolution, isNetworkRetrievalEnabled, isPickEnabled, pick, preRender, render, restoreState, setDataFileStore, setEnabled, setExpiryTime, setMaxActiveAltitude, setMinActiveAltitude, setName, setNetworkRetrievalEnabled, setPickEnabled, setScreenCredit
      • Methods inherited from class gov.nasa.worldwind.WWObjectImpl

        propertyChange
      • Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl

        addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
      • Methods inherited from interface gov.nasa.worldwind.avlist.AVList

        addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
    • Field Detail

      • visualItemMap

        protected Map<Object,​T extends gov.nasa.worldwind.render.Renderable> visualItemMap
      • renderableToObjectMap

        protected Map<gov.nasa.worldwind.render.Renderable,​Object> renderableToObjectMap
      • style

        protected S style
      • geography

        protected Geography<?> geography
      • addedObjects

        protected Set<Object> addedObjects
      • removeObjects

        protected Set<Object> removeObjects
    • Constructor Detail

      • AbstractRenderableLayer

        public AbstractRenderableLayer​(String name,
                                       S style)
    • Method Detail

      • applyUpdatesToShape

        protected abstract void applyUpdatesToShape​(Object o)
        Defines how the implementing subclasses apply updates to Renderables, e.g. setting line colors or updating coordinates.
        Parameters:
        o - the object (agent) to be used for styling the renderable
      • createVisualItem

        protected abstract T createVisualItem​(Object o)
        Defines how the implementing subclasses create Renderables for objects in the display
        Parameters:
        o - the object for which to create the renderable
        Returns:
        the Renderable to be displayed
      • getStyle

        public S getStyle()
        Gets the style used by this display layer.
        Returns:
        the style used by this display layer.
      • setStyle

        public void setStyle​(S style)
        Sets the style used by this display layer.
        Parameters:
        style - the new style
      • setGeography

        public void setGeography​(Geography geography)
        Set the geography for this display.
        Parameters:
        geography -
      • addObject

        public void addObject​(Object o)
        Description copied from interface: IDisplayLayer
        Adds the specified object to the layer.
        Specified by:
        addObject in interface IDisplayLayer<S>
        Parameters:
        o - the object to add
      • applyUpdates

        public void applyUpdates()
        No-op for WWJ based code as the displaying the Renderable will reflect the updates. Nothing needs to be done here.
        Specified by:
        applyUpdates in interface IDisplayLayer<S>
      • getVisualItem

        public T getVisualItem​(Object o)
        Description copied from interface: IDisplayLayer
        Gets the visual representation of this object.
        Specified by:
        getVisualItem in interface IDisplayLayer<S>
        Parameters:
        o - the object whose visual representation we want to get
        Returns:
        the visual representation of this object.
      • removeObject

        public void removeObject​(Object o)
        Removes this specified object from this layer.
        Specified by:
        removeObject in interface IDisplayLayer<S>
        Parameters:
        obj - the object to remove
      • update

        public void update​(LayoutUpdater updater)
        Updates the displayed nodes by applying styles etc. The display is not updated to reflect these changes.
        Specified by:
        update in interface IDisplayLayer<S>
        Parameters:
        updater - used to update the layout and position information
      • dispose

        public void dispose()
        Specified by:
        dispose in interface gov.nasa.worldwind.Disposable
        Overrides:
        dispose in class gov.nasa.worldwind.layers.RenderableLayer
      • findObjectForRenderable

        public Object findObjectForRenderable​(gov.nasa.worldwind.render.Renderable renderable)
        Returns the object that is associated with the renderable argument.
        Parameters:
        renderable - the Renderable
        Returns:
        the object associated with the renderable in this display.
      • updateObjects

        protected void updateObjects​(LayoutUpdater updater)
        Apply style to all objects that exist in the layer
        Parameters:
        updater -
      • processAddedObjects

        protected void processAddedObjects()
        Create visual items for each object added since the last update.
      • processRemovedObjects

        protected void processRemovedObjects()
        Remove any items and their renderables since the last update.