Class TLcdGXYNavigationControlsFactory

java.lang.Object
com.luciad.view.gxy.swing.navigationcontrols.TLcdGXYNavigationControlsFactory

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 controls
The navigation controls.

The navigation control component is composed out of different elements (from top to bottom):

  • The compass navigation control: the outer ring allows to change the rotation of the map and the inner component allows to pan the map around.
  • The zoom control: allows to zoom in and out

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.
Since:
10.0
  • Method Details

    • createNavigationControls

      public static Component createNavigationControls(ILcdGXYView aGXYView, String aImagePath, boolean aAlwaysActive)
      A factory method that returns a Component that contains controls to navigate the given view. No tooltips will be added.

      Note: this method doesn't add the Navigation controls on top of the view.

      Parameters:
      aGXYView - the view that will interact with the navigation controls
      aImagePath - 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.
      Returns:
      a component that can be used to navigate on the given view, or null when no images can be found. If the images for some but not all sub components can be found, a partial navigation controls component will be returned.
    • createNavigationControls

      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.

      Parameters:
      aGXYView - the view that will interact with the navigation controls
      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.
      Returns:
      a component that can be used to navigate on the given view, or null when no images can be found. If the images for some but not all sub components can be found, a partial navigation controls component will be returned.
      Since:
      2016.0
    • createNavigationControls

      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.

      Parameters:
      aGXYView - the view that will interact with the navigation controls
      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 control
      aCompassRingToolTip - the specific tool tip text for the outer ring of the compass navigation control
      aCompassUpArrowToolTip - the specific tool tip text for the up arrow of the compass navigation control
      aZoomToolTip - the tool tip text for the zoom navigation control
      Returns:
      a component that can be used to navigate on the given view, or null when no images can be found. If the images for some but not all sub components can be found, a partial navigation controls component will be returned.
      Since:
      2016.0
    • createNavigationControls

      public 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.

      Note: this method doesn't add the Navigation controls on top of the view.

      Parameters:
      aGXYView - the view that will interact with the navigation controls
      aImagePath - 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 control
      aCompassRingToolTip - the specific tool tip text for the outer ring of the compass navigation control
      aCompassUpArrowToolTip - the specific tool tip text for the up arrow of the compass navigation control
      aZoomToolTip - the tool tip text for the zoom navigation control
      Returns:
      a component that can be used to navigate on the given view, or null when no images can be found. If the images for some but not all sub components can be found, a partial navigation controls component will be returned.
    • createNavigationControls

      public 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.

      Parameters:
      aCompassNavigationControl - The compass navigation control, or null when no compass navigation control is needed
      aZoomNavigationControl - The zoom navigation control, or null when no zoom navigation control is needed
      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.
      Returns:
      A component consisting of aCompassNavigationControl and aZoomNavigationControl that can used to navigate the view, or null when both controls are null.
      Since:
      2019.0.05