Class TLcyGenericMapUtil

java.lang.Object
com.luciad.lucy.map.TLcyGenericMapUtil

public final class TLcyGenericMapUtil extends Object

Utility class which provides methods to interact with a map or view, independent of the type of view.

The methods of this class should only be used on the view painting thread, and not on a background thread. In Lucy, the view painting thread is the Event Dispatch Thread.

Note: if you know the exact type of view, you should consider using a class designed for that specific view. For example when you have a Lightspeed view, you can use the methods in TLspViewNavigationUtil to navigate the view instead of the utility methods in this class. Compared to this class, the Lightspeed specific one TLspViewNavigationUtil has much more customization options and methods available.

Since:
2015.1
  • Constructor Details

    • TLcyGenericMapUtil

      public TLcyGenericMapUtil(ILcyLucyEnv aLucyEnv)
      Create a new utility class for the specified Lucy instance.
      Parameters:
      aLucyEnv - The Lucy back-end.
  • Method Details

    • centerOnObjects

      public void centerOnObjects(ILcdView aView, ILcdLayer aLayer, Object... aDomainObjects) throws TLcdOutOfBoundsException, TLcdNoBoundsException

      Center aView on all of the specified domain objects.

      Centering the view means moving the view to the middle of the specified data. This method does not zoom the view, so the scale will not be changed,

      Parameters:
      aView - The view which will be centered on the specified domain objects
      aLayer - The layer containing all the domain objects. The layer must be contained in aView.
      aDomainObjects - The domain objects on which the view must be centered. Each of those objects must be contained in the model of aLayer and calling ALcdBounds.fromDomainObject(Object) on the object should return valid bounds.
      Throws:
      TLcdOutOfBoundsException - when centering on the given domain objects isn't possible, for instance when the domain objects aren't visible in the current projection.
      TLcdNoBoundsException - when calling ALcdBounds.fromDomainObject(Object) on one of the domain objects does not return valid bounds.
    • fitOnObjects

      public void fitOnObjects(ILcdView aView, ILcdLayer aLayer, Object... aDomainObjects) throws TLcdOutOfBoundsException, TLcdNoBoundsException

      Fit aView on all of the specified domain objects.

      Fitting the view means moving and rescaling the view in such a way that all the specified data fits entirely in the given view.

      Parameters:
      aView - The view which will be fit on the specified domain objects
      aLayer - The layer containing all the domain objects. The layer must be contained in aView. If the layer is invisible, it will be made visible.
      aDomainObjects - The domain objects on which the view must be fitted. Each of those objects must be contained in the model of aLayer and calling ALcdBounds.fromDomainObject(Object) on the object should return valid bounds.
      Throws:
      TLcdOutOfBoundsException - when fitting on the given domain objects isn't possible, for instance when the domain objects aren't visible in the current projection.
      TLcdNoBoundsException - when calling ALcdBounds.fromDomainObject(Object) on one of the domain objects does not return valid bounds.
    • centerOnBounds

      public void centerOnBounds(ILcdView aView, ILcdBounds aBounds, ILcdGeoReference aReference) throws TLcdOutOfBoundsException

      Center aView on the specified bounds.

      Centering the view means moving the view to the middle of the specified bounds. This method does not zoom the view, so the scale will not be changed.

      Parameters:
      aView - The view which will be centered on the specified bounds.
      aBounds - The bounds on which the view must be centered.
      aReference - The reference of the specified bounds.
      Throws:
      TLcdOutOfBoundsException - when centering on the given bounds isn't possible, for instance when the bounds is not visible in the current projection.
      Since:
      2016.0
    • fitOnBounds

      public void fitOnBounds(ILcdView aView, ILcdBounds aBounds, ILcdGeoReference aReference) throws TLcdOutOfBoundsException

      Fit aView on the specified bounds.

      Fitting the view means moving and rescaling the view in such a way that the specified bounds fits entirely in the given view.

      Parameters:
      aView - The view which will be fit on the specified bounds.
      aBounds - The bounds on which the view must be fitted.
      aReference - The reference of the specified bounds.
      Throws:
      TLcdOutOfBoundsException - when fitting on the given bounds isn't possible, for instance when the bounds is not visible in the current projection.
      Since:
      2016.0