001    /*
002     *    GeoAPI - Java interfaces for OGC/ISO standards
003     *    http://www.geoapi.org
004     *
005     *    Copyright (C) 2004-2012 Open Geospatial Consortium, Inc.
006     *    All Rights Reserved. http://www.opengeospatial.org/ogc/legal
007     *
008     *    Permission to use, copy, and modify this software and its documentation, with
009     *    or without modification, for any purpose and without fee or royalty is hereby
010     *    granted, provided that you include the following on ALL copies of the software
011     *    and documentation or portions thereof, including modifications, that you make:
012     *
013     *    1. The full text of this NOTICE in a location viewable to users of the
014     *       redistributed or derivative work.
015     *    2. Notice of any changes or modifications to the OGC files, including the
016     *       date changes were made.
017     *
018     *    THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE
019     *    NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
020     *    TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT
021     *    THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY
022     *    PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
023     *
024     *    COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
025     *    CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
026     *
027     *    The name and trademarks of copyright holders may NOT be used in advertising or
028     *    publicity pertaining to the software without specific, written prior permission.
029     *    Title to copyright in this software and any associated documentation will at all
030     *    times remain with copyright holders.
031     */
032    package org.opengis.display.canvas;
033    
034    import org.opengis.geometry.DirectPosition;
035    import org.opengis.referencing.crs.ProjectedCRS;
036    import org.opengis.referencing.crs.CoordinateReferenceSystem;
037    import org.opengis.referencing.operation.TransformException;
038    import org.opengis.util.InternationalString;
039    import org.opengis.annotation.UML;
040    
041    import static org.opengis.annotation.Obligation.*;
042    import static org.opengis.annotation.Specification.*;
043    
044    
045    /**
046     * Controls the state of a {@linkplain Canvas canvas}, including its position, scale and title.
047     *
048     * @author Open GIS Consortium, Inc.
049     * @author Johann Sorel (Geomatys)
050     * @since  GeoAPI 2.2
051     */
052    public interface CanvasController {
053        /**
054         * Sets the title of the {@linkplain Canvas canvas}. The title of a canvas
055         * may or may not be displayed in the titlebar of an application's window.
056         *
057         * @param title The new title for the canvas.
058         *
059         * @see CanvasState#getTitle
060         */
061        @UML(identifier="Canvas.setTitle", specification=OGC_03064, obligation=OPTIONAL)
062        void setTitle(InternationalString title);
063    
064        /**
065         * Sets the position of the center point of the {@linkplain Canvas canvas}.
066         * The coordinate shall be in {@linkplain CanvasState#getObjectiveCRS objective CRS}.
067         *
068         * @param center The new center position.
069         *
070         * @see CanvasState#getCenter
071         */
072        @UML(identifier="setCenter", specification=OGC_03064, obligation=OPTIONAL)
073        void setCenter(DirectPosition center);
074    
075        /**
076         * Sets the "real world" Coordinate Reference System. This is typically
077         * a {@linkplain ProjectedCRS projected CRS} using linear units like metre.
078         * Graphic data will be projected to this CRS before to be display.
079         *
080         * @param  crs The new objective Coordinate Reference System.
081         * @throws TransformException If at least one graphic primivite can not be transformed to
082         *         the specified CRS, or if the given CRS can not be accepted for an other reason.
083         *
084         * @see CanvasState#getObjectiveCRS
085         */
086        @UML(identifier="Canvas.setObjectiveCoordinateReferenceSystem", specification=OGC_03064, obligation=OPTIONAL)
087        void setObjectiveCRS(CoordinateReferenceSystem crs) throws TransformException;
088    }