Package com.luciad.view.map
Class TLcdMapJPanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.luciad.view.gxy.TLcdGXYViewJPanel
com.luciad.view.map.TLcdMapJPanel
- All Implemented Interfaces:
ILcdAWTEventSource
,ILcdModelProducerListener
,ILcdPropertyChangeSource
,ILcdRotationCapable
,ILcdStatusSource
,ILcdGXYView
,ILcdGXYViewXYWorldTransformationProvider
,ILcdRotationCapableGXYView
,ILcdLayered
,ILcdTreeLayered
,ILcdView
,ImageObserver
,MenuContainer
,Serializable
,EventListener
,Accessible
TLcdGXYViewJPanel
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 disabled
and/orreplaced
. - a WGS 84 based grid reference with an equidistant cylindrical projection and a default scale that fits the entire world
- a redefined
setXYWorldReference
method that keeps the map centered on the same model point. This behavior is enabled by default but can bedeactivated
if 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.AccessibleJPanel
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface com.luciad.view.gxy.ILcdGXYView
CENTER, LOWERLEFT, LOWERRIGHT, UPPERLEFT, UPPERRIGHT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Constructor Summary
ConstructorDescriptionConstructs a newTLcdGXYViewJPanel
-basedILcdGXYView
with a longitude/latitude grid and aTLcdGridReference
that has an instance ofTLcdEquidistantCylindrical
asILcdProjection
.TLcdMapJPanel
(boolean aRegisterInstance) Deprecated.Use the default constructor.TLcdMapJPanel
(ILcdTreeLayeredSupport aTreeLayeredSupport) Constructs a newTLcdGXYViewJPanel
-basedILcdGXYView
with a longitude/latitude grid and aTLcdGridReference
that has an instance ofTLcdEquidistantCylindrical
asILcdProjection
. -
Method Summary
Modifier and TypeMethodDescriptionReturns the grid layer that was configured usingsetGridLayer(com.luciad.view.gxy.ILcdGXYLayer)
, if any.boolean
boolean
Deprecated.This method has been deprecated.boolean
Returns whether or not the map includes a configured grid layer.void
setAutoAdjustOnSetXYWorldReference
(boolean aBoolean) void
setGridLayer
(ILcdGXYLayer aGridLayer) Configures the given layer as the grid layer of this map.void
setTraceOn
(boolean aTraceOn) Deprecated.This method has been deprecated.void
setWithGridLayer
(boolean aWithGridLayer) Enables or disables the configured grid layer.void
setXYWorldReference
(ILcdXYWorldReference aXYWorldReference) Sets the property of XYWorldReference to aXYWorldReference.Methods inherited from class com.luciad.view.gxy.TLcdGXYViewJPanel
addAWTEventListener, addGXYLayer, addGXYLayer, addLayeredListener, addLayerSelectionListener, addModel, addModelListener, addNotify, addPropertyChangeListener, addStatusListener, addViewInvalidationListener, asGXYView, containsLayer, getBackground, 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, isSmartPan, 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, setClassTraceOn, setDefaultPen, setDisplayName, setDrawOffScreenImageOnPaint, setGXYController, setGXYLayerFactory, setGXYViewLabelPainter, setGXYViewLabelPlacer, setMaxScale, setMinScale, setNumberOfCachedBackgroundLayers, setPaintExceptionHandler, setPaintInBackground, setPaintingMode, setRotation, setRotation, setRotation, setScale, setScale, setScale, setScale, setSmartPan, setUpdateLabelsOnSelectionChanged, setViewOrigin, setViewOrigin, setViewOrigin, setWaitCursorOn, setWorldOrigin, setWorldOrigin, setWorldOrigin, setXYWorldReference, setXYWorldReference
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
Methods 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, update
Methods 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, validateTree
Methods 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, transferFocusUpCycle
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.luciad.view.gxy.ILcdGXYView
getForeground, getGraphics, getHeight, getLayers, getMapScale, getMapScaleRange, getPreferredSize, getWidth, repaint, repaint, setCursor, setForeground, setMapScale, setMapScaleRange
Methods inherited from interface com.luciad.view.ILcdLayered
addLayeredListener, removeLayeredListener
-
Constructor Details
-
TLcdMapJPanel
public TLcdMapJPanel()Constructs a new
TLcdGXYViewJPanel
-basedILcdGXYView
with a longitude/latitude grid and aTLcdGridReference
that has an instance ofTLcdEquidistantCylindrical
asILcdProjection
.The scale is set to make the earth fit in this
ILcdGXYView
. -
TLcdMapJPanel
Constructs a new
TLcdGXYViewJPanel
-basedILcdGXYView
with a longitude/latitude grid and aTLcdGridReference
that has an instance ofTLcdEquidistantCylindrical
asILcdProjection
. The scale is set to make the earth fit in thisILcdGXYView
.- Parameters:
aTreeLayeredSupport
- an instance ofILcdTreeLayeredSupport
used to store the layers
-
TLcdMapJPanel
public TLcdMapJPanel(boolean aRegisterInstance) Deprecated.Use the default constructor.Constructs a new
TLcdGXYViewJPanel
-basedILcdGXYView
.- Parameters:
aRegisterInstance
- if true, registers the view withTLcdBeanManager
- See Also:
-
-
Method Details
-
setTraceOn
public void setTraceOn(boolean aTraceOn) Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for this class instance. Calling this method with eithertrue
orfalse
as argument automatically turns off tracing for all other class instances for whichsetTraceOn
has not been called. If the argument isfalse
then only the informative, warning and error log messages are recorded.- Overrides:
setTraceOn
in classTLcdGXYViewJPanel
- Parameters:
aTraceOn
- if true then all log messages are recorded for this instance. If false, then only the informative, warning and error log messages are recorded.
-
isTraceOn
public boolean isTraceOn()Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Returnstrue
if tracing is enabled for this class.- Overrides:
isTraceOn
in classTLcdGXYViewJPanel
- Returns:
- true if tracing is enabled for this class, false otherwise.
-
getGridLayer
Returns the grid layer that was configured usingsetGridLayer(com.luciad.view.gxy.ILcdGXYLayer)
, if any.- Returns:
- the grid layer of this map, or
null
if 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:
true
if the map has a configured and enabled grid layer,false
otherwise.- 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
-true
if the map has a configured grid layer,false
otherwise.- See Also:
-
setAutoAdjustOnSetXYWorldReference
public void setAutoAdjustOnSetXYWorldReference(boolean aBoolean) - Parameters:
aBoolean
- if true the setXYWorldReference method will be redefined in order to keep thisILcdGXYView
still 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 newILcdXYWorldReference
such that the view is still centered on the same model point.- Specified by:
setXYWorldReference
in interfaceILcdGXYView
- Overrides:
setXYWorldReference
in classTLcdGXYViewJPanel
- Parameters:
aXYWorldReference
- the newILcdXYWorldReference
associated to this view- See Also:
-