public class TLspAWTView extends ALspAWTView
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.ILspView.ViewType
Constructor and Description |
---|
TLspAWTView()
Creates a new AWT view with a default configuration.
|
Modifier and Type | Method and Description |
---|---|
protected TLcdGLDrawableHolder |
createGLDrawable(ILcdGLCapabilities aCapabilities,
GraphicsDevice aGraphicsDevice,
ILcdGLDrawable aShareWith)
Creates an ILcdGLDrawable for this view canvas.
|
Component |
getHostComponent()
Returns the AWT component that represents this
ILspView . |
JComponent |
getOverlayComponent()
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 this
ILcdView . |
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDPIScale, getLayers
addLayeredListener, removeLayeredListener
public TLspAWTView() throws UnsatisfiedLinkError
TLspViewBuilder
provides a convenient way of configuring views if
you wish to deviate from the default settings for any reason.UnsatisfiedLinkError
public JComponent getOverlayComponent()
TLcdOverlayLayout
,
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 the
navigation controls package
) or
map legends.
Note that this method may return null
if the view was created without overlay
component support (see TLspViewBuilder.overlayComponents(boolean)
.protected TLcdGLDrawableHolder createGLDrawable(ILcdGLCapabilities aCapabilities, GraphicsDevice aGraphicsDevice, ILcdGLDrawable aShareWith) throws UnsatisfiedLinkError
aCapabilities
- an ILcdGLCapabilitiesaGraphicsDevice
- a GraphicsDeviceaShareWith
- an ILcdGLDrawableUnsatisfiedLinkError
- when the OpenGL binding native libraries could
not be loadedILcdGLDrawableFactory
public void invalidate(boolean aRepaint, Object aSource, String aMessage)
ILcdView
ILcdView
.invalidate
in interface ILcdView
invalidate
in class ALspAWTView
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.public Component getHostComponent()
ILspView
. 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
the overlay 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).