Package com.luciad.view.lightspeed.swing
Class TLspBalloonManager
java.lang.Object
com.luciad.view.swing.ALcdBalloonManager
com.luciad.view.lightspeed.swing.TLspBalloonManager
Balloon manager for Lightspeed views.
Once you set an appropriate balloon descriptor, the manager retrieves the corresponding balloon contents and anchors those on the map overlay into a movable and resizable balloon GUI component with an arrow. The balloon will remain on the map until the user closes it or until you passnull
to ALcdBalloonManager.setBalloonDescriptor(com.luciad.view.swing.ALcdBalloonDescriptor)
.
Balloons are typically, but not necessarily tied to domain object selection:
view.addLayerSelectionListener(
(ILcdSelectionListener<Object>) aSelectionEvent -> {
ILcdLayer layer = (ILcdLayer) aSelectionEvent.getSelection();
if (layer.getSelectionCount() == 1) {
TLcdDomainObjectContext objectContext = new TLcdDomainObjectContext(
layer.selectedObjects().nextElement(), layer.getModel(), layer, view);
manager.setBalloonDescriptor(new TLcdModelElementBalloonDescriptor(objectContext));
} else {
manager.setBalloonDescriptor(null);
}
});
samples.common.BalloonViewSelectionListener
sample class does exactly this, and also makes sure that hiding
or removing layers removes corresponding balloons.
Note that TLspBalloonManager only supports the display of one balloon at a time.
For more information on adding balloons to the view, refer to the balloon how-to article.
- Since:
- 2012.0
-
Constructor Summary
ConstructorDescriptionTLspBalloonManager
(ILspAWTView aView) Creates a default balloon manager for the given view.TLspBalloonManager
(ILspAWTView aView, ILcdBalloonContentProvider aBalloonContentProvider) Creates a default balloon manager for the given view, using the given content provider.TLspBalloonManager
(ILspAWTView aView, ILcdBalloonContentProvider aBalloonContentProvider, TLcdBalloonGUIFactory aBalloonGUIFactory) Creates a default balloon manager for the given view, using the given content provider and GUI factory.TLspBalloonManager
(ILspView aView, Container aBalloonContainer, Object aConstraints) Creates a default balloon manager for the given view, using the given container and layout constraints.TLspBalloonManager
(ILspView aView, Container aBalloonContainer, Object aConstraints, ILcdBalloonContentProvider aBalloonContentProvider) Creates a default balloon manager for the given view, using the given container and layout constraints, and the given content provider.TLspBalloonManager
(ILspView aView, Container aBalloonContainer, Object aConstraints, ILcdBalloonContentProvider aBalloonContentProvider, TLcdBalloonGUIFactory aBalloonGUIFactory) Creates a default balloon manager for the given view, using the given container and layout constraints, and the given content provider and GUI factory. -
Method Summary
Modifier and TypeMethodDescriptionprotected Point
getFocusPoint
(ALcdBalloonDescriptor aBalloonDescriptor) Returns the focus point of a given object in view coordinates, or null if there is no focus point.getView()
Returns the view this manager is configured for.Methods inherited from class com.luciad.view.swing.ALcdBalloonManager
computeBalloonBounds, getBalloon, getBalloonContainer, getBalloonContent, getBalloonContentProvider, getBalloonDescriptor, isBalloonsEnabled, setBalloonContentProvider, setBalloonDescriptor, setBalloonsEnabled
-
Constructor Details
-
TLspBalloonManager
Creates a default balloon manager for the given view. This constructor uses the overlay panel of the given view (seeILspAWTView.getOverlayComponent()
). The used constraint isTLcdOverlayLayout.Location.NO_LAYOUT
.The content provider is retrieved using the
LcdService
annotation. For more information, refer to the Working with the services mechanism article.- Parameters:
aView
- a view which can be used for world to view transformations.
-
TLspBalloonManager
Creates a default balloon manager for the given view, using the given content provider. This constructor uses the overlay panel of the given view (seeILspAWTView.getOverlayComponent()
). The used constraint isTLcdOverlayLayout.Location.NO_LAYOUT
.- Parameters:
aView
- the view for which balloons should be managedaBalloonContentProvider
- a balloon panel provider capable of creating balloon content panels given an object.
-
TLspBalloonManager
public TLspBalloonManager(ILspAWTView aView, ILcdBalloonContentProvider aBalloonContentProvider, TLcdBalloonGUIFactory aBalloonGUIFactory) Creates a default balloon manager for the given view, using the given content provider and GUI factory. This constructor uses the overlay panel of the given view (seeILspAWTView.getOverlayComponent()
). The used constraint isTLcdOverlayLayout.Location.NO_LAYOUT
.- Parameters:
aView
- the view for which balloons should be managedaBalloonContentProvider
- a balloon panel provider capable of creating balloon content panels given an object.aBalloonGUIFactory
- a custom balloon GUI factory
-
TLspBalloonManager
Creates a default balloon manager for the given view, using the given container and layout constraints.- Parameters:
aView
- the view for which balloons should be managedaBalloonContainer
- a container to which balloons can be added.aConstraints
- The constraints with which the balloon should be added to aBalloonContainer, i.e.: TLcdOverlayLayout.Location.NO_LAYOUT. If null, default constraints are used.
-
TLspBalloonManager
public TLspBalloonManager(ILspView aView, Container aBalloonContainer, Object aConstraints, ILcdBalloonContentProvider aBalloonContentProvider) Creates a default balloon manager for the given view, using the given container and layout constraints, and the given content provider.- Parameters:
aView
- the view for which balloons should be managedaBalloonContainer
- a container to which balloons can be added.aConstraints
- The constraints with which the balloon should be added to aBalloonContainer, i.e.: TLcdOverlayLayout.Location.NO_LAYOUT. If null, default constraints are used.aBalloonContentProvider
- a balloon panel provider capable of creating balloon content panels given an object.
-
TLspBalloonManager
public TLspBalloonManager(ILspView aView, Container aBalloonContainer, Object aConstraints, ILcdBalloonContentProvider aBalloonContentProvider, TLcdBalloonGUIFactory aBalloonGUIFactory) Creates a default balloon manager for the given view, using the given container and layout constraints, and the given content provider and GUI factory.- Parameters:
aView
- the view for which balloons should be managedaBalloonContainer
- a container to which balloons can be added.aConstraints
- The constraints with which the balloon should be added to aBalloonContainer, i.e.: TLcdOverlayLayout.Location.NO_LAYOUT. If null, default constraints are used.aBalloonContentProvider
- a balloon panel provider capable of creating balloon content panels given an object.aBalloonGUIFactory
- a custom balloon GUI factory
-
-
Method Details
-
getView
Returns the view this manager is configured for.- Returns:
- the view this manager is configured for
-
getFocusPoint
Returns the focus point of a given object in view coordinates, or null if there is no focus point.- Specified by:
getFocusPoint
in classALcdBalloonManager
- Parameters:
aBalloonDescriptor
- an object, describing a balloon.- Returns:
- Returns either null if there is no focus point, or a valid point in view coordinates.
-