Revision 33562

View differences:

tags/v2_0_0_Build_2011/libraries/libFMap_mapcontext/resources-test/log4j.xml
1
<?xml version="1.0" encoding="UTF-8" ?>
2
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
3

  
4
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
5

  
6
	<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
7
		<layout class="org.apache.log4j.PatternLayout">
8
			<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n  %m%n" />
9
		</layout>
10
	</appender>
11

  
12
	<category name="org.gvsig.tools">
13
		<priority value="DEBUG" />
14
	</category>
15
	<category name="org.gvsig.fmap.mapcontext">
16
		<priority value="DEBUG" /> 
17
	</category>
18

  
19
	<root>
20
		<priority value="INFO" />
21
		<appender-ref ref="CONSOLE" />
22
	</root>
23
</log4j:configuration>
tags/v2_0_0_Build_2011/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/MapContextException.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
*
3
* Copyright (C) 2007-2008 Infrastructures and Transports Department
4
* of the Valencian Government (CIT)
5
* 
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
10
* 
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
* GNU General Public License for more details.
15
* 
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
19
* MA  02110-1301, USA.
20
* 
21
*/
22

  
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2009 {DiSiD Technologies}  {{Task}}
26
*/
27
package org.gvsig.fmap.mapcontext;
28

  
29
import org.gvsig.tools.exception.BaseException;
30

  
31
/**
32
 * Parent class for MapContext exceptions.
33
 * 
34
 * @author <a href="mailto:cordinyana@gvsig.org">C?sar Ordi?ana</a>
35
 */
36
public abstract class MapContextException extends BaseException {
37

  
38
    private static final long serialVersionUID = 8122532768532097211L;
39

  
40
    /**
41
     * @see BaseException#BaseException(String, String, long)
42
     */
43
    protected MapContextException(String message, String key, long code) {
44
        super(message, key, code);
45
    }
46

  
47
    /**
48
     * @see BaseException#BaseException(String, Throwable, String, long)
49
     */
50
    protected MapContextException(String message, Throwable cause, String key,
51
            long code) {
52
        super(message, cause, key, code);
53
    }
54

  
55
    public MapContextException(Throwable cause) {
56
        this(
57
        		"MapContext related error",
58
        		cause,
59
        		"_MapContext_related_error", 
60
        		serialVersionUID
61
        );
62
    }
63
}
tags/v2_0_0_Build_2011/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/exceptions/LegendLayerException.java
1
package org.gvsig.fmap.mapcontext.exceptions;
2

  
3

  
4
/**
5
 * @author Vicente Caballero Navarro
6
 */
7
public class LegendLayerException extends LoadLayerException {
8

  
9
	/**
10
	 * 
11
	 */
12
	private static final long serialVersionUID = -4033030636689365030L;
13

  
14
    protected LegendLayerException(String message, Throwable cause, String key,
15
            long code) {
16
        super(message, cause, key, code);
17
    }
18
    
19
	public LegendLayerException(String layer,Throwable cause) {
20
		super(
21
				"Can?t load the legend for layer %(layer).",
22
				cause,
23
				"Cant_load_the_legend_for_layer_XlayerX",
24
				serialVersionUID
25
		);
26
		setValue("layer", layer);
27
	}
28
	
29
	public LegendLayerException(String layer) {
30
		this(layer,null);
31
	}
32
	
33
}
tags/v2_0_0_Build_2011/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/exceptions/UnsupportedVersionLayerException.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Ib??ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41
package org.gvsig.fmap.mapcontext.exceptions;
42

  
43

  
44

  
45
/**
46
 * Excepci?n provocada por el WMS.
47
 *
48
 * @author Vicente Caballero Navarro
49
 */
50
public class UnsupportedVersionLayerException extends LoadLayerException {
51
	public UnsupportedVersionLayerException(String l,Throwable exception) {
52
		super(l,exception);
53
		init();
54
	}
55
	/**
56
	 *
57
	 */
58
	private void init() {
59
		messageKey = "error_version_layer";
60
		formatString = "Can?t use this version of the layer: %(layer) ";
61
	}
62
}
tags/v2_0_0_Build_2011/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/exceptions/FileLayerException.java
1
package org.gvsig.fmap.mapcontext.exceptions;
2

  
3

  
4

  
5
/**
6
 * @author Vicente Caballero Navarro
7
 */
8
public class FileLayerException extends LoadLayerException {
9

  
10
	public FileLayerException(String l,Throwable exception) {
11
		super(l,exception);
12
		init();
13
	}
14
	/**
15
	 *
16
	 */
17
	private void init() {
18
		messageKey = "error_file_layer";
19
		formatString = "Can?t found the file of the layer: %(layer) ";
20
	}
21
}
tags/v2_0_0_Build_2011/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/exceptions/LoadLayerException.java
1
package org.gvsig.fmap.mapcontext.exceptions;
2

  
3
import org.gvsig.fmap.mapcontext.MapContextException;
4
/**
5
 * @author Vicente Caballero Navarro
6
 */
