Package com.luciad.view.lightspeed
Class TLspAWTView
java.lang.Object
com.luciad.view.lightspeed.ALspAWTView
com.luciad.view.lightspeed.TLspAWTView
- All Implemented Interfaces:
ILcdPropertyChangeSource
,ILcdLayered
,ILcdTreeLayered
,ILcdView
,ILspAWTView
,ILspView
,Serializable
An
ILspView
which is represented by an AWT component. The component
can be accessed via the getHostComponent()
method. This
implementation uses a heavyweight component for drawing into. Lightweight
components overlaid on this view may hence not be drawn correctly. The
getOverlayComponent()
method returns a component which is specially
treated by the view to avoid these issues. Any lightweight overlays should
therefore be added to this overlay component.
Note that the host component is the one that should be added to the application's
GUI. The overlay component is owned by the view and should only be used to add
additional child components to.- Since:
- 2012.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.luciad.view.lightspeed.ILspView
ILspView.ViewType
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected TLcdGLDrawableHolder
createGLDrawable
(ILcdGLCapabilities aCapabilities, GraphicsDevice aGraphicsDevice, ILcdGLDrawable aShareWith) Creates an ILcdGLDrawable for this view canvas.Returns the AWT component that represents thisILspView
.Returns the Swing component that will be painted on top of the view.void
invalidate
(boolean aRepaint, Object aSource, String aMessage) Invalidate the content of thisILcdView
.Methods inherited from class com.luciad.view.lightspeed.ALspAWTView
addLayer, addLayeredListener, addLayerModelListener, addLayerSelectionListener, addLayersFor, addModel, addPropertyChangeListener, addViewInvalidationListener, addViewListener, beginPrinting, containsLayer, destroy, endPrinting, getAltitudeExaggerationFactor, getBackground, getController, getGLDrawable, getHeight, getImage, getLabelPlacer, getLayer, getLayerFactory, getPaintExceptionHandler, getPaintingHints, getPaintingOrder, getRequiredOpenGLProfile, getRootNode, getServices, getViewType, getViewXYZWorldTransformation, getWidth, getXYZWorldReference, indexOf, invokeLater, isAutoUpdate, layerCount, layerOf, layers, layersBackwards, moveLayerAt, print, removeAllLayers, removeLayer, removeLayeredListener, removeLayerModelListener, removeLayerSelectionListener, removeModel, removePropertyChangeListener, removeViewInvalidationListener, removeViewListener, setAltitudeExaggerationFactor, setAutoUpdate, setBackground, setController, setLabelPlacer, setLayerFactory, setPaintingOrder, setViewXYZWorldTransformation, setXYZWorldReference
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.view.ILcdLayered
addLayeredListener, removeLayeredListener
Methods inherited from interface com.luciad.view.lightspeed.ILspView
getDPIScale, getLayers
-
Constructor Details
-
TLspAWTView
Creates a new AWT view with a default configuration. Note thatTLspViewBuilder
provides a convenient way of configuring views if you wish to deviate from the default settings for any reason.- Throws:
UnsatisfiedLinkError
-
-
Method Details
-
getOverlayComponent
Returns the Swing component that will be painted on top of the view. You can add other Swing components to it to paint them on top of the view. Components added to the overlay component will be visible over the view and can be interacted with as expected. By default, the overlay component usesTLcdOverlayLayout
, which is a useful layout manager for overlays. However, other layouts may be used. Typical uses of the overlay component include on-map controls (see thenavigation controls package
) or map legends. Note that this method may returnnull
if the view was created without overlay component support (seeTLspViewBuilder.overlayComponents(boolean)
.- Returns:
- a container to which overlay components can be added
-
createGLDrawable
protected TLcdGLDrawableHolder createGLDrawable(ILcdGLCapabilities aCapabilities, GraphicsDevice aGraphicsDevice, ILcdGLDrawable aShareWith) throws UnsatisfiedLinkError Creates an ILcdGLDrawable for this view canvas. This method is called during construction of the TLspAWTView. The arguments of this method are also those passed in via the constructors.- Parameters:
aCapabilities
- an ILcdGLCapabilitiesaGraphicsDevice
- a GraphicsDeviceaShareWith
- an ILcdGLDrawable- Returns:
- a TLcdGLDrawableHolder
- Throws:
UnsatisfiedLinkError
- when the OpenGL binding native libraries could not be loaded- See Also:
-
invalidate
Description copied from interface:ILcdView
Invalidate the content of thisILcdView
.- Specified by:
invalidate
in interfaceILcdView
- Overrides:
invalidate
in classALspAWTView
- Parameters:
aRepaint
- if true, this ILcdView shall be repainted immediately.aSource
- the class instance that calls this method. Used for tracing.aMessage
- a message associated with this call. Used for tracing.
-
getHostComponent
Returns the AWT component that represents thisILspView
. This component can be used as the view's on-screen representation and is also the channel through which the view can receive user input events. It is not allowed to change any sub-components of this component or their layout. You can use theoverlay component
to paint components on top of the view. The host component can also be used to print the contents of the view (e.g. using TLcdPrintComponentAction).- Returns:
- an AWT component
-