Package gov.nasa.worldwindx.examples
Class TerrainIntersections.AppFrame
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Frame
-
- javax.swing.JFrame
-
- gov.nasa.worldwindx.examples.ApplicationTemplate.AppFrame
-
- gov.nasa.worldwindx.examples.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
InnerRunnable
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.Window
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Thread
calculationDispatchThread
protected long
endTime
protected java.util.List<Position>
firstIntersectionPositions
protected java.util.List<Position>
grid
protected RenderableLayer
gridLayer
protected RenderableLayer
intersectionsLayer
protected int
numGridPoints
protected Position
previousCurrentPosition
protected javax.swing.JProgressBar
progressBar
protected Vec4
referencePoint
protected Position
referencePosition
protected java.util.List<Position[]>
sightLines
protected RenderableLayer
sightLinesLayer
protected long
startTime
protected HighResolutionTerrain
terrain
protected java.util.concurrent.ThreadPoolExecutor
threadPool
protected RenderableLayer
tilesLayer
-
Fields inherited from class gov.nasa.worldwindx.examples.ApplicationTemplate.AppFrame
controlPanel, layerPanel, statsPanel, wwjPanel
-
Fields inherited from class java.awt.Frame
ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, NORMAL
-
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
-
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 gov.nasa.worldwindx.examples.ApplicationTemplate.AppFrame
createAppPanel, getCanvasSize, getControlPanel, getStatsPanel, getStatusBar, getWwd, getWwjPanel, initialize, setHighlightController, setToolTipController
-
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
-
-
-
-
Field Detail
-
terrain
protected HighResolutionTerrain terrain
-
gridLayer
protected RenderableLayer gridLayer
-
intersectionsLayer
protected RenderableLayer intersectionsLayer
-
sightLinesLayer
protected RenderableLayer sightLinesLayer
-
tilesLayer
protected RenderableLayer tilesLayer
-
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
-
-
Method Detail
-
computeAndShowIntersections
protected void computeAndShowIntersections(Position curPos)
-
addIntersectionPosition
protected void addIntersectionPosition(Position position)
-
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)
-
showCenterPoint
protected void showCenterPoint(Position cPos)
-
-