?? connectionpoolclass.java~2~
字號:
package myfirstmap;
import com.mapinfo.dp.jdbc.oraso.OraSoDataProviderHelper;
import com.mapinfo.dp.jdbc.oraso.OraSoTableDescHelper;
import com.mapinfo.dp.RenditionType;
import com.mapinfo.coordsys.CoordSys;
import com.mapinfo.mapxtreme.client.MapXtremeDataProviderRef;
import com.mapinfo.mapxtreme.client.MapXtremeImageRenderer;
import com.mapinfo.mapj.MapJ;
import com.mapinfo.util.DoublePoint;
import com.mapinfo.util.DoubleRect;
import com.mapinfo.unit.LinearUnit;
import com.mapinfo.xmlprot.mxtj.ImageRequestComposer;
import java.awt.Color;
public class ConnectionPoolClass
{
public ConnectionPoolClass()
{
}
public void studyPool()
{
String[] idColumns={"MI_PRINX"};
OraSoTableDescHelper oraSoTDHelper=new OraSoTableDescHelper("POINT",//tablename
false,idColumns,//unique key column
"GEOLOC",//spatial column
null,//renditionColumn
RenditionType.none ,//rendition type
null,//labelRenditionType
RenditionType.none ,
CoordSys.longLatWGS84 ,//coordinate system
2,//dimension
"USERSTOREMAP2");//owner
OraSoDataProviderHelper oraSoDPHelper=new OraSoDataProviderHelper("jdbc:mipool:ZP_SUCCEED",null,null);
String mapxtremeURL="http://901-32:8083/mapxtreme47/mapxtreme";
try
{
MapXtremeDataProviderRef mxtDPRef = new MapXtremeDataProviderRef(
oraSoDPHelper, mapxtremeURL);
MapJ mapj=new MapJ();
DoublePoint point=new DoublePoint(108.9608,34.2729);
DoubleRect bound=new DoubleRect(point,0.31,0.21);
mapj.setBounds(bound) ;
LinearUnit unit=LinearUnit.kilometer ;
mapj.setDistanceUnits(unit) ;
mapj.setDeviceBounds(new DoubleRect(0,0,800,600)) ;
//
mapj.getLayers() .insertLayer(mxtDPRef,oraSoTDHelper,0,"point");
MapXtremeImageRenderer render=new MapXtremeImageRenderer(mapxtremeURL);
ImageRequestComposer imageRC=ImageRequestComposer.create(mapj,256,Color.white ,"image/png");
render.render(imageRC) ;
render.toFile("E:\\MapInfo\\study\\png\\pool.png") ;
}catch(java.lang.Exception e)
{
System.out.println("get a "+e.getClass() +"\nwith message "+e.getMessage() ) ;
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -