public class TLcdGXYNavigationControlsFactory extends Object
A factory class that offers a convenience method to create a navigation controls component that
interacts with a 2D view (ILcdGXYView
).
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 = TLcdGXYNavigationControlsFactory.createNavigationControls(view, false);
The created component can be added to an overlay container of a GXY view
//Add the navigation controls in an overlay panel that is placed on top of the view
//This ensures that they are placed on top of the map
viewOverlayPanel.add(navigationControls, TLcdOverlayLayout.Location.NORTH_EAST);
This class has a few other factory methods which allow for modifications like different tooltips or different images for the controls.
If you need more specific modifications, you can use the other classes in this package directly to construct your own navigation controls.Modifier and Type | Method and Description |
---|---|
static Component |
createNavigationControls(ILcdGXYView aGXYView,
boolean aAlwaysActive)
Method is identical to
createNavigationControls(com.luciad.view.gxy.ILcdGXYView, java.lang.String, boolean) ,
where the image path is not specified by the API user but a default one is used. |
static Component |
createNavigationControls(ILcdGXYView aGXYView,
boolean aAlwaysActive,
String aCompassToolTip,
String aCompassRingToolTip,
String aCompassUpArrowToolTip,
String aZoomToolTip)
Method is identical to
createNavigationControls(com.luciad.view.gxy.ILcdGXYView, java.lang.String, boolean, java.lang.String, java.lang.String, java.lang.String, java.lang.String) ,
where the image path is not specified by the API user but a default one is used. |
static Component |
createNavigationControls(ILcdGXYView aGXYView,
String aImagePath,
boolean aAlwaysActive)
A factory method that returns a Component that contains controls to navigate
the given view.
|
static Component |
createNavigationControls(ILcdGXYView aGXYView,
String aImagePath,
boolean aAlwaysActive,
String aCompassToolTip,
String aCompassRingToolTip,
String aCompassUpArrowToolTip,
String aZoomToolTip)
A factory method that returns a Component that contains controls to navigate
the given view.
|
static Component |
createNavigationControls(TLcdGXYCompassNavigationControl aCompassNavigationControl,
TLcdGXYZoomNavigationControl aZoomNavigationControl,
boolean aAlwaysActive)
A factory method that returns a
Component that contains controls to navigate the given view using
the compass navigation and zoom controls arguments. |
public static Component createNavigationControls(ILcdGXYView aGXYView, String aImagePath, boolean aAlwaysActive)
Note: this method doesn't add the Navigation controls on top of the view.
aGXYView
- the view that will interact with the navigation controlsaImagePath
- a path to the images. It is assumed that this folder contains a subfolder
/compass and a subfolder /zoom. The images in these folders must follow the naming conventions (
see ALcdCompassNavigationControl
and
ALcdZoomNavigationControl
).aAlwaysActive
- a boolean that indicates whether or not the navigation controls always appear
active. When this is false, the components will switch to their inactive appearance whenever the
mouse isn't hovering over them.public static Component createNavigationControls(ILcdGXYView aGXYView, boolean aAlwaysActive)
Method is identical to createNavigationControls(com.luciad.view.gxy.ILcdGXYView, java.lang.String, boolean)
,
where the image path is not specified by the API user but a default one is used.
This default image path is currently based on the TLcdIconFactory.getDefaultTheme()
and TLcdIconFactory.getDefaultSize()
,
but this might change in future releases.
aGXYView
- the view that will interact with the navigation controlsaAlwaysActive
- a boolean that indicates whether or not the navigation controls always appear
active. When this is false, the components will switch to their inactive appearance whenever the
mouse isn't hovering over them.public static Component createNavigationControls(ILcdGXYView aGXYView, boolean aAlwaysActive, String aCompassToolTip, String aCompassRingToolTip, String aCompassUpArrowToolTip, String aZoomToolTip)
Method is identical to createNavigationControls(com.luciad.view.gxy.ILcdGXYView, java.lang.String, boolean, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
,
where the image path is not specified by the API user but a default one is used.
This default image path is currently based on the TLcdIconFactory.getDefaultTheme()
and TLcdIconFactory.getDefaultSize()
,
but this might change in future releases.
aGXYView
- the view that will interact with the navigation controlsaAlwaysActive
- a boolean that indicates whether or not the navigation controls always appear
active. When this is false, the components will switch to their inactive appearance whenever the
mouse isn't hovering over them.aCompassToolTip
- the general tool tip text for the compass navigation controlaCompassRingToolTip
- the specific tool tip text for the outer ring of the compass navigation controlaCompassUpArrowToolTip
- the specific tool tip text for the up arrow of the compass navigation controlaZoomToolTip
- the tool tip text for the zoom navigation controlpublic static Component createNavigationControls(ILcdGXYView aGXYView, String aImagePath, boolean aAlwaysActive, String aCompassToolTip, String aCompassRingToolTip, String aCompassUpArrowToolTip, String aZoomToolTip)
Note: this method doesn't add the Navigation controls on top of the view.
aGXYView
- the view that will interact with the navigation controlsaImagePath
- a path to the images. It is assumed that this folder contains a subfolder
/compass and a subfolder /zoom. The images in these folders must follow the naming conventions (
see ALcdCompassNavigationControl
and
ALcdZoomNavigationControl
).aAlwaysActive
- a boolean that indicates whether or not the navigation controls always appear
active. When this is false, the components will switch to their inactive appearance whenever the
mouse isn't hovering over them.aCompassToolTip
- the general tool tip text for the compass navigation controlaCompassRingToolTip
- the specific tool tip text for the outer ring of the compass navigation controlaCompassUpArrowToolTip
- the specific tool tip text for the up arrow of the compass navigation controlaZoomToolTip
- the tool tip text for the zoom navigation controlpublic static Component createNavigationControls(TLcdGXYCompassNavigationControl aCompassNavigationControl, TLcdGXYZoomNavigationControl aZoomNavigationControl, boolean aAlwaysActive)
A factory method that returns a Component
that contains controls to navigate the given view using
the compass navigation and zoom controls arguments.
This allows you to customize the compass navigation and zoom controls using their respective API's, and
use this method afterwards to combine them into a single component.
Note: this method doesn't add the Navigation controls on top of the view.
aCompassNavigationControl
- The compass navigation control, or null
when no compass navigation control is neededaZoomNavigationControl
- The zoom navigation control, or null
when no zoom navigation control is neededaAlwaysActive
- a boolean that indicates whether or not the navigation controls always appear
active. When this is false, the components will switch to their inactive appearance whenever the
mouse isn't hovering over them.aCompassNavigationControl
and aZoomNavigationControl
that can used to navigate the view,
or null
when both controls are null
.