|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.arcgis.display.MapContext
public class MapContext
The context in which geometric effects and marker placement work.
There are three reference frames which are used for data translation between geographic, map and output display context. These frames are:
MapContext CoClass relates to the Map Reference Frame. IMapContext interface manages the map context object.
Constructor Summary | |
---|---|
MapContext()
Constructs a MapContext using ArcGIS Engine. |
|
MapContext(Object obj)
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts. MapContext theMapContext = (MapContext) obj; |
Method Summary | |
---|---|
boolean |
equals(Object o)
Compare this object with another |
IGeometry |
fromGeographyToMap(IGeometry ingeom)
Converts geographic geometry to map context geometry. |
IGeometry |
fromMapToGeography(IGeometry ingeom)
Converts map context geometry to geographic geometry. |
double |
fromPoints(double ptDist)
Converts a distance expressed in points into a geographic distance. |
static String |
getClsid()
getClsid. |
double |
getReferenceScale()
The reference scale of the map. |
ISpatialReference |
getSpatialReference()
The spatial reference of the map. |
int |
hashCode()
the hashcode for this object |
void |
init(ISpatialReference mapProj,
double mapRefScale,
IEnvelope mapExtent)
Initializes the map context. |
void |
initFromDisplay(IDisplayTransformation displayTransform)
Initializes the map context using a display transformation. |
void |
interfaceSupportsErrorInfo(GUID riid)
interfaceSupportsErrorInfo |
double |
toPoints(double mapDist)
Converts a geographic distance into a distance expressed in points. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef |
---|
getJintegraDispatch, release |
Constructor Detail |
---|
public MapContext() throws IOException, UnknownHostException
IOException
- if there are interop problems
UnknownHostException
- if there are interop problemspublic MapContext(Object obj) throws IOException
MapContext theMapContext = (MapContext) obj;
obj
to MapContext
.
obj
- an object returned from ArcGIS Engine or Server
IOException
- if there are interop problemsMethod Detail |
---|
public static String getClsid()
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public void initFromDisplay(IDisplayTransformation displayTransform) throws IOException, AutomationException
Use this method when you create a reference to a new MapContext object to initialize the mapcontext using a DisplayTransformation that exists. If a reference to a DisplayTransformation does not exist, then use IMapContext::Init method to initialize the map context. It is important to initialize the map context as this will help in getting correct context for displaying and drawing geometric effects and marker placements.
Use the following code snippet to initialize a MapContext using display settings from a map document
Dim pMxDoc As IMxDocument
Dim pMap As IMap
Set pMxDoc = ThisDocument
Set pMap = pMxDoc.FocusMap
'set the MapContext object from current display settings
Dim pMapContext As IMapContext
Dim pMxApp As IMxApplication
Set pMxApp = Application 'QI
Set pMapContext = New MapContext
pMapContext.InitFromDisplay pMxApp.Display.DisplayTransformation
initFromDisplay
in interface IMapContext
displayTransform
- A reference to a com.esri.arcgis.display.IDisplayTransformation (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void init(ISpatialReference mapProj, double mapRefScale, IEnvelope mapExtent) throws IOException, AutomationException
Use this method when you create a reference to a new MapContext object to initialize the mapcontext. If a reference to a DisplayTransformation exists, then use IMapContext::InitFromDisplay method to initialize the map context. It is important to initialize the map context as this will help in getting correct context for displaying and drawing geometric effects and marker placements.
'initialize new mapcontext using a feature class's spatial reference and extent
Dim pMapContext As IMapContext
Dim pGFClass As IGeoDataset
Set pMapContext = New MapContext
Set pGFClass = pFClass
pMapContext.Init pGFClass.SpatialReference, 25000, pGFClass.Extent
Set pRepresentation = pRepClass.GetRepresentation(pFeat, pMapContext)
'where pFeat is reference to a Feature object and pFClass is reference to a FeatureClass object
init
in interface IMapContext
mapProj
- A reference to a com.esri.arcgis.geometry.ISpatialReference (in)mapRefScale
- The mapRefScale (in)mapExtent
- A reference to a com.esri.arcgis.geometry.IEnvelope (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IGeometry fromGeographyToMap(IGeometry ingeom) throws IOException, AutomationException
fromGeographyToMap
in interface IMapContext
ingeom
- A reference to a com.esri.arcgis.geometry.IGeometry (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IGeometry fromMapToGeography(IGeometry ingeom) throws IOException, AutomationException
fromMapToGeography
in interface IMapContext
ingeom
- A reference to a com.esri.arcgis.geometry.IGeometry (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public double getReferenceScale() throws IOException, AutomationException
getReferenceScale
in interface IMapContext
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public ISpatialReference getSpatialReference() throws IOException, AutomationException
getSpatialReference
in interface IMapContext
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public double fromPoints(double ptDist) throws IOException, AutomationException
fromPoints
in interface IMapContext
ptDist
- The ptDist (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public double toPoints(double mapDist) throws IOException, AutomationException
toPoints
in interface IMapContext
mapDist
- The mapDist (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void interfaceSupportsErrorInfo(GUID riid) throws IOException, AutomationException
Indicates whether the interface supports IErrorInfo.
interfaceSupportsErrorInfo
in interface ISupportErrorInfo
riid
- A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |