Class WorldWindowImpl

    • Constructor Detail

      • WorldWindowImpl

        public WorldWindowImpl()
    • Method Detail

      • shutdown

        public void shutdown()
        Causes resources used by the WorldWindow to be freed. The WorldWindow cannot be used once this method is called. An OpenGL context for the window must be current.
        Specified by:
        shutdown in interface WorldWindow
      • getGpuResourceCache

        public GpuResourceCache getGpuResourceCache()
        Description copied from interface: WorldWindow
        Returns the GPU Resource used by this WorldWindow. This method is for internal use only.

        Note: Applications do not need to interact with the GPU resource cache. It is self managed. Modifying it in any way will cause significant problems such as excessive memory usage or application crashes. The only reason to use the GPU resource cache is to request management of GPU resources within implementations of shapes or layers. And then access should be only through the draw context only.

        Specified by:
        getGpuResourceCache in interface WorldWindow
        Returns:
        The GPU Resource cache used by this WorldWindow.
      • setGpuResourceCache

        public void setGpuResourceCache​(GpuResourceCache gpuResourceCache)
      • setModel

        public void setModel​(Model model)
        Description copied from interface: WorldWindow
        Sets the model to display in this window. If null is specified for the model, the current model, if any, is disassociated with the window.
        Specified by:
        setModel in interface WorldWindow
        Parameters:
        model - the model to display. May be null.
      • getModel

        public Model getModel()
        Description copied from interface: WorldWindow
        Returns the window's current model.
        Specified by:
        getModel in interface WorldWindow
        Returns:
        the window's current model.
      • setView

        public void setView​(View view)
        Description copied from interface: WorldWindow
        Sets the view to use when displaying this window's model. If null is specified for the view, the current view, if any, is disassociated with the window.
        Specified by:
        setView in interface WorldWindow
        Parameters:
        view - the view to use to display this window's model. May be null.
      • getView

        public View getView()
        Description copied from interface: WorldWindow
        Returns this window's current view.
        Specified by:
        getView in interface WorldWindow
        Returns:
        the window's current view.
      • setModelAndView

        public void setModelAndView​(Model model,
                                    View view)
        Description copied from interface: WorldWindow
        Sets the model to display in this window and the view used to display it. If null is specified for the model, the current model, if any, is disassociated with the window. If null is specified for the view, the current view, if any, is disassociated with the window.
        Specified by:
        setModelAndView in interface WorldWindow
        Parameters:
        model - the model to display. May benull.
        view - the view to use to display this window's model. May benull.
      • getSceneController

        public SceneController getSceneController()
        Description copied from interface: WorldWindow
        Returns the scene controller associated with this instance.
        Specified by:
        getSceneController in interface WorldWindow
        Returns:
        The scene controller associated with the instance, or null if no scene controller is associated.
      • getInputHandler

        public InputHandler getInputHandler()
        Description copied from interface: WorldWindow
        Returns the input handler associated with this instance.
        Specified by:
        getInputHandler in interface WorldWindow
        Returns:
        The input handler associated with this instance, or null if no input handler is associated.
      • setInputHandler

        public void setInputHandler​(InputHandler inputHandler)
        Description copied from interface: WorldWindow
        Sets the input handler to use for this instance.
        Specified by:
        setInputHandler in interface WorldWindow
        Parameters:
        inputHandler - The input handler to use for this WorldWindow. May by null if null is specified, the current input handler, if any, is disassociated with the WorldWindow.
      • redraw

        public void redraw()
        Description copied from interface: WorldWindow
        Causes a repaint event to be enqueued with the window system for this WorldWindow. The repaint will occur at the window system's discretion, within the window system toolkit's event loop, and on the thread of that loop. This is the preferred method for requesting a repaint of the WorldWindow.
        Specified by:
        redraw in interface WorldWindow
      • redrawNow

        public void redrawNow()
        Description copied from interface: WorldWindow
        Immediately repaints the WorldWindow without waiting for a window system repaint event. This is not the preferred way to cause a repaint, but is provided for the rare cases that require it.
        Specified by:
        redrawNow in interface WorldWindow
      • setPerFrameStatisticsKeys

        public void setPerFrameStatisticsKeys​(java.util.Set<java.lang.String> keys)
        Description copied from interface: WorldWindow
        Activates the per-frame performance statistic specified. Per-frame statistics measure values within a single frame of rendering, such as number of tiles drawn to produce the frame.
        Specified by:
        setPerFrameStatisticsKeys in interface WorldWindow
        Parameters:
        keys - The statistics to activate.
      • getPerFrameStatistics

        public java.util.Collection<PerformanceStatistic> getPerFrameStatistics()
        Description copied from interface: WorldWindow
        Returns the active per-frame performance statistics such as number of tiles drawn in the most recent frame.
        Specified by:
        getPerFrameStatistics in interface WorldWindow
        Returns:
        The keys and values of the active per-frame statistics.
      • getObjectsAtCurrentPosition

        public PickedObjectList getObjectsAtCurrentPosition()
        Description copied from interface: WorldWindow
        Returns the WorldWind objects at the current cursor position. The list of objects under the cursor is determined each time the WorldWindow is repainted. This method returns the list of objects determined when the most recent repaint was performed.
        Specified by:
        getObjectsAtCurrentPosition in interface WorldWindow
        Returns:
        The list of objects at the cursor position, or null if no objects are under the cursor.
      • getObjectsInSelectionBox

        public PickedObjectList getObjectsInSelectionBox()
        Description copied from interface: WorldWindow
        Returns the WorldWind objects intersecting the current selection box. The list of objects in the selection box is determined each time the WorldWindow is repainted. This method returns the list of objects determined when the most recent repaint was performed.
        Specified by:
        getObjectsInSelectionBox in interface WorldWindow
        Returns:
        The list of objects intersecting the selection box, or null if no objects are in the box.
      • getCurrentPosition

        public Position getCurrentPosition()
        Description copied from interface: WorldWindow
        Returns the current latitude, longitude and altitude of the current cursor position, or null if the cursor is not on the globe.
        Specified by:
        getCurrentPosition in interface WorldWindow
        Returns:
        The current position of the cursor, or null if the cursor is not positioned on the globe.
      • getCurrentSelection

        protected PickedObject getCurrentSelection()
      • addRenderingListener

        public void addRenderingListener​(RenderingListener listener)
        Description copied from interface: WorldWindow
        Adds a rendering listener to this WorldWindow. Rendering listeners are called at key point during WorldWind drawing and provide applications the ability to participate or monitor rendering.
        Specified by:
        addRenderingListener in interface WorldWindow
        Parameters:
        listener - The rendering listener to add to those notified of rendering events by this WorldWindow.
      • removeRenderingListener

        public void removeRenderingListener​(RenderingListener listener)
        Description copied from interface: WorldWindow
        Removes a specified rendering listener associated with this WorldWindow.
        Specified by:
        removeRenderingListener in interface WorldWindow
        Parameters:
        listener - The rendering listener to remove.
      • callRenderingListeners

        protected void callRenderingListeners​(RenderingEvent event)
      • addPositionListener

        public void addPositionListener​(PositionListener listener)
        Description copied from interface: WorldWindow
        Adds a position listener to this WorldWindow. Position listeners are called when the cursor's position changes. They identify the position of the cursor on the globe, or that the cursor is not on the globe.
        Specified by:
        addPositionListener in interface WorldWindow
        Parameters:
        listener - The position listener to add.
      • removePositionListener

        public void removePositionListener​(PositionListener listener)
        Description copied from interface: WorldWindow
        Removes the specified position listener associated with this WorldWindow.
        Specified by:
        removePositionListener in interface WorldWindow
        Parameters:
        listener - The listener to remove.
      • callPositionListeners

        protected void callPositionListeners​(PositionEvent event)
      • addSelectListener

        public void addSelectListener​(SelectListener listener)
        Description copied from interface: WorldWindow
        Adds a select listener to this WorldWindow. Select listeners are called when a selection is made by the user in the WorldWindow. A selection is any operation that identifies a visible item.
        Specified by:
        addSelectListener in interface WorldWindow
        Parameters:
        listener - The select listener to add.
      • removeSelectListener

        public void removeSelectListener​(SelectListener listener)
        Description copied from interface: WorldWindow
        Removes the specified select listener associated with this WorldWindow.
        Specified by:
        removeSelectListener in interface WorldWindow
        Parameters:
        listener - The select listener to remove.
      • callSelectListeners

        protected void callSelectListeners​(SelectEvent event)
      • addRenderingExceptionListener

        public void addRenderingExceptionListener​(RenderingExceptionListener listener)
        Description copied from interface: WorldWindow
        Adds an exception listener to this WorldWindow. Exception listeners are called when an exception or other critical event occurs during drawable initialization or during rendering.
        Specified by:
        addRenderingExceptionListener in interface WorldWindow
        Parameters:
        listener - the The exception listener to add.
      • callRenderingExceptionListeners

        protected void callRenderingExceptionListeners​(java.lang.Throwable exception)
      • createGpuResourceCache

        public static GpuResourceCache createGpuResourceCache()
      • configureIdentityPixelScale

        public static void configureIdentityPixelScale​(com.jogamp.nativewindow.ScalableSurface surface)
        Configures JOGL's surface pixel scaling on the specified ScalableSurface to ensure backward compatibility with WorldWind applications developed prior to JOGL pixel scaling's introduction.This method is used by GLCanvas and GLJPanel to effectively disable JOGL's surface pixel scaling by requesting a 1:1 scale.

        Since v2.2.0, JOGL defaults to using high-dpi pixel scales where possible. This causes WorldWind screen elements such as placemarks, the compass, the world map, the view controls, and the scale bar (plus many more) to appear smaller than they are intended to on screen. The high-dpi default also has the effect of degrading WorldWind rendering performance.

        Parameters:
        surface - The surface to configure.