Geotools learning notes-mapcontext

Source: Internet
Author: User

Mapcontext:

 

 

/* <Br/> * geotools-the open source Java GIS toolkit <br/> * http://geotools.org <br/> * (c) 2003-2008, open source geospatial Foundation (osgeo) <br/> * This library is free software; you can redistribute it and/or <br/> * modify it under the terms of the GNU lesser General Public <br/> * license as published by the Free Software Foundation; <br/> * version 2.1 of the license. <br /> * <Br/> * This library is distributed in the hope that it will be useful, <br/> * but without any warranty; without even the implied warranty of <br/> * merchantability or fitness for a particle purpose. see the GNU <br/> * lesser General Public License for more details. <br/> */<br/> package Org. geotools. map; </P> <p> Import Java. AWT. geom. affinetransform; <br/> Import Java. io. ioexception; <br/> Import Java. util. collection; <br/> Import Java. util. iterator; </P> <p> Import Org. geotools. coverage. grid. io. abstractgridcoverage2dreader; <br/> Import Org. geotools. data. featuresource; <br/> Import Org. geotools. feature. featurecollection; <br/> Import Org. geotools. geometry. JTs. referencedenvelope; <br/> Import Org. geotools. map. event. mapboundsevent; <br/> Import Org. geotools. map. event. mapboundslistener; <br/> I Mport Org. geotools. map. event. maplayerlistener; <br/> Import Org. geotools. styling. style; <br/> Import Org. openGIS. coverage. grid. gridcoverage; <br/> Import Org. openGIS. feature. simple. simplefeature; <br/> Import Org. openGIS. feature. simple. simplefeaturetype; <br/> Import Org. openGIS. referencing. factoryexception; <br/> Import Org. openGIS. referencing. CRS. coordinatereferencesystem; <br/> Import Org. openGIS. Referencing. operation. transformexception; </P> <p> Import COM. vividsolutions. JTs. geom. envelope; </P> <p>/** <br/> * store context information about a map display. this object is based on the <br/> * OGC Web Map context specification. <br/> * @ author Cameron shorter <br/> * @ source $ URL: http://svn.geotools.org/trunk/modules/library/render/src/main/java/org/geotools/map/MapContext.java $ <br/> * @ Version $ ID: mapcontext. java 30649 19: 44: 08z acuster $ <br/> */<br/>/** <br/> * stores the graphic information to be displayed. <br/> * the definition of this interface is based on the OGC description. <br/> */<br/> Public interface mapcontext {<br/>/** <br/> * Add a new layer if not already present and trigger a <br/> * {@ link layerlistevent }. <br/> * @ Param layer <br/> * The layer to be inserted <br/> * @ return true if the layer has been added, false Otherwise <br/> * adds a layer maplayer <br/> * returns true if the insertion is successful, otherwise false <br/> */< br/> Boolean addlayer (maplayer layer ); </P> <p>/** <br/> * Add a new layer in the specified position and trigger a <br/> * {@ link layerlistevent }. layer won't be added if it's already in the <br/> * List. <br/> * @ Param index <br/> * index at which the layer will be inserted <br/> * @ Param layer <br/> * The layer to be inserted <br/> * @ return true if the layer has been added, false otherwise <br/> * add a layer maplayer to a specific idex. <br/> * true if insertion is successful <br/> * Otherwise, false is returned. <br /> */<br/> Boolean addlayer (INT index, maplayer layer); </P> <p>/** <br/> * Add a new layer and trigger a {@ link layerlistevent }. <br/> * @ Param featuresource <br/> * A featuresource <simplefeaturetype, simplefeature> With the new layer that will be added. <br/> * add a layer based on featuresource and style <br/> */<br/> void addlayer (featuresource <simplefeaturetype, simplefeature> featuresource, style); </P> <p>/** <br/> * Add a new layer and trigger a {@ link layerlistevent }. <br/> * @ Param collection <br/> * A featurecollection <simplefeaturetype, simplefeature> with the new layer that will be added. <br/> * Add a layer according to featurecollection <br/> */<br/> void addlayer (featurecollection <simplefeaturetype, simplefeature> collection, Style ); </P> <p>/** <br/> * Add a new layer and trigger a {@ link layerlistevent }. <br/> * @ Param collection with the new layer that will be added. <br/> *. Add a layer based on the collection <br/> */<br/> void addlayer (Collection collection, Style ); </P> <p>/** <br/> * Ad D a new layer and trigger a {@ link layerlistevent} <br/> * @ Param gridcoverage <br/> * A gridcoverage with the new layer that will be added. <br/> * Add a gridcoverage layer <br/> */<br/> void addlayer (gridcoverage, Style ); </P> <p>/** <br/> * Add a new layer and trigger a {@ link layerlistevent} <br/> * @ Param gridcoverage <br/> * an abstractgridcoverage2dreader W Ith the new layer that will be added. <br/> */<br/> void addlayer (abstractgridcoverage2dreader gridcoverage, Style ); </P> <p>/** <br/> * remove a layer, if present, and trigger a {@ link layerlistevent }. <br/> * @ Param layer <br/> * A maplayer that will be added. <br/> * @ return true if the layer has been removed <br/> * remove a layer <br/> */<br /> Boolean removelayer (MA Player layer); </P> <p>/** <br/> * remove a layer and trigger a {@ link layerlistevent }. <br/> * @ Param index <br/> * the index of the layer that it's going to be removed <br/> * <br/> * @ return the layer removed, if any <br/> * delete a layer based on the index <br/> */<br/> maplayer removelayer (INT index ); </P> <p>/** <br/> * add an array of new layers and trigger a {@ link layerlistevent }. <br/> *@ Param layers <br/> * The new layers that are to be added. <br/> * @ return the number of layers actually added to the mapcontext <br/> * Add a layers array <br/> */ <br/> int addlayers (maplayer [] layers ); </P> <p>/** <br/> * remove an array of layers and trigger a {@ link layerlistevent }. <br/> * @ Param layers <br/> * the layers that are to be removed. <br/> */<br/> void removelayers (Map Layer [] layers); </P> <p>/** <br/> * clears the whole layer list. will fire a layerlistchangedevent <br/> * clear the list <br/> */<br/> void clearlayerlist (); </P> <p>/** <br/> * return this model's list of layers. if no layers are present, then an <br/> * empty array is returned. <br/> * @ return this model's list of layers. <br/> * Get the layer list <br/> */<br/> maplayer [] getlayers (); </P> <p>/** <br/> * R Eturn the requested layer. <br/> * @ Param index <br/> * index of layer to return. <br/> * @ return the layer at the specified position <br/> * @ throws indexoutofboundsexception <br/> * If the index is out of range <br/> * returns a layer based on the index <br/> */<br/> maplayer getlayer (INT index) throws indexoutofboundsexception; </P> <p>/** <br/> * moves a layer from a position to another. will fire A maplayerlistevent <br/> * @ Param sourceposition <br/> * The layer current position <br/> * @ Param destposition <br/> * The layer new position <br/> * Move layer <br/> */<br/> void movelayer (INT sourceposition, int destposition); </P> <p>/** <br/> * returns an iterator over the layers in this context in proper sequence. <br/> * @ return an iterator over the layers in this context in proper Sequence. <br/> * return an iterator <br/> */<br/> iterator (); </P> <p>/** <br/> * returns the index of the first occurrence of the specified layer, or-1 <br/> * If this list does not contain this element. <br/> * @ Param layer <br/> * The maplayer to search for <br/> * @ return document me! <Br/> * return a layer <br/> * index <br/> */<br/> int indexof (maplayer layer ); </P> <p>/** <br/> * returns the number of layers in this map context <br/> * @ return the number of layers in this map context <br/> * returns the number of layers <br/> */<br/> int getlayercount (); </P> <p>/** <br/> * Get the bounding box of all the layers in this mapcontext. if all the <br/> * layers cannot determine the bounding box in the speed required for each <br/> * layer, then null is returned. the bounds will be expressed in the <br/> * mapcontext coordinate system. <br/> * @ return the bounding box of the features or null if unknown and too <br/> * expensive for the method to calculate. <br/> * @ throws ioexception <br/> * If an ioexception occurs while accessing the featuresource <br/> * bounds <br/> * return Bounds box <br/> */<br/> referencedenvelope getlayerbounds () throws ioexception; </P> <p>/** <br/> * register interest in logging a {@ link layerlistevent }. A <br/> * <code> layerlistevent </code> is sent if a layer is added or removed, but <br/> * Not if the data within a layer changes. <br/> * @ Param listener <br/> * the object to define y when layers have changed. <br/> * add a layer event listener <br/> * If a layer is added or deleted, the event is fired. <br/> */<br/> void addmaplayerlistener (maplayerlistlistener listener); </P> <p>/** <br/> * remove interest in inserting ing {@ link layerlistevent }. <br/> * @ Param listener <br/> * the object to stop sending <code> layerlistevent </code> S. <br/> * remove the event listener <br/> */<br/> void removemaplayerlistlistener (maplayerlistlistener listener ); </P> <p>/** <br/> * set a new area of interest and trigger a {@ link boundingboxevent }. <br/> * @ Param areaofinterest <br/> * The New areaofinterest. <br/> * @ Param coordinatereferencesystem <br/> * the coordinate system being using by this model. <br/> * @ throws illegalargumentexception <br/> * If an argument is <code> null </code>. <br/> * Set envelope in the region of interest <br/> * trigger boundbox events <br/> */<br/> void setareaofinterest (envelope areaofinterest, <br/> coordinatereferencesystem) <br/> throws illegalargumentexception; </P> <p>/** <br/> * set a new area of interest and trigger an {@ link boundingboxevent }. <br/> * @ Param areaofinterest <br/> * the new area of interest. <br/> * @ throws illegalargumentexception <br/> * If an argument is <code> null </code>. <br/> * @ deprecated please use {@ link # setareaofinterest (referencedenvelope)} <br/> * or {@ link # setareaofinterest (envelope, coordinatereferencesystem )} <br/> */<br/> void setareaofinterest (envelope areaofinterest) <br/> throws illegalargumentexception; </P> <p>/** <br/> * set a new area of interest and trigger an {@ link boundingboxevent }. <br/> * @ Param areaofinterest <br/> * the new area of interest. <br/> * @ throws illegalargumentexception <br/> * If an argument is <code> null </code>. <br/> */<br/> void setareaofinterest (referencedenvelope areaofinterest ); </P> <p>/** <br/> * gets the current area of interest. <br/> * @ return current area of interest <br/> */<br/> referencedenvelope getareaofinterest (); </P> <p>/** <br/> * Get the current coordinate system. <br/> * @ return the coordinate system of this box. <br/> * returns the coordinates of an existing layer. <br/> */<br/> coordinatereferencesystem getcoordinatereferencesystem (); </P> <p>/** <br/> * transform the coordinates according to the provided transform. useful for <br/> * zooming and panning processes. <br/> * @ Param transform <br/> * The transform to change area of interest. <br/> * Conversion Coordinate System <br/> */<br/> void transform (affinetransform Transform ); </P> <p>/** <br/> * register interest in processing ing {@ link mapboundsevent} s. <br/> * @ Param listener <br/> * the object to define y when the area of interest has changed. <br/> * Add a time listener <br/> */<br/> void addmapboundslistener (mapboundslistener listener ); </P> <p>/** <br/> * remove interest in processing ing a {@ link boundingboxevent} s. <br/> * @ Param listener <br/> * the object to stop sending change events. <br/> */<br/> void removemapboundslistener (mapboundslistener listener); </P> <p>/** <br/> * Get the abstract which describes this interface, returns an empty string <br/> * if this has not been set yet. <br/> * @ return the abstract. <br/> * return the description of this interface <br/> */<br/> string getabstract (); </P> <p>/** <br/> * set an abstract which describes this context. <br/> * @ Param conabstract <br/> * the abstract. <br/> * set the description of this interface <br/> */<br/> void setabstract (final string conabstract ); </P> <p>/** <br/> * Get the contact information associated with this context, returns an <br/> * empty string if contactinformation has not been set. <br/> * @ return the contactinformation. <br/> * description of returned information <br/> */<br/> string getcontactinformation (); </P> <p>/** <br/> * Set contact inforation associated with this class. <br/> * @ Param contactinformation <br/> * The contactinformation. <br/> */<br/> void setcontactinformation (final string contactinformation ); </P> <p>/** <br/> * set the <code> coordinatereferencesystem </code> for this map context. <br/> * @ Param CRS <br/> * @ throws factoryexception <br/> * @ throws transformexception <br/> * Set Coordinate Reference Information <br /> */<br/> void setcoordinatereferencesystem (final coordinatereferencesystem CRS) <br/> throws transformexception, factoryexception; </P> <p>/** <br/> * Get an array of keywords associated with this context, returns an empty <br/> * array if no keywords have been set. the array returned is a copy, changes <br/> * to the returned array won't influence the mapcontextstate <br/> * @ return array of keywords <br/> */<br/> string [] getkeywords (); </P> <p>/** <br/> * set an array of keywords to associate with this context. <br/> * @ Param keywords <br/> * the keywords. <br/> */<br/> void setkeywords (final string [] keywords); </P> <p>/** <br/> * get the title, returns an empty string if it has not been set yet. <br/> * @ return the title, or an empty string if it has not been set. <br/> */<br/> string gettitle (); </P> <p>/** <br/> * set the title of this context. <br/> * @ Param title <br/> * the title. <br/> */<br/> void settitle (final String title); </P> <p>/** <br/> * registers propertychangelistener to receive events. <br/> * @ Param listener <br/> * the listener to register. <br/> Add a listener <br/> */<br/> Public void addpropertychangelistener (<br/> JAVA. beans. propertychangelistener listener); </P> <p>/** <br/> * removes propertychangelistener from the list of listeners. <br/> * @ Param listener <br/> * the listener to remove. <br/> */<br/> Public void removepropertychangelistener (<br/> JAVA. beans. propertychangelistener listener); <br/>}< br/>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.