public class TLspNavigationControlsBuilder extends Object
Builder for creating navigation control components that interacts with a view
(ILspView
).
The navigation control component is composed out of different elements (from top to bottom):
Creating a navigation control component including all widgets can be done as follows:
//Create the navigation controls
//In this example, we use all available types of navigation controls
Component navigationControls = TLspNavigationControlsBuilder.newBuilder(view)
.allNavigationControls()
.build();
The created component can be added to the overlay component of an ILspAWTView
:
//Add the navigation controls in the overlay panel of the view
//This ensures that they are placed on top of the map
view.getOverlayComponent().add(navigationControls, TLcdOverlayLayout.Location.NORTH_EAST);
This builder allows for a few modifications.
For example:
*NavigationControl()
method instead of the allNavigationControls()
method.Modifier | Constructor and Description |
---|---|
protected |
TLspNavigationControlsBuilder(ILspView aView)
Creates a
TLspNavigationControlsBuilder with default initialization. |
Modifier and Type | Method and Description |
---|---|
TLspNavigationControlsBuilder |
allNavigationControls()
Sets a compass, pan and zoom component on the navigation controls.
|
TLspNavigationControlsBuilder |
altitudeExaggerationControl()
Sets an altitude exaggeration component on the navigation controls to exaggerate
the terrain in the view.
|
TLspNavigationControlsBuilder |
altitudeExaggerationToolTip(String aAltitudeToolTip)
Sets the tooltip text for the altitude exaggeration tool.
|
TLspNavigationControlsBuilder |
alwaysActive(boolean aIsAlwaysActive)
Sets whether or not the navigation controls always appear active.
|
Component |
build()
Builds a Component that contains controls to navigate the given view.
|
TLspNavigationControlsBuilder |
compassAndPanNavigationControl()
Sets a compass and pan component on the navigation controls to rotate and pan the view.
|
TLspNavigationControlsBuilder |
compassNavigationControl()
Sets a compass component on the navigation controls that can change the rotation of the view.
|
TLspNavigationControlsBuilder |
compassRingToolTip(String aCompassRingToolTip)
Sets the tooltip text for the compass ring tool.
|
TLspNavigationControlsBuilder |
compassToolTip(String aCompassToolTip)
Sets the tooltip text for the compass tool.
|
TLspNavigationControlsBuilder |
compassUpArrowToolTip(String aCompassUpArrowToolTip)
Sets the tooltip text for the compass up arrow tool.
|
TLspNavigationControlsBuilder |
imagePath(String aImagePath)
Sets the path to the images used to alter the appearance of the compass, pan and navigation
components.
|
TLspNavigationControlsBuilder |
largeImagePath()
Sets the image path to a path containing a default set of large images.
|
TLspNavigationControlsBuilder |
magneticNorthMap(ILcdMagneticNorthMap aMagneticNorthMap)
Lets the compass point to the magnetic north instead of true north, using the given
magnetic north map.
|
static TLspNavigationControlsBuilder |
newBuilder(ILspView aView)
Returns a builder to create navigation controls for the passed view.
|
TLspNavigationControlsBuilder |
panNavigationControl()
Sets a pan component on the navigation controls to pan the view.
|
TLspNavigationControlsBuilder |
panToolTip(String aPanToolTip)
Sets the tooltip text for the pan tool.
|
TLspNavigationControlsBuilder |
smallImagePath()
Sets the image path to a path containing a default set of small images.
|
TLspNavigationControlsBuilder |
view(ILspView aView)
Sets the view that will interact with the navigation controls.
|
TLspNavigationControlsBuilder |
zoomNavigationControl()
Sets a zoom component on the navigation controls to zoom in/out on the view.
|
TLspNavigationControlsBuilder |
zoomToolTip(String aZoomToolTip)
Sets the tooltip text for the zoom tool.
|
protected TLspNavigationControlsBuilder(ILspView aView)
TLspNavigationControlsBuilder
with default initialization.aView
- the view that will interact with the navigation controls.newBuilder(com.luciad.view.lightspeed.ILspView)
public static TLspNavigationControlsBuilder newBuilder(ILspView aView)
aView
- the view that will interact with the navigation controls.TLspNavigationControlsBuilder
public TLspNavigationControlsBuilder view(ILspView aView)
aView
- the view that will interact with the navigation controls.public TLspNavigationControlsBuilder allNavigationControls()
public TLspNavigationControlsBuilder compassNavigationControl()
public TLspNavigationControlsBuilder panNavigationControl()
public TLspNavigationControlsBuilder compassAndPanNavigationControl()
public TLspNavigationControlsBuilder zoomNavigationControl()
public TLspNavigationControlsBuilder altitudeExaggerationControl()
public TLspNavigationControlsBuilder imagePath(String aImagePath)
ALcdCompassNavigationControl
, ALcdPanNavigationControl
and ALcdZoomNavigationControl
).
The default image path is currently based on the TLcdIconFactory.getDefaultTheme()
and TLcdIconFactory.getDefaultSize()
,
but this might change in future releases.aImagePath
- the path to the images.public TLspNavigationControlsBuilder smallImagePath()
public TLspNavigationControlsBuilder largeImagePath()
public TLspNavigationControlsBuilder alwaysActive(boolean aIsAlwaysActive)
aIsAlwaysActive
- a boolean that indicates whether or not the navigation controls always
appear active.public TLspNavigationControlsBuilder compassToolTip(String aCompassToolTip)
aCompassToolTip
- a String
which will be used as a tool-tip text for the
compass tool.public TLspNavigationControlsBuilder compassRingToolTip(String aCompassRingToolTip)
aCompassRingToolTip
- a String
which will be used as a tool-tip text for the
compass ring tool.public TLspNavigationControlsBuilder compassUpArrowToolTip(String aCompassUpArrowToolTip)
aCompassUpArrowToolTip
- a String
which will be used as a tool-tip text for
the compass up arrow tool.public TLspNavigationControlsBuilder panToolTip(String aPanToolTip)
aPanToolTip
- a String
which will be used as a tool-tip text for the pan
tool.public TLspNavigationControlsBuilder zoomToolTip(String aZoomToolTip)
aZoomToolTip
- a String
which will be used as a tool-tip text for the zoom
tool.public TLspNavigationControlsBuilder altitudeExaggerationToolTip(String aAltitudeToolTip)
aAltitudeToolTip
- a String
which will be used as the tool-tip text for the altitude exaggeration tool.public TLspNavigationControlsBuilder magneticNorthMap(ILcdMagneticNorthMap aMagneticNorthMap)
aMagneticNorthMap
- the map to use. If null or not called, the compass will point to the true north.public Component build()
default controls
are added.
Note: this method does not add the Navigation controls on top of the view.
To add this component to a (heavyweight) ILspView
, see
ILspAWTView.getOverlayComponent()
.