public class IlvAltitudeChart extends JPanel
IlvAltitudeChart
is a panel for displaying a vertical view
using an IlvChart
object.JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
IlvAltitudeChart(IlvManager manager,
IlvCoordinate[] points)
Creates a new
IlvAltitudeChart object using information taken
from context. |
Modifier and Type | Method and Description |
---|---|
protected void |
computeData(int width)
Computes the chart data.
|
double |
getAltitude(double distanceFromStart)
Return the altitude of the point located at a specific distance
from the start of the path.
|
protected double[] |
getAltitudesSerie()
Returns the array of altitudes to take into account.
|
IlvChart |
getChart()
Returns the chart.
|
protected double[] |
getDistancesSerie()
Returns the array of distances to take into account.
|
IlvAltitudeProvider |
getElevationProvider()
Returns the elevation provider used to display the chart.
|
IlvManager |
getManager()
Returns the manager.
|
double |
getMaxAltitude(double maxAltitude)
Returns the maximum altitude to display given the real maximum altitude
of data.
|
double |
getMaxAltitudeDisplayed()
The maximum altitude that is currently used.
|
double |
getMinAltitudeDisplayed()
The minimum altitude that is currently used.
|
double |
getPathDistance(int pathPointIndex)
Returns the distance form the start of the path of the
nth
point in the path. |
double |
getPathLength()
Return the total length of the path.
|
double |
getPathPointAltitude(int pathPointIndex)
Returns the altitude of the
nth point in the path |
int |
getPathPointIndex(double distanceFromStart)
Returns the index of the path point for which the distance is less than or
equal to
distanceFromStart . |
protected double |
getPointHeightAboveGround(int idx)
Returns the altitude of the point above the ground.
|
IlvCoordinate[] |
getPoints()
Returns the path points.
|
protected double |
getRawDistance(double lon1,
double lat1,
double lon2,
double lat2)
Returns the distance (in meters) between two points.
|
protected double |
getRawDistance(IlvCoordinate lonlat1,
IlvCoordinate lonlat2)
Returns the distance (in meters) between two points.
|
String |
getTitle()
Returns the title of this chart, according to the coordinate system.
|
IlvUnit |
getUnitDistance()
Returns the unit of distance used by this chart.
|
IlvUnit |
getUnitHeight()
Returns the unit of altitude used by this chart.
|
void |
setElevationProvider(IlvAltitudeProvider elevationProvider)
Sets the elevation provider used to display the chart.
|
void |
setPoints(IlvCoordinate[] points)
Sets the path points.
|
void |
setUnitDistance(IlvUnit unit)
Sets the unit of distance to be used by this chart.
|
void |
setUnitHeight(IlvUnit unit)
Sets the unit of height to be used by this chart.
|
void |
updateChart()
This method is called each time the chart has to be updated.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public IlvAltitudeChart(IlvManager manager, IlvCoordinate[] points)
IlvAltitudeChart
object using information taken
from context.manager
- The manager.points
- An array of Point2D
objects
defining the latitude and longitude of the points in the path.public IlvManager getManager()
public double getAltitude(double distanceFromStart)
distanceFromStart
- The distance from the start of the pathpublic void setElevationProvider(IlvAltitudeProvider elevationProvider)
elevationProvider
- The elevation provider to set.public IlvAltitudeProvider getElevationProvider()
public double getMaxAltitude(double maxAltitude)
maxAltitude
- The maximum altitude of the data.public double getMaxAltitudeDisplayed()
public double getMinAltitudeDisplayed()
public double getPathDistance(int pathPointIndex)
nth
point in the path.pathPointIndex
- The index of the point.public double getPathLength()
public double getPathPointAltitude(int pathPointIndex)
nth
point in the pathpathPointIndex
- The index of the pointnth
point in the path.public int getPathPointIndex(double distanceFromStart)
distanceFromStart
.distanceFromStart
- The distance from the start of the pathpublic void setPoints(IlvCoordinate[] points)
points
- The points to set.public IlvCoordinate[] getPoints()
public String getTitle()
public void setUnitDistance(IlvUnit unit)
unit
- The unit to set.public void setUnitHeight(IlvUnit unit)
unit
- The unit to set.public IlvUnit getUnitDistance()
public IlvUnit getUnitHeight()
protected double getRawDistance(IlvCoordinate lonlat1, IlvCoordinate lonlat2)
lonlat1
- The latitude and longitude coordinates of the first point.lonlat2
- The latitude and longitude coordinates of the second point.protected double getRawDistance(double lon1, double lat1, double lon2, double lat2)
lon1
- The longitude of the first point.lat1
- The latitude of the first point.lon2
- The longitude of the second point.lat2
- The latitude of the second point.protected void computeData(int width)
width
- The number of samples to take along the path.public IlvChart getChart()
public void updateChart()
protected double getPointHeightAboveGround(int idx)
0
.idx
- The index of the point.protected double[] getDistancesSerie()
computeData
or updateChart
.protected double[] getAltitudesSerie()
computeData
or
updateChart
.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.