7
public class LoadLayerException extends MapContextException {
8
	/**
9
	 * 
10
	 */
11
	private static final long serialVersionUID = -7500729722899605739L;
12

  
13
    protected LoadLayerException(String message, Throwable cause, String key,
14
            long code) {
15
        super(message, cause, key, code);
16
    }
17
    
18

  
19
	public LoadLayerException(String layer,Throwable cause) {
20
		super(
21
				"Can?t load the layer %(layer).",
22
				cause,
23
				"Cant_load_the_layer_XlayerX",
24
				serialVersionUID
25
		);
26
		setValue("layer", layer);
27
	}
28

  
29

  
30
	public LoadLayerException(String layer) {
31
		super(
32
				"Can?t load the layer %(layer).",
33
				"Cant_load_the_layer_XlayerX",
34
				serialVersionUID
35
		);
36
		setValue("layer", layer);
37
	}
38
	
39
	
40
}
tags/v2_0_0_Build_2011/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/exceptions/NameLayerException.java
1
package org.gvsig.fmap.mapcontext.exceptions;
2

  
3

  
4
/**
5
 * @author Vicente Caballero Navarro
6
 */
7
public class NameLayerException extends LoadLayerException {
8

  
9
	public NameLayerException(String l,Throwable exception) {
10
		super(l,exception);
11
		init();
12
	}
13
	/**
14
	 *
15
	 */
16
	private void init() {
17
		messageKey = "error_name_layer";
18
		formatString = "Can?t named the layer: %(layer) ";
19
	}
20

  
21
}
tags/v2_0_0_Build_2011/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/exceptions/StopEditionLayerException.java
1
package org.gvsig.fmap.mapcontext.exceptions;
2

  
3
import java.util.Hashtable;
4
import java.util.Map;
5

  
6
import org.gvsig.tools.exception.BaseException;
7
/**
8
 * @author Vicente Caballero Navarro
9
 */
10
public class StopEditionLayerException extends BaseException{
11

  
12
	private String layer;
13
	public StopEditionLayerException(String l,Throwable exception) {
14
		this.layer=l;
15
		init();
16
		initCause(exception);
17
	}
18
	/**
19
	 *
20
	 */
21
	private void init() {
22
		messageKey = "error_stop_editing_layer";
23
		formatString = "Can?t stop editing the layer: %(tag) ";
24
	}
25

  
26

  
27
	protected Map values() {
28
		Hashtable params = new Hashtable();
29
		params.put("layer",layer);
30
		return params;
31
	}
32

  
33
}
tags/v2_0_0_Build_2011/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/exceptions/TypeLayerException.java
1
package org.gvsig.fmap.mapcontext.exceptions;
2

  
3

  
4
/**
5
 * @author Vicente Caballero Navarro
6
 */
7
public class TypeLayerException extends LoadLayerException {
8

  
9
	public TypeLayerException(String l,Throwable exception) {
10
		super(l,exception);
11
		init();
12
	}
13
	/**
14
	 *
15
	 */
16
	private void init() {
17
		messageKey = "error_type_layer";
18
		formatString = "Can?t use type of the layer: %(layer) ";
19
	}
20

  
21
}
tags/v2_0_0_Build_2011/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/exceptions/URLLayerException.java
1
package org.gvsig.fmap.mapcontext.exceptions;
2

  
3

  
4
/**
5
 * @author Vicente Caballero Navarro
6
 */
7
public class URLLayerException extends LoadLayerException {
8

  
9
	public URLLayerException(String l,Throwable exception) {
10
		super(l,exception);
11
		init();
12
	}
13
	/**
14
	 *
15
	 */
16
	private void init() {
17
		messageKey = "error_url_layer";
18
		formatString = "Can?t create the url of the layer: %(layer) ";
19
	}
20

  
21
}
tags/v2_0_0_Build_2011/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/exceptions/ReloadLayerException.java
1
package org.gvsig.fmap.mapcontext.exceptions;
2

  
3

  
4
/**
5
 * @author Vicente Caballero Navarro
6
 */
7
public class ReloadLayerException extends LoadLayerException {
8

  
9
	public ReloadLayerException(String l,Throwable exception) {
10
		super(l,exception);
11
		init();
12
	}
13
	/**
14
	 *
15
	 */
16
	private void init() {
17
		messageKey = "error_reload_layer";
18
		formatString = "Can?t reload the layer: %(layer) ";
19
	}
20

  
21
}
tags/v2_0_0_Build_2011/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/exceptions/CancelEditingLayerException.java
1
package org.gvsig.fmap.mapcontext.exceptions;
2

  
3
import java.util.Hashtable;
4
import java.util.Map;
5

  
6
import org.gvsig.tools.exception.BaseException;
7
/**
8
 * @author Vicente Caballero Navarro
9
 */
10
public class CancelEditingLayerException extends BaseException {
11

  
12
	private String layer = null;
13

  
14
	public CancelEditingLayerException(String layer,Throwable exception) {
15
		this.layer = layer;
16
		init();
17
		initCause(exception);
18
	}
19

  
20
	private void init() {
21
		messageKey = "error_cancel_editing_layer";
22
		formatString = "Can?t cancel editing the layer: %(layer) ";
23
	}
24

  
25
	protected Map values() {
26
		Hashtable params = new Hashtable();
27
		params.put("layer",layer);
28
		return params;
29
	}
30

  
31
}
tags/v2_0_0_Build_2011/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/exceptions/ConnectionErrorLayerException.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Ib??ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41
package org.gvsig.fmap.mapcontext.exceptions;
42

  
43

  
44

  
45
/**
46
 * @author Vicente Caballero Navarro
47
 */
48
public class ConnectionErrorLayerException extends LoadLayerException {
49

  
50
	public ConnectionErrorLayerException(String l,Throwable exception) {
51
		super(l,exception);
52
		init();
53
	}
54
	/**
55
	 *
56
	 */
57
	private void init() {
58
		messageKey = "error_connection_layer";
59
		formatString = "Can?t connet the layer: %(layer) ";
60
	}
61
}
tags/v2_0_0_Build_2011/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/exceptions/StartEditionLayerException.java
1
package org.gvsig.fmap.mapcontext.exceptions;
2

  
3
import java.util.Hashtable;
4
import java.util.Map;
5

  
6
import org.gvsig.tools.exception.BaseException;
7
/**
8
 * @author Vicente Caballero Navarro
9
 */
10
public class StartEditionLayerException extends BaseException {
11
	private String layer;
12
	public StartEditionLayerException(String l,Throwable exception) {
13
		this.layer=l;
14
		init();
15
		initCause(exception);
16
	}
17
	/**
18
	 *
19
	 */
20
	private void init() {
21
		messageKey = "error_start_editing_layer";
22
		formatString = "Can?t start editing the layer: %(tag) ";
23
	}
24

  
25

  
26
	protected Map values() {
27
		Hashtable params = new Hashtable();
28
		params.put("layer",layer);
29
		return params;
30
	}
31

  
32
}
tags/v2_0_0_Build_2011/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/exceptions/DriverLayerException.java
1
package org.gvsig.fmap.mapcontext.exceptions;
2

  
3

  
4
/**
5
 * @author Vicente Caballero Navarro
6
 */
7
public class DriverLayerException extends LoadLayerException {
8

  
9
	public DriverLayerException(String l,Throwable exception) {
10
		super(l,exception);
11
		init();
12
	}
13
	/**
14
	 *
15
	 */
16
	private void init() {
17
		messageKey = "error_driver_layer";
18
		formatString = "Can?t load driver of the layer: %(layer) ";
19
	}
20
}
tags/v2_0_0_Build_2011/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/exceptions/ProjectionLayerException.java
1
package org.gvsig.fmap.mapcontext.exceptions;
2

  
3

  
4
/**
5
 * @author Vicente Caballero Navarro
6
 */
7
public class ProjectionLayerException extends LoadLayerException {
8

  
9
	public ProjectionLayerException(String l,Throwable exception) {
10
		super(l,exception);
11
		init();
12
	}
13
	/**
14
	 *
15
	 */
16
	private void init() {
17
		messageKey = "error_projection_layer";
18
		formatString = "Can?t project the layer: %(layer) ";
19
	}
20

  
21
}
tags/v2_0_0_Build_2011/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/exceptions/ReprojectLayerException.java
1
package org.gvsig.fmap.mapcontext.exceptions;
2

  
3
/**
4
 * @author Vicente Caballero Navarro
5
 */
6
public class ReprojectLayerException extends LoadLayerException {
7

  
8
	public ReprojectLayerException(String l,Throwable exception) {
9
		super(l,exception);
10
		init();
11
	}
12
	/**
13
	 *
14
	 */
15
	private void init() {
16
		messageKey = "error_projection_layer";
17
		formatString = "Can?t reproject the layer: %(layer) ";
18
	}
19

  
20
}
tags/v2_0_0_Build_2011/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/MapContextRuntimeException.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
*
3
* Copyright (C) 2007-2008 Infrastructures and Transports Department
4
* of the Valencian Government (CIT)
5
* 
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
10
* 
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
* GNU General Public License for more details.
15
* 
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
19
* MA  02110-1301, USA.
20
* 
21
*/
22

  
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2009 {DiSiD Technologies}  {{Task}}
26
*/
27
package org.gvsig.fmap.mapcontext;
28

  
29
import org.gvsig.tools.exception.BaseException;
30
import org.gvsig.tools.exception.BaseRuntimeException;
31

  
32
/**
33
 * Parent class for MapContext runtime exceptions.
34
 * 
35
 * @author <a href="mailto:cordinyana@gvsig.org">C?sar Ordi?ana</a>
36
 */
37
public class MapContextRuntimeException extends BaseRuntimeException {
38

  
39
	private static final long serialVersionUID = 3993964182701795153L;
40

  
41
	/**
42
     * @see BaseException#BaseException(String, String, long)
43
     */
44
    protected MapContextRuntimeException(String message, String key, long code) {
45
        super(message, null, key, code);
46
    }
47

  
48
    /**
49
     * @see BaseException#BaseException(String, Throwable, String, long)
50
     */
51
    protected MapContextRuntimeException(String message, Throwable cause, String key,
52
            long code) {
53
        super(message, cause, key, code);
54
    }
55
    
56
    public MapContextRuntimeException(Throwable cause) {
57
        this(
58
        		"MapContext related error",
59
        		cause,
60
        		"_MapContext_related_error", 
61
        		serialVersionUID
62
        );
63
    }
64
}
tags/v2_0_0_Build_2011/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/MapContextLocator.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 * 
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 * 
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 * 
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
19
 * MA  02110-1301, USA.
20
 * 
21
 */
22

  
23
/*
24
 * AUTHORS (In addition to CIT):
25
 * 2009 {DiSiD Technologies}  {{Task}}
26
 */
27
package org.gvsig.fmap.mapcontext;
28

  
29
import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolManager;
30
import org.gvsig.tools.locator.BaseLocator;
31
import org.gvsig.tools.locator.Locator;
32
import org.gvsig.tools.locator.LocatorException;
33

  
34
/**
35
 * Locator for the MapContext library.
36
 * 
37
 * @author <a href="mailto:cordinyana@gvsig.org">C?sar Ordi?ana</a>
38
 */
39
public class MapContextLocator extends BaseLocator {
40

  
41
	public static final String MAPCONTEXT_MANAGER_NAME = "mapcontextlocator.manager";
42

  
43
	private static final String MAPCONTEXT_MANAGER_DESCRIPTION = "MapContext Library manager";
44

  
45
	public static final String SYMBOL_MANAGER_NAME = "symbol.manager";
46

  
47
	private static final String SYMBOL_MANAGER_DESCRIPTION = "Symbols manager";
48

  
49
	private static final MapContextLocator instance = new MapContextLocator();
50

  
51
	/**
52
	 * Private constructor, we don't want it to be able to be instantiated
53
	 * outside this class.
54
	 */
55
	private MapContextLocator() {
56
		// Nothing to do
57
	}
58

  
59
	public static MapContextLocator getInstance() {
60
		return instance;
61
	}
62

  
63
	/**
64
	 * Return a reference to MapContextManager.
65
	 * 
66
	 * @return a reference to MapContextManager
67
	 * @throws LocatorException
68
	 *             if there is no access to the class or the class cannot be
69
	 *             instantiated
70
	 * @see Locator#get(String)
71
	 */
72
	public static MapContextManager getMapContextManager()
73
			throws LocatorException {
74
		return (MapContextManager) getInstance().get(MAPCONTEXT_MANAGER_NAME);
75
	}
76

  
77
	/**
78
	 * Registers the Class implementing the MapContextManager interface.
79
	 * 
80
	 * @param clazz
81
	 *            implementing the MapContextManager interface
82
	 */
83
	public static void registerMapContextManager(Class clazz) {
84
		getInstance().register(MAPCONTEXT_MANAGER_NAME,
85
				MAPCONTEXT_MANAGER_DESCRIPTION, clazz);
86
	}
87

  
88
	/**
89
	 * Return a reference to the {@link SymbolManager}.
90
	 * 
91
	 * @return a reference to the SymbolManager.
92
	 * @throws LocatorException
93
	 *             if there is no access to the class or the class cannot be
94
	 *             instantiated
95
	 * @see Locator#get(String)
96
	 */
97
	public static SymbolManager getSymbolManager() throws LocatorException {
98
		return (SymbolManager) getInstance().get(SYMBOL_MANAGER_NAME);
99
	}
100

  
101
	/**
102
	 * Registers the Class implementing the SymbolManager interface.
103
	 * 
104
	 * @param clazz
105
	 *            implementing the SymbolManager interface
106
	 */
107
	public static void registerSymbolManager(Class clazz) {
108
		getInstance().register(SYMBOL_MANAGER_NAME, SYMBOL_MANAGER_DESCRIPTION,
109
				clazz);
110
	}
111
}
tags/v2_0_0_Build_2011/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/MapContextLibrary.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22

  
23
/*
24
 * AUTHORS (In addition to CIT):
25
 * 2008 IVER T.I. S.A.   {{Task}}
26
 */
27
package org.gvsig.fmap.mapcontext;
28

  
29
import org.gvsig.compat.CompatLibrary;
30
import org.gvsig.fmap.dal.DALLibrary;
31
import org.gvsig.fmap.dal.DataTypes;
32
import org.gvsig.fmap.dal.feature.FeatureStore;
33
import org.gvsig.fmap.mapcontext.impl.DefaultMapContextDrawer;
34
import org.gvsig.fmap.mapcontext.layers.FLayer;
35
import org.gvsig.fmap.mapcontext.layers.FLayerStatus;
36
import org.gvsig.fmap.mapcontext.layers.FLayers;
37
import org.gvsig.fmap.mapcontext.layers.FLyrDefault;
38
import org.gvsig.fmap.mapcontext.layers.LayerFactory;
39
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
40
import org.gvsig.fmap.mapcontext.layers.vectorial.ReprojectDefaultGeometry;
41
import org.gvsig.fmap.mapcontext.tools.persistence.ColorPersistenceFactory;
42
import org.gvsig.fmap.mapcontext.tools.persistence.DimensionPersistenceFactory;
43
import org.gvsig.fmap.mapcontext.tools.persistence.FontPersistenceFactory;
44
import org.gvsig.fmap.mapcontext.tools.persistence.Point2DPersistenceFactory;
45
import org.gvsig.fmap.mapcontext.tools.persistence.Rectangle2DPersistenceFactory;
46
import org.gvsig.metadata.MetadataLocator;
47
import org.gvsig.metadata.MetadataManager;
48
import org.gvsig.metadata.exceptions.MetadataException;
49
import org.gvsig.tools.ToolsLocator;
50
import org.gvsig.tools.dynobject.DynStruct;
51
import org.gvsig.tools.library.AbstractLibrary;
52
import org.gvsig.tools.library.Library;
53
import org.gvsig.tools.library.LibraryException;
54
import org.gvsig.tools.locator.ReferenceNotRegisteredException;
55
import org.gvsig.tools.persistence.PersistenceManager;
56
import org.slf4j.Logger;
57
import org.slf4j.LoggerFactory;
58

  
59
/**
60
 * Library for the MapContext library API.
61
 * @author jmvivo
62
 */
63
public class MapContextLibrary extends AbstractLibrary {
64
	final static private Logger LOG = LoggerFactory.getLogger(FLyrDefault.class);
65

  
66
	public MapContextLibrary() {
67
		super(MapContextLibrary.class, Library.TYPE.API);
68
		require(DALLibrary.class);
69
		require(CompatLibrary.class);
70
	}
71
	
72
	protected void doInitialize() throws LibraryException {
73
		LayerFactory.getInstance().registerLayerToUseForStore(
74
				FeatureStore.class, FLyrVect.class);
75
	}
76

  
77
	protected void doPostInitialize() throws LibraryException {
78
		MetadataManager metadataManager = MetadataLocator.getMetadataManager();
79

  
80
		DynStruct metadataDefinition = metadataManager.getDefinition(FLayer.METADATA_DEFINITION_NAME);
81
		if (metadataDefinition == null) {
82
			try {
83
				metadataDefinition = metadataManager.addDefinition(
84
						FLayer.METADATA_DEFINITION_NAME,
85
						FLayer.METADATA_DEFINITION_DESCRIPTION);
86
				metadataDefinition.addDynField(FLayer.METADATA_NAME)
87
						.setMandatory(true);
88

  
89
				metadataDefinition.addDynFieldObject(FLayer.METADATA_CRS)
90
						.setType(DataTypes.CRS).setMandatory(true);
91
			} catch (MetadataException e) {
92
				LOG.warn("Can't create metadata definition for 'Layer'", e);
93
			}
94
		}
95

  
96
		MapContextManager manager = MapContextLocator.getMapContextManager();
97

  
98
		if (manager == null) {
99
			throw new ReferenceNotRegisteredException(
100
					MapContextLocator.MAPCONTEXT_MANAGER_NAME,
101
					MapContextLocator.getInstance());
102
		}
103

  
104
		try {
105
			manager.setDefaultMapContextDrawer(DefaultMapContextDrawer.class);
106
		} catch (MapContextException ex) {
107
			throw new LibraryException(getClass().getName(), ex);
108
		}
109
		
110
		// persistent classes
111
		MapContext.registerPersistent();
112
		
113
		ViewPort.registerPersistent();
114
		ExtentHistory.registerPersistent();
115
		
116
//		MappingAnnotation.registerPersistent();
117
		ReprojectDefaultGeometry.registerPersistent();
118

  
119
//		FLayerVectorialDB.registerPersistent();
120
//		FLayerFileVectorial.registerPersistent();
121
		
122
		FLayerStatus.registerPersistent();
123
		FLyrDefault.registerPersistent();
124
		FLyrVect.registerPersistent();
125
		FLayers.registerPersistent();
126
				
127
		////////////////////////////////////////
128
		// Register the persistence factories //
129
		////////////////////////////////////////
130
		PersistenceManager persistenceManager =
131
				ToolsLocator.getPersistenceManager();
132
		// Color
133
		persistenceManager.registerFactory(new ColorPersistenceFactory());
134
		// Point2D
135
		persistenceManager.registerFactory(new Point2DPersistenceFactory());
136
		// Font
137
		persistenceManager.registerFactory(new FontPersistenceFactory());
138
		// Rectangle2D
139
		persistenceManager.registerFactory(new Rectangle2DPersistenceFactory());
140
		// awt Dimension
141
		persistenceManager.registerFactory(new DimensionPersistenceFactory());
142
	}
143

  
144
}
0 145

  
tags/v2_0_0_Build_2011/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/Messages.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Ib??ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41
package org.gvsig.fmap.mapcontext;
42

  
43
import java.util.Locale;
44
import java.util.MissingResourceException;
45
import java.util.ResourceBundle;
46

  
47

  
48
/**
49
 * Clase que accede a los recursos para la i18n
50
 */
51
public class Messages {
52
    /** DOCUMENT ME! */
53
    private static final String BUNDLE_NAME = "com.iver.cit.gvsig.fmap.FMap";
54

  
55
    /** DOCUMENT ME! */
56
    private static ResourceBundle RESOURCE_BUNDLE = null;
57

  
58
    /**
59
     * Inicializa la clase con el locale adecuado
60
     *
61
     * @param loc Locale de la aplicaci?n
62
     */
63
    private static void init() {
64
        Locale loc = Locale.getDefault();
65
        RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME, loc);
66
    }
67

  
68
    
69
    /**
70
     * Obtiene el valor del recurso con clave 'key'
71
     *
72
     * @param key clave del recurso que se quiere obtener
73
     *
74
     * @return recurso que se quiere obtener o !key! en caso de no encontrarlo.
75
     *         En dicho caso no se notifica al framework ya que  estos son los
76
     *         mensajes propios de la aplicaci?n y deben de estar todos
77
     */
78
    public static String getString(String key) {
79
        try {
80
            // La primera vez, cargamos las cadenas.
81
            if (RESOURCE_BUNDLE == null)
82
                init();
83
            return RESOURCE_BUNDLE.getString(key);
84
        } catch (MissingResourceException e) {
85
            return '!' + key + '!';
86
        }
87
    }
88
}
tags/v2_0_0_Build_2011/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/MapContextManager.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 * 
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 * 
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 * 
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
19
 * MA  02110-1301, USA.
20
 * 
21
 */
22

  
23
/*
24
 * AUTHORS (In addition to CIT):
25
 * 2009 {DiSiD Technologies}  {Create Manager to register MapContextDrawer implementation}
26
 */
27
package org.gvsig.fmap.mapcontext;
28

  
29
import java.awt.Color;
30
import java.awt.Font;
31

  
32
import org.cresques.cts.IProjection;
33
import org.gvsig.fmap.dal.DataStore;
34
import org.gvsig.fmap.dal.DataStoreParameters;
35
import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException;
36
import org.gvsig.fmap.mapcontext.layers.FLayer;
37
import org.gvsig.fmap.mapcontext.layers.vectorial.GraphicLayer;
38
import org.gvsig.fmap.mapcontext.rendering.legend.ILegend;
39
import org.gvsig.fmap.mapcontext.rendering.legend.IVectorLegend;
40
import org.gvsig.fmap.mapcontext.rendering.legend.driver.ILegendReader;
41
import org.gvsig.fmap.mapcontext.rendering.legend.driver.ILegendWriter;
42
import org.gvsig.fmap.mapcontext.rendering.symbols.IMultiLayerSymbol;
43
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
44
import org.gvsig.fmap.mapcontext.rendering.symbols.IWarningSymbol;
45
import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolManager;
46
import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolPreferences;
47

  
48
/**
49
 * Manager of the MapContext library.
50
 * 
51
 * Holds the default implementation of the {@link MapContextDrawer}.
52
 * 
53
 * @author <a href="mailto:cordinyana@gvsig.org">C?sar Ordi?ana</a>
54
 * @author <a href="mailto:jjdelcerro@gvsig.org">Joaquin Jose del Cerro</a>
55
 */
56
public interface MapContextManager {
57

  
58
	/**
59
	 * Create a new layer from the data parameters passed as parameter.
60
	 * 
61
	 * @param layerName name used in for the new layer. 
62
	 * @param parameters used for create the {@link DataStore} of the new layer
63
	 * 
64
	 * @return the new FLayer
65
	 * 
66
	 * @throws LoadLayerException
67
	 */
68
	public FLayer createLayer(String layerName,
69
			DataStoreParameters parameters) throws LoadLayerException;
70

  
71
	/**
72
	 * Create a layer from a {@link DataStore}.
73
	 * 
74
	 * @param layerName name used in for the new layer. 
75
	 * @param store used for the new layer
76
	 * 
77
	 * @return the new FLayer
78
	 * 
79
	 * @throws LoadLayerException
80
	 */
81
	public FLayer createLayer(String layerName, DataStore store)
82
			throws LoadLayerException;
83

  
84
	/**
85
	 * Create a layer to be used as the {@link GraphicLayer}.
86
	 * 
87
	 * @param projection used in the layer.
88
	 * 
89
	 * @return the new {@link GraphicLayer}.
90
	 */
91
	public GraphicLayer createGraphicsLayer(IProjection projection);
92

  
93
	/**
94
	 * Returns the current {@link SymbolManager}.
95
	 * 
96
	 * @return the {@link SymbolManager}
97
	 */
98
	SymbolManager getSymbolManager();
99

  
100
	/**
101
	 * Sets the class to use as the default implementation for the
102
	 * {@link MapContextDrawer}.
103
	 * 
104
	 * @param drawerClazz
105
	 *            the {@link MapContextDrawer} class to use
106
	 * @throws MapContextException
107
	 *             if there is any error setting the class
108
	 */
109
	public void setDefaultMapContextDrawer(Class drawerClazz)
110
			throws MapContextException;
111

  
112
	public void validateMapContextDrawer(Class drawerClazz) throws MapContextException;
113

  
114
	/**
115
	 * Creates a new instance of the default {@link MapContextDrawer}
116
	 * implementation.
117
	 * 
118
	 * @return the new {@link MapContextDrawer} instance
119
	 * @throws MapContextException
120
	 *             if there is an error creating the new object instance
121
	 */
122
	public MapContextDrawer createDefaultMapContextDrawerInstance()
123
			throws MapContextException;
124

  
125
	/**
126
	 * Creates a new instance of the provided {@link MapContextDrawer}
127
	 * implementation.
128
	 * 
129
	 * @param drawerClazz
130
	 *            the {@link MapContextDrawer} implementation class
131
	 * @return the new {@link MapContextDrawer} instance
132
	 * @throws MapContextException
133
	 *             if there is an error creating the new object instance
134
	 */
135
	public MapContextDrawer createMapContextDrawerInstance(Class drawerClazz)
136
			throws MapContextException;
137

  
138
	
139
	
140
	void registerLegend(String legendName, Class legendClass)
141
			throws MapContextRuntimeException;
142

  
143
	ILegend createLegend(String legendName) throws MapContextRuntimeException;
144

  
145
	void setDefaultVectorLegend(String legendName);
146

  
147
	IVectorLegend createDefaultVectorLegend(int shapeType)
148
			throws MapContextRuntimeException;
149

  
150
	void registerLegendWriter(String legendName, String format,
151
			Class writerClass) throws MapContextRuntimeException;
152

  
153
	void registerLegendReader(String format, Class readerClass)
154
			throws MapContextRuntimeException;
155

  
156
	ILegendWriter createLegendWriter(String legendName, String format)
157
			throws MapContextException;
158

  
159
	ILegendReader createLegendReader(String format)
160
			throws MapContextRuntimeException;
161

  
162
	/**
163
	 * @deprecated to be removed in gvSIG 2.0
164
	 * @see {@link SymbolPreferences}.
165
	 */
166
	int getDefaultCartographicSupportMeasureUnit();
167

  
168
	/**
169
	 * @deprecated to be removed in gvSIG 2.0
170
	 * @see {@link SymbolPreferences}.
171
	 */
172
	void setDefaultCartographicSupportMeasureUnit(
173
			int defaultCartographicSupportMeasureUnit);
174

  
175
	/**
176
	 * @deprecated to be removed in gvSIG 2.0
177
	 * @see {@link SymbolPreferences}.
178
	 */
179
	int getDefaultCartographicSupportReferenceSystem();
180

  
181
	/**
182
	 * @deprecated to be removed in gvSIG 2.0
183
	 * @see {@link SymbolPreferences}.
184
	 */
185
	void setDefaultCartographicSupportReferenceSystem(
186
			int defaultCartographicSupportReferenceSystem);
187

  
188
	/**
189
	 * @deprecated to be removed in gvSIG 2.0
190
	 * @see {@link SymbolPreferences}.
191
	 */
192
	Color getDefaultSymbolColor();
193

  
194
	/**
195
	 * @deprecated to be removed in gvSIG 2.0
196
	 * @see {@link SymbolPreferences}.
197
	 */
198
	void setDefaultSymbolColor(Color defaultSymbolColor);
199

  
200
	/**
201
	 * @deprecated to be removed in gvSIG 2.0
202
	 * @see {@link SymbolPreferences}.
203
	 */
204
	void resetDefaultSymbolColor();
205

  
206
	/**
207
	 * @deprecated to be removed in gvSIG 2.0
208
	 * @see {@link SymbolPreferences}.
209
	 */
210
	Color getDefaultSymbolFillColor();
211

  
212
	/**
213
	 * @deprecated to be removed in gvSIG 2.0
214
	 * @see {@link SymbolPreferences}.
215
	 */
216
	void setDefaultSymbolFillColor(Color defaultSymbolFillColor);
217

  
218
	/**
219
	 * @deprecated to be removed in gvSIG 2.0
220
	 * @see {@link SymbolPreferences}.
221
	 */
222
	void resetDefaultSymbolFillColor();
223

  
224
	/**
225
	 * @deprecated to be removed in gvSIG 2.0
226
	 * @see {@link SymbolPreferences}.
227
	 */
228
	boolean isDefaultSymbolFillColorAleatory();
229

  
230
	/**
231
	 * @deprecated to be removed in gvSIG 2.0
232
	 * @see {@link SymbolPreferences}.
233
	 */
234
	void setDefaultSymbolFillColorAleatory(
235
			boolean defaultSymbolFillColorAleatory);
236

  
237
	/**
238
	 * @deprecated to be removed in gvSIG 2.0
239
	 * @see {@link SymbolPreferences}.
240
	 */
241
	void resetDefaultSymbolFillColorAleatory();
242

  
243
	/**
244
	 * @deprecated to be removed in gvSIG 2.0
245
	 * @see {@link SymbolPreferences}.
246
	 */
247
	Font getDefaultSymbolFont();
248

  
249
	/**
250
	 * @deprecated to be removed in gvSIG 2.0
251
	 * @see {@link SymbolPreferences}.
252
	 */
253
	void setDefaultSymbolFont(Font defaultSymbolFont);
254

  
255
	/**
256
	 * @deprecated to be removed in gvSIG 2.0
257
	 * @see {@link SymbolPreferences}.
258
	 */
259
	void resetDefaultSymbolFont();
260

  
261
	/**
262
	 * @deprecated to be removed in gvSIG 2.0
263
	 * @see {@link SymbolPreferences}.
264
	 */
265
	String getSymbolLibraryPath();
266

  
267
	/**
268
	 * @deprecated to be removed in gvSIG 2.0
269
	 * @see {@link SymbolPreferences}.
270
	 */
271
	void setSymbolLibraryPath(String symbolLibraryPath);
272

  
273
	/**
274
	 * @deprecated to be removed in gvSIG 2.0
275
	 * @see {@link SymbolPreferences}.
276
	 */
277
	void resetSymbolLibraryPath();
278
	
279
	
280
	/**
281
	 * @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
282
	 */
283
	ISymbol createSymbol(String symbolName) throws MapContextRuntimeException;
284

  
285
	/**
286
	 * @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
287
	 */
288
	ISymbol createSymbol(int shapeType) throws MapContextRuntimeException;
289

  
290
	/**
291
	 * @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
292
	 */
293
	ISymbol createSymbol(String symbolName, Color color)
294
			throws MapContextRuntimeException;
295

  
296
	/**
297
	 * @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
298
	 */
299
	ISymbol createSymbol(int shapeType, Color color)
300
			throws MapContextRuntimeException;
301

  
302
	/**
303
	 * @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
304
	 */
305
	IMultiLayerSymbol createMultiLayerSymbol(String symbolName)
306
			throws MapContextRuntimeException;
307

  
308
	/**
309
	 * @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
310
	 */
311
	IMultiLayerSymbol createMultiLayerSymbol(int shapeType)
312
			throws MapContextRuntimeException;
313

  
314
	/**
315
	 * @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
316
	 */
317
	void registerSymbol(String symbolName, Class symbolClass)
318
			throws MapContextRuntimeException;
319

  
320
	/**
321
	 * @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
322
	 */
323
	void registerSymbol(String symbolName, int[] shapeTypes, Class symbolClass)
324
			throws MapContextException;
325

  
326
	/**
327
	 * @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
328
	 */
329
	void registerMultiLayerSymbol(String symbolName, Class symbolClass)
330
			throws MapContextRuntimeException;
331

  
332
	/**
333
	 * @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
334
	 */
335
	void registerMultiLayerSymbol(String symbolName, int[] shapeTypes,
336
			Class symbolClass) throws MapContextRuntimeException;
337

  
338
	/**
339
	 * @deprecated to be removed in gvSIG 2.0 @see {@link SymbolManager}
340
	 */
341
	IWarningSymbol getWarningSymbol(String message, String symbolDesc,
342
			int symbolDrawExceptionType) throws MapContextRuntimeException;
343
	
344
	/**
345
	 * It returns the legend associated with a {@link DataStore}.
346
	 * If the legend doesn't exist it returns <code>null</code>.
347
	 * @param dataStore
348
	 * the store that could have a legend.
349
	 * @return
350
	 * the legend or <code>null</code>.
351
	 */
352
	ILegend getLegend(DataStore dataStore);	
353
}
tags/v2_0_0_Build_2011/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/SelectedZoomVisitor.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Ib??ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41
package org.gvsig.fmap.mapcontext;
42

  
43
import org.gvsig.fmap.dal.DataSet;
44
import org.gvsig.fmap.dal.feature.Feature;
45
import org.gvsig.fmap.dal.feature.FeatureReference;
46
import org.gvsig.fmap.geom.primitive.Envelope;
47
import org.gvsig.fmap.mapcontext.layers.FLayer;
48
import org.gvsig.fmap.mapcontext.layers.operations.LayersVisitor;
49
import org.gvsig.fmap.mapcontext.layers.operations.SingleLayer;
50
import org.gvsig.tools.exception.BaseException;
51
import org.gvsig.tools.visitor.NotSupportedOperationException;
52
import org.gvsig.tools.visitor.Visitable;
53
import org.gvsig.tools.visitor.Visitor;
54

  
55

  
56
/**
57
 * Visitor de zoom a lo seleccionado.
58
 *
59
 * @author Vicente Caballero Navarro
60
 */
61
public class SelectedZoomVisitor implements LayersVisitor, Visitor {
62
	private Envelope rectangle = null;
63

  
64
	/**
65
	 * Devuelve el Extent de los shapes seleccionados, y si no hay ning?n shape
66
	 * seleccionado devuelve null.
67
	 *
68
	 * @return Extent de los shapes seleccionados.
69
	 */
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff