does it help you too look into this class:

com.vividsolutions.jump.workbench.datasource.AbstractLoadDatasetPlugIn

I think it is not used anymore...

stefan

Hernan Arellano wrote:
> Hi all!  i'm working on a project, with OpenJump 1.3.1, that it needs to 
> load a set of ESRI Shapefiles from a path to any category of the map.
> 
> I`ve seen the following code to load a shapefile, of the method "open" 
> from DataSourceFileLayerLoader class. The problem is that this uses a 
> monitor of a dialog that i haven´t, and i tried use this code but i 
> couldn`t make the dataset.
> 
> **************
> Connection connection = dataSourceQuery.getDataSource().getConnection();
>     try {
>       FeatureCollection dataset = 
> dataSourceQuery.getDataSource().installCoordinateSystem(
>           connection.executeQuery(dataSourceQuery.getQuery(), 
> exceptions, monitor),
>           
> CoordinateSystemRegistry.instance(workbenchContext.getBlackboard()));
>       if (dataset != null) {
>         LayerManager layerManager = workbenchContext.getLayerManager();
>         Layer layer = new Layer(layerName,
>           layerManager.generateLayerFillColor(), dataset, layerManager);
>         Category category = 
> TaskUtil.getSelectedCategoryName(workbenchContext);
>         layerManager.addLayerable(category.getName(), layer);
>         layer.setName(layerName);
>         layer.setDataSourceQuery(dataSourceQuery);
> *****************
> 
> ¿ How can i load a shapefile by code in a simple way without an 
> OpenFileWizard ? .
> 
> Thanks in advance!
> 
> ------------------------------------------------------------------------
> 
> 
> ------------------------------------------------------------------------
> 
> ------------------------------------------------------------------------------
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

------------------------------------------------------------------------------

_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to