Package com.luciad.view.map
Class TLcdMapJPanelLightWeight
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.luciad.view.gxy.TLcdGXYViewJPanelLightWeight
com.luciad.view.map.TLcdMapJPanelLightWeight
- All Implemented Interfaces:
ILcdAWTEventSource,ILcdModelProducerListener,ILcdPropertyChangeSource,ILcdRotationCapable,ILcdStatusSource,ILcdGXYView,ILcdGXYViewXYWorldTransformationProvider,ILcdRotationCapableGXYView,ILcdLayered,ILcdTreeLayered,ILcdView,ImageObserver,MenuContainer,Serializable,EventListener,Accessible
TLcdGXYViewJPanelLightWeight extension suited for displaying maps.
It adds the following extra behavior:
- a grid layer (a longitude/latitude grid by default) that can be
enabled or disabledand/orreplaced. - a WGS 84 based grid reference with an equidistant cylindrical projection and a default scale that fits the entire world
- a redefined
setXYWorldReferencemethod that keeps the map centered on the same model point. This behavior is enabled by default but can bedeactivatedif needed. - a controller to pan and zoom
- sensible default minimum and maximum scale values so you can't zoom in or out too far
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
Fields inherited from class com.luciad.view.gxy.TLcdGXYViewJPanelLightWeight
DISABLE_CACHING, OPTIMIZE_CACHING_FOR_REALTIME, OPTIMIZE_CACHING_FOR_SELECTIONFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface com.luciad.view.gxy.ILcdGXYView
CENTER, LOWERLEFT, LOWERRIGHT, UPPERLEFT, UPPERRIGHTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newTLcdGXYViewJPanelLightWeight-basedILcdGXYViewwith a longitude/latitude grid and aTLcdGridReferencethat has an instance ofTLcdEquidistantCylindricalasILcdProjection.TLcdMapJPanelLightWeight(boolean aRegisterInstance) Deprecated.Use the default constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns the grid layer that was configured usingsetGridLayer(com.luciad.view.gxy.ILcdGXYLayer), if any.booleanbooleanReturns whether or not the map includes a configured grid layer.voidsetAutoAdjustOnSetXYWorldReference(boolean aBoolean) voidsetGridLayer(ILcdGXYLayer aGridLayer) Configures the given layer as the grid layer of this map.voidsetWithGridLayer(boolean aWithGridLayer) Enables or disables the configured grid layer.voidsetXYWorldReference(ILcdXYWorldReference aXYWorldReference) Sets the property of XYWorldReference to aXYWorldReference.Methods inherited from class com.luciad.view.gxy.TLcdGXYViewJPanelLightWeight
addAWTEventListener, addGXYLayer, addGXYLayer, addLayeredListener, addLayerSelectionListener, addModel, addModelListener, addNotify, addPropertyChangeListener, addStatusListener, addViewInvalidationListener, containsLayer, getBackground, getCachingMode, getCornerIcon, getDefaultPen, getDisplayName, getGXYController, getGXYLayerFactory, getGXYViewLabelPainter, getGXYViewLabelPlacer, getGXYViewXYWorldTransformation, getImage, getLayer, getMaxScale, getMinScale, getNumberOfCachedBackgroundLayers, getPaintExceptionHandler, getPaintingMode, getRootNode, getRotation, getScale, getViewOrigin, getWorldOrigin, getXYWorldReference, hasValidImage, indexOf, invalidate, invalidateAndWait, invalidateGXYLayer, invalidateGXYLayerAndWait, invalidateRegion, invalidateRegionAndWait, invalidateRegionSelection, invalidateRegionSelectionAndWait, invalidateSelection, invalidateSelectionAndWait, invokeLater, isAntiAliased, isAsynchronousAllowed, isAutoUpdate, isDrawOffScreenImageOnPaint, isPaintInBackground, isTraceOn, isUpdateLabelsOnSelectionChanged, isWaitCursorOn, layerCount, layerOf, layers, layersBackwards, modelProduced, moveLayerAt, paintComponent, paintGXYView, pan, printComponent, processEvent, putCornerIcon, registerInstance, removeAllLayers, removeAWTEventListener, removeLayer, removeLayeredListener, removeLayerSelectionListener, removeModel, removeModelListener, removePropertyChangeListener, removeStatusListener, removeViewInvalidationListener, setAntiAliased, setAsynchronousAllowed, setAutoUpdate, setBackground, setCachingMode, setClassTraceOn, setDefaultPen, setDisplayName, setDrawOffScreenImageOnPaint, setGXYController, setGXYLayerFactory, setGXYViewLabelPainter, setGXYViewLabelPlacer, setMaxScale, setMinScale, setNumberOfCachedBackgroundLayers, setPaintExceptionHandler, setPaintInBackground, setPaintingMode, setRotation, setRotation, setRotation, setScale, setScale, setScale, setScale, setTraceOn, setUpdateLabelsOnSelectionChanged, setViewOrigin, setViewOrigin, setViewOrigin, setWaitCursorOn, setWorldOrigin, setWorldOrigin, setWorldOrigin, setXYWorldReference, setXYWorldReferenceMethods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods inherited from class javax.swing.JComponent
addAncestorListener, 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, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, 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, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
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, 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, 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, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.luciad.view.gxy.ILcdGXYView
getForeground, getGraphics, getHeight, getLayers, getMapScale, getMapScaleRange, getPreferredSize, getWidth, repaint, repaint, setCursor, setForeground, setMapScale, setMapScaleRangeMethods inherited from interface com.luciad.view.ILcdLayered
addLayeredListener, removeLayeredListener
-
Constructor Details
-
TLcdMapJPanelLightWeight
public TLcdMapJPanelLightWeight()Constructs a newTLcdGXYViewJPanelLightWeight-basedILcdGXYViewwith a longitude/latitude grid and aTLcdGridReferencethat has an instance ofTLcdEquidistantCylindricalasILcdProjection. The scale is set to make the earth fit in thisILcdGXYView. -
TLcdMapJPanelLightWeight
public TLcdMapJPanelLightWeight(boolean aRegisterInstance) Deprecated.Use the default constructor.Constructs a newTLcdGXYViewJPanelLightWeight-basedILcdGXYView.- Parameters:
aRegisterInstance- if true, registers the view withTLcdBeanManager- See Also:
-
-
Method Details
-
getGridLayer
Returns the grid layer that was configured usingsetGridLayer(com.luciad.view.gxy.ILcdGXYLayer), if any.- Returns:
- the grid layer of this map, or
nullif no grid layer was configured
-
setGridLayer
Configures the given layer as the grid layer of this map. The previously configured grid layer (if any) is removed and the layer is added to the top of the view, or to the position of the previously configured grid layer.- Parameters:
aGridLayer- the new layer to configure as grid layer
-
isWithGridLayer
public boolean isWithGridLayer()Returns whether or not the map includes a configured grid layer.- Returns:
trueif the map has a configured and enabled grid layer,falseotherwise.- See Also:
-
setWithGridLayer
public void setWithGridLayer(boolean aWithGridLayer) Enables or disables the configured grid layer. Iftrue, a grid layer is created (if needed) and added to the view. Iffalse, the configured grid layer (if any) is removed from the view.- Parameters:
aWithGridLayer-trueif the map has a configured grid layer,falseotherwise.- See Also:
-
setAutoAdjustOnSetXYWorldReference
public void setAutoAdjustOnSetXYWorldReference(boolean aBoolean) - Parameters:
aBoolean- if true the setXYWorldReference method will be redefined in order to keep thisILcdGXYViewstill centered on the same model point, when setting a newILcdProjection. If false the setXYWorldReference will call super.setXYWorldReference
-
isAutoAdjustOnSetXYWorldReference
public boolean isAutoAdjustOnSetXYWorldReference()- See Also:
-
setXYWorldReference
Sets the property of XYWorldReference to aXYWorldReference. If isAutoAdjustOnSetXYWorldReference returns true, it tries to adapt the properties viewOrigin and worldOrigin to the newILcdXYWorldReferencesuch that the view is still centered on the same model point.- Specified by:
setXYWorldReferencein interfaceILcdGXYView- Overrides:
setXYWorldReferencein classTLcdGXYViewJPanelLightWeight- Parameters:
aXYWorldReference- the newILcdXYWorldReferenceassociated to this view- See Also:
-