All Downloads are FREE. Search and download functionalities are using the official Maven repository.

it.tidalwave.geo.viewer.spi.GeoViewProvider Maven / Gradle / Ivy

/***********************************************************************************************************************
 *
 * forceTen - open source geography
 * Copyright (C) 2007-2012 by Tidalwave s.a.s. (http://www.tidalwave.it)
 *
 ***********************************************************************************************************************
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations under the License.
 *
 ***********************************************************************************************************************
 *
 * WWW: http://forceten.tidalwave.it
 * SCM: https://bitbucket.org/tidalwave/forceten-src
 *
 **********************************************************************************************************************/
package it.tidalwave.geo.viewer.spi;

import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import java.awt.Component;
import java.awt.Point;
import javax.swing.JPopupMenu;
import org.openide.util.Lookup;
import it.tidalwave.geo.Coordinate;
import it.tidalwave.geo.Sector;
import it.tidalwave.geo.viewer.ZoomLevel;

/***********************************************************************************************************************
 *
 * This interface describes a provider for maps that can be used in the MapViewerTopComponent.
 *
 * @author  Fabrizio Giudici
 * @version $Id$
 *
 **********************************************************************************************************************/
public interface GeoViewProvider extends Lookup.Provider
  {
    /*******************************************************************************************************************
     *
     *
     ******************************************************************************************************************/
    public static interface LifeCycle
      {
        /***********************************************************************
         *
         *
         **********************************************************************/
        public void activating();

        /***********************************************************************
         *
         *
         **********************************************************************/
        public void activated();

        /***********************************************************************
         *
         *
         **********************************************************************/
        public void deactivating();

        /***********************************************************************
         *
         *
         **********************************************************************/
        public void deactivated();
      }
    
    /***************************************************************************
     *
     *
     **************************************************************************/
    public static interface CoordinateTracker
      {
        public void coordinatesChanged (@CheckForNull Coordinate coordinate);

        public static final CoordinateTracker VOID = new CoordinateTracker()
          {
            @Override
            public void coordinatesChanged (final @CheckForNull Coordinate coordinate)
              {
              }
          };
      }

    /*******************************************************************************************************************
     *
     *
     ******************************************************************************************************************/
    public void initResources();
    
    /*******************************************************************************************************************
     *
     *
     ******************************************************************************************************************/
    public boolean isReady();
      
    /*******************************************************************************************************************
     *
     * Returns the name of this {@code GeoViewProvider}.
     *
     * @return the name
     *
     ******************************************************************************************************************/
    @Nonnull
    public String getName();
    
    /*******************************************************************************************************************
     *
     * Returns the initial zoom level that should be used by default with this {@code GeoViewProvider}.
     *
     * @return the initial zoom level
     *
     ******************************************************************************************************************/
    public int getInitialZoomLevel();
    
    /*******************************************************************************************************************
     *
     *
     ******************************************************************************************************************/
    public int getMaximumZoomLevel();
    
    /*******************************************************************************************************************
     *
     *
     ******************************************************************************************************************/
    public int getMinimumZoomLevel();
    
    /*******************************************************************************************************************
     *
     * Translates an abstract zoom level into the concrete, integer zoom level used by this {@code GeoViewProvider}.
     *
     * @param zoomLevel  the abstract zoom level
     * @return the specific zoom level
     *
     ******************************************************************************************************************/
    public int getZoomLevel (@Nonnull ZoomLevel zoomLevel);
    
    /*******************************************************************************************************************
     *
     *
     ******************************************************************************************************************/
    @CheckForNull
    public JPopupMenu getOptionsMenu();
    
    /*******************************************************************************************************************
     *
     *
     ******************************************************************************************************************/
    public void setZoom (int zoom);
    
    /*******************************************************************************************************************
     *
     *
     ******************************************************************************************************************/
    public int getZoom();
    
    /*******************************************************************************************************************
     *
     *
     ******************************************************************************************************************/
    @Nonnull
    public Point coordinatesToPoint (@Nonnull Coordinate coordinates);
    
    /*******************************************************************************************************************
     *
     *
     ******************************************************************************************************************/
    @Nonnull
    public Coordinate pointToCoordinates (@Nonnull Point point);
    
    /*******************************************************************************************************************
     *
     *
     ******************************************************************************************************************/
    public void fitView (@Nonnull Sector sector);
        
    /*******************************************************************************************************************
     *
     *
     ******************************************************************************************************************/
    public void pan (double x, double y);
    
    /*******************************************************************************************************************
     *
     *
     ******************************************************************************************************************/
    public void setCenterPosition (@Nonnull Coordinate centerPosition);

    /*******************************************************************************************************************
     *
     *
     ******************************************************************************************************************/
    @Nonnull
    public Coordinate getCenterPosition();
    
    /*******************************************************************************************************************
     *
     *
     ******************************************************************************************************************/
    public Component getRendererComponent();
    
    /*******************************************************************************************************************
     *
     *
     ******************************************************************************************************************/
    public void setCoordinatesTracker (@Nonnull CoordinateTracker coordinatesTracker);

    /*******************************************************************************************************************
     *
     *
     ******************************************************************************************************************/
    @Nonnull
    public abstract GeoDataProviderDescriptor getGeoDataProviderDescriptor();

    /*******************************************************************************************************************
     *
     *
     ******************************************************************************************************************/
    public abstract void setGeoDataProviderDescriptor (@Nonnull GeoDataProviderDescriptor geoDataProviderDescriptor);
  }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy