Class TerrainIntersections.AppFrame

  • All Implemented Interfaces:
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants
    Enclosing class:
    TerrainIntersections

    public static class TerrainIntersections.AppFrame
    extends ApplicationTemplate.AppFrame
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected class  TerrainIntersections.AppFrame.Intersector
      Inner Runnable to perform a single line/terrain intersection calculation.
      • Nested classes/interfaces inherited from class javax.swing.JFrame

        javax.swing.JFrame.AccessibleJFrame
      • Nested classes/interfaces inherited from class java.awt.Frame

        java.awt.Frame.AccessibleAWTFrame
      • Nested classes/interfaces inherited from class java.awt.Window

        java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
      • 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
    • Constructor Summary

      Constructors 
      Constructor Description
      AppFrame()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addIntersectionPosition​(Position position)  
      protected void addSightLine​(Position positionA, Position positionB)  
      protected java.util.List<Position> buildGrid​(Sector sector, double height, int nLatCells, int nLonCells)  
      protected void clearLayers()  
      protected void computeAndShowIntersections​(Position curPos)  
      protected int getSightlinesSize()  
      protected void performIntersection​(Position gridPosition)
      Performs one line of sight calculation between the reference position and a specified grid position.
      protected void performIntersectionTests​(Position curPos)  
      protected void preCache​(java.util.List<Position> grid, Position centerPosition)  
      protected void showCenterPoint​(Position cPos)  
      protected void showGrid​(java.util.List<Position> grid, Position cPos)  
      protected void showGridSightLines​(java.util.List<Position> grid, Position cPos)  
      protected void showIntersections​(java.util.List<Position> intersections)  
      protected void showResults()
      Updates the WorldWind model with the new intersection locations and sight lines.
      protected void showSightLines​(java.util.List<Position[]> sightLines)  
      protected void updateProgress()
      Keeps the progress meter current.
      • Methods inherited from class javax.swing.JFrame

        addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
      • Methods inherited from class java.awt.Frame

        addNotify, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
      • Methods inherited from class java.awt.Window

        addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, toBack, toFront
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, list, list, paintComponents, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
      • Methods inherited from class java.awt.Component

        add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, hasFocus, imageUpdate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, list, list, list, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.awt.MenuContainer

        getFont
    • Field Detail

      • calculationDispatchThread

        protected java.lang.Thread calculationDispatchThread
      • progressBar

        protected javax.swing.JProgressBar progressBar
      • threadPool

        protected java.util.concurrent.ThreadPoolExecutor threadPool
      • grid

        protected java.util.List<Position> grid
      • numGridPoints

        protected int numGridPoints
      • startTime

        protected long startTime
      • endTime

        protected long endTime
      • previousCurrentPosition

        protected Position previousCurrentPosition
      • firstIntersectionPositions

        protected java.util.List<Position> firstIntersectionPositions
      • sightLines

        protected java.util.List<Position[]> sightLines
      • referencePosition

        protected Position referencePosition
      • referencePoint

        protected Vec4 referencePoint
    • Constructor Detail

      • AppFrame

        public AppFrame()
    • Method Detail

      • computeAndShowIntersections

        protected void computeAndShowIntersections​(Position curPos)
      • addIntersectionPosition

        protected void addIntersectionPosition​(Position position)
      • addSightLine

        protected void addSightLine​(Position positionA,
                                    Position positionB)
      • getSightlinesSize

        protected int getSightlinesSize()
      • updateProgress

        protected void updateProgress()
        Keeps the progress meter current. When calculations are complete, displays the results.
      • showResults

        protected void showResults()
        Updates the WorldWind model with the new intersection locations and sight lines.
      • performIntersectionTests

        protected void performIntersectionTests​(Position curPos)
                                         throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • performIntersection

        protected void performIntersection​(Position gridPosition)
                                    throws java.lang.InterruptedException
        Performs one line of sight calculation between the reference position and a specified grid position.
        Parameters:
        gridPosition - the grid position.
        Throws:
        java.lang.InterruptedException - if the operation is interrupted.
      • buildGrid

        protected java.util.List<Position> buildGrid​(Sector sector,
                                                     double height,
                                                     int nLatCells,
                                                     int nLonCells)
      • preCache

        protected void preCache​(java.util.List<Position> grid,
                                Position centerPosition)
                         throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • clearLayers

        protected void clearLayers()
      • showIntersections

        protected void showIntersections​(java.util.List<Position> intersections)
      • showSightLines

        protected void showSightLines​(java.util.List<Position[]> sightLines)
      • showGridSightLines

        protected void showGridSightLines​(java.util.List<Position> grid,
                                          Position cPos)
      • showGrid

        protected void showGrid​(java.util.List<Position> grid,
                                Position cPos)
      • showCenterPoint

        protected void showCenterPoint​(Position cPos)