Revision 9524
branches/piloto3d/libraries/libFMap/build.xml | ||
---|---|---|
1 | 1 |
<project name="FMap" default="generar-todos" basedir="."> |
2 | 2 |
<description> |
3 |
Instala el plugin.
|
|
3 |
Instala el plugin |
|
4 | 4 |
</description> |
5 | 5 |
<!-- set global properties for this build --> |
6 | 6 |
<property name="src" location="src"/> |
7 | 7 |
<property name="build" location="bin"/> |
8 |
<property name="src-test" location="src-test"/> |
|
9 |
<property name="build-test" location="bin-test"/> |
|
8 | 10 |
<property name="lib" location="lib"/> |
9 |
<property name="andamiLibs" location="../_fwAndami/lib"/> |
|
10 | 11 |
<property name="drivers-dir" location="../_fwAndami/gvSIG/extensiones/com.iver.cit.gvsig/drivers" /> |
11 | 12 |
<property name="writers-dir" location="../_fwAndami/gvSIG/extensiones/com.iver.cit.gvsig/drivers" /> |
12 | 13 |
<property name="build-doc" value="build-doc"/> |
13 |
<property name="compile-classpath" value="${lib}/batik-awt-util.jar:${andamiLibs}/castor-0.9.5.3-xml.jar:${lib}/cms.jar:${lib}/driver-manager-1.1.jar:${lib}/geoapi-2.0.jar:${lib}/gt2sidx.jar:${andamiLibs}/iver-utiles.jar:${lib}/units-0.01.jar:${lib}/gt2-main.jar:${lib}/gt2-postgis.jar:${lib}/gt2-wfs.jar:${lib}/gt2-legacy.jar:${lib}/gt2-wms.jar:${lib}/hsqldb.jar:${lib}/jts-1.7.jar:${lib}/jecw.jar:${lib}/gdbms-0.8-SNAPSHOT.jar:${andamiLibs}/log4j-1.2.8.jar:${lib}/wmsclient.jar:${lib}/mysql-connector-java-3.1.7-bin.jar:${lib}/postgis-jdbc-driver.jar:${lib}/postgresql-74.213.jar:${lib}/spatialindex.jar:${lib}/vecmath-1.3.jar" /> |
|
14 | 14 |
<property name="jarName" value="fmap.jar"/> |
15 |
<import file="compile-classpath.xml"/> |
|
15 | 16 |
|
16 | 17 |
<target name="init"> |
17 | 18 |
<!-- Create the time stamp --> |
18 | 19 |
<tstamp /> |
20 |
<echo> |
|
21 |
Compiling ${ant.project.name}...</echo> |
|
19 | 22 |
</target> |
20 | 23 |
|
21 | 24 |
<target name="build-doc" depends="" description="Genera la documentación"> |
... | ... | |
96 | 99 |
|
97 | 100 |
<target name="batch-build" |
98 | 101 |
description="compile the sources, create the jar file" |
99 |
depends="compile,create-jar,copy-data-files,generar-todos"> |
|
102 |
depends="init,compile,create-jar,copy-data-files,generar-todos">
|
|
100 | 103 |
</target> |
101 | 104 |
|
102 | 105 |
<target name="compile" description="compile the source" > |
... | ... | |
108 | 111 |
target="1.4" |
109 | 112 |
debug="${debug}" |
110 | 113 |
debuglevel="${debuglevel}" |
111 |
classpath="${compile-classpath}"/> |
|
114 |
excludes="com/iver/cit/gvsig/fmap/spatialindex/*Test*.java"> |
|
115 |
<classpath refid="libFMap.compile-classpath"/> |
|
116 |
</javac> |
|
112 | 117 |
</target> |
113 |
|
|
118 |
|
|
119 |
<target name="compile-test" description="compile the source of test" depends="compile"> |
|
120 |
<!-- Compile the Java code from ${src-test} to ${build-test} --> |
|
121 |
<mkdir dir="${build-test}" /> |
|
122 |
<javac srcdir="${src-test}" |
|
123 |
destdir="${build-test}" |
|
124 |
source="1.4" |
|
125 |
target="1.4" |
|
126 |
debug="${debug}" |
|
127 |
debuglevel="${debuglevel}"> |
|
128 |
<classpath refid="libFMap.compile-classpath"/> |
|
129 |
</javac> |
|
130 |
</target> |
|
114 | 131 |
<target name="create-jar" |
115 | 132 |
description="Creates the plugin jar"> |
116 | 133 |
<jar jarfile="${lib}/${jarName}" basedir="${build}"/> |
... | ... | |
131 | 148 |
</delete> |
132 | 149 |
</target> |
133 | 150 |
|
134 |
</project> |
|
151 |
<target name="test" description="Run the test suite" depends="compile-test,generar-todos"> |
|
152 |
<junit |
|
153 |
fork="yes" |
|
154 |
printsummary="yes" |
|
155 |
haltonfailure="yes" |
|
156 |
> |
|
157 |
<formatter type="plain" usefile="no"/> |
|
158 |
<classpath refid="libFMap.compile-classpath"/> |
|
159 |
<classpath> |
|
160 |
<pathelement location="${build}"/> |
|
161 |
<pathelement location="${build-test}"/> |
|
162 |
</classpath> |
|
163 |
<test name="com.iver.cit.gvsig.fmap.AllTests"/> |
|
164 |
</junit> |
|
165 |
</target> |
|
166 |
|
|
167 |
|
|
168 |
</project> |
branches/piloto3d/libraries/libFMap/.classpath | ||
---|---|---|
26 | 26 |
<classpathentry kind="lib" path="lib/gt2-wfs.jar"/> |
27 | 27 |
<classpathentry kind="lib" path="lib/gt2-gml.jar"/> |
28 | 28 |
<classpathentry kind="lib" path="lib/remote-clients.jar"/> |
29 |
<classpathentry output="bin-test" kind="src" path="src-test"/> |
|
29 | 30 |
<classpathentry kind="output" path="bin"/> |
30 | 31 |
</classpath> |
branches/piloto3d/libraries/libFMap/src/com/iver/cit/gvsig/fmap/ViewPort.java | ||
---|---|---|
97 | 97 |
private double dist3pixel; |
98 | 98 |
private double scale; |
99 | 99 |
private Rectangle2D cliprect; |
100 |
private boolean adjustableExtent=true; |
|
100 | 101 |
|
101 | 102 |
/** |
102 | 103 |
* Crea un nuevo ViewPort. |
... | ... | |
109 | 110 |
} |
110 | 111 |
|
111 | 112 |
/** |
113 |
* Sets the adjustable option, so the extent is automatically adjusted to view aspect. |
|
114 |
* |
|
115 |
* @param boolean Adjustable. |
|
116 |
*/ |
|
117 |
public void setAdjustable(boolean adjustable) { |
|
118 |
adjustableExtent = adjustable; |
|
119 |
} |
|
120 |
|
|
121 |
/** |
|
112 | 122 |
* A?ade un ViewPortListener al extentListener. |
113 | 123 |
* |
114 | 124 |
* @param arg0 ViewPortListener. |
... | ... | |
116 | 126 |
* @return True si ha sido a?adida correctamente. |
117 | 127 |
*/ |
118 | 128 |
public boolean addViewPortListener(ViewPortListener arg0) { |
119 |
return listeners.add(arg0); |
|
129 |
if (!listeners.contains(arg0)) |
|
130 |
return listeners.add(arg0); |
|
131 |
return false; |
|
120 | 132 |
} |
121 | 133 |
|
134 |
|
|
122 | 135 |
/** |
123 | 136 |
* Borra el ViewPortListener que se pasa como par?metro delos |
124 | 137 |
* extentListener. |
... | ... | |
443 | 456 |
|
444 | 457 |
adjustedExtent = new Rectangle2D.Double(); |
445 | 458 |
|
446 |
if (escalaX < escalaY) { |
|
459 |
if (adjustableExtent) { |
|
460 |
if (escalaX < escalaY) { |
|
461 |
scale = escalaX; |
|
462 |
newHeight = imageSize.getHeight() / scale; |
|
463 |
adjustedExtent.setRect(xCenter - (extent.getWidth() / 2.0), |
|
464 |
yCenter - (newHeight / 2.0), extent.getWidth(), newHeight); |
|
465 |
} else { |
|
466 |
scale = escalaY; |
|
467 |
newWidth = imageSize.getWidth() / scale; |
|
468 |
adjustedExtent.setRect(xCenter - (newWidth / 2.0), |
|
469 |
yCenter - (extent.getHeight() / 2.0), newWidth, |
|
470 |
extent.getHeight()); |
|
471 |
} |
|
472 |
escalado.setToScale(scale, -scale); |
|
473 |
} |
|
474 |
else { // adjusted is same as extent |
|
447 | 475 |
scale = escalaX; |
448 |
newHeight = imageSize.getHeight() / scale; |
|
449 |
adjustedExtent.setRect(xCenter - (extent.getWidth() / 2.0), |
|
450 |
yCenter - (newHeight / 2.0), extent.getWidth(), newHeight); |
|
451 |
} else { |
|
452 |
scale = escalaY; |
|
453 |
newWidth = imageSize.getWidth() / scale; |
|
454 |
adjustedExtent.setRect(xCenter - (newWidth / 2.0), |
|
455 |
yCenter - (extent.getHeight() / 2.0), newWidth, |
|
456 |
extent.getHeight()); |
|
476 |
adjustedExtent.setFrame(extent); |
|
477 |
escalado.setToScale(escalaX, -escalaY); |
|
457 | 478 |
} |
458 | 479 |
|
459 | 480 |
translacion.setToTranslation(-getAdjustedExtent().getX(), |
460 | 481 |
-getAdjustedExtent().getY() - getAdjustedExtent().getHeight()); |
461 |
escalado.setToScale(scale, -scale); |
|
462 | 482 |
|
463 | 483 |
AffineTransform offsetTrans = new AffineTransform(); |
464 | 484 |
offsetTrans.setToTranslation(offset.getX(), offset.getY()); |
... | ... | |
540 | 560 |
} |
541 | 561 |
|
542 | 562 |
/** |
543 |
* Devuelve la unidad de medida. |
|
563 |
* Devuelve la unidad de medida en la que queremos realizar nuestras mediciones y |
|
564 |
* en la que se nos mostrar? toda la informaci?n. |
|
544 | 565 |
* |
545 | 566 |
* @return Returns the distanceUnits. |
546 | 567 |
*/ |
... | ... | |
549 | 570 |
} |
550 | 571 |
|
551 | 572 |
/** |
552 |
* Inserta la unidad de medida. |
|
573 |
* Inserta la unidad de medida en la que queremos realizar nuestras mediciones y |
|
574 |
* en la que se nos mostrar? toda la informaci?n. |
|
553 | 575 |
* |
554 | 576 |
* @param distanceUnits The distanceUnits to set. |
555 | 577 |
*/ |
... | ... | |
558 | 580 |
} |
559 | 581 |
|
560 | 582 |
/** |
561 |
* Devuelve la unidad de medida del mapa. |
|
583 |
* Devuelve la unidad de medida del mapa, es la unidad de medida en la que est? la cartogr?fia que cargamos, |
|
584 |
* normalmente en metros. |
|
562 | 585 |
* |
563 | 586 |
* @return Returns the mapUnits. |
564 | 587 |
*/ |
... | ... | |
567 | 590 |
} |
568 | 591 |
|
569 | 592 |
/** |
570 |
* Inserta la unidad de medida del mapa. |
|
593 |
* Inserta la unidad de medida del mapa, es la unidad de medida en la que est? la cartogr?fia que cargamos, |
|
594 |
* normalmente en metros. |
|
571 | 595 |
* |
572 | 596 |
* @param mapUnits The mapUnits to set. |
573 | 597 |
*/ |
... | ... | |
804 | 828 |
if (xml.contains("backColor")) { |
805 | 829 |
vp.setBackColor(StringUtilities.string2Color(xml.getStringProperty( |
806 | 830 |
"backColor"))); |
831 |
}else { |
|
832 |
vp.setBackColor(Color.white); |
|
807 | 833 |
} |
808 | 834 |
|
809 | 835 |
if (xml.contains("clipX")) { |
branches/piloto3d/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/FLayerStatus.java | ||
---|---|---|
45 | 45 |
* |
46 | 46 |
* $Id$ |
47 | 47 |
* $Log$ |
48 |
* Revision 1.1 2006-09-21 17:23:39 azabala |
|
48 |
* Revision 1.1.4.1 2007-01-03 15:12:33 sbayarri |
|
49 |
* v10 synch & 3D |
|
50 |
* |
|
51 |
* Revision 1.1.2.1 2006/11/15 04:11:12 jjdelcerro |
|
52 |
* *** empty log message *** |
|
53 |
* |
|
54 |
* Revision 1.1 2006/09/21 17:23:39 azabala |
|
49 | 55 |
* First version in cvs |
50 | 56 |
* |
51 | 57 |
* |
branches/piloto3d/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/SingleLayerIterator.java | ||
---|---|---|
45 | 45 |
/** |
46 | 46 |
* @author fjp |
47 | 47 |
* |
48 |
* Class to iterate for all layers in FLayers, but assuring not FLayers is returned. |
|
48 |
* Class to iterate for all layers in FLayers, but assuring not FLayers is returned. |
|
49 |
* The layer you receive in next method is a "leaf" layer, not grouped. |
|
49 | 50 |
*/ |
50 | 51 |
public class SingleLayerIterator { |
51 | 52 |
|
... | ... | |
54 | 55 |
int subIndex = 0; |
55 | 56 |
public SingleLayerIterator(FLayers layers) |
56 | 57 |
{ |
57 |
for (int i=0; i < layers.getLayersCount(); i++) |
|
58 |
{ |
|
59 |
addSubLayer(layers.getLayer(i)); |
|
60 |
} |
|
58 |
addSubLayer(layers); |
|
61 | 59 |
|
62 | 60 |
} |
63 | 61 |
|
... | ... | |
70 | 68 |
i++; |
71 | 69 |
return aux; |
72 | 70 |
} |
73 |
|
|
71 |
|
|
74 | 72 |
private void addSubLayer(FLayer lyr) { |
73 |
FLayers layers; |
|
75 | 74 |
if (lyr instanceof FLayers) |
76 | 75 |
{ |
77 |
addSubLayer(lyr); |
|
76 |
layers = (FLayers)lyr; |
|
77 |
for (int i=0; i < layers.getLayersCount(); i++) |
|
78 |
{ |
|
79 |
addSubLayer(layers.getLayer(i)); |
|
80 |
} |
|
78 | 81 |
} |
79 | 82 |
else |
80 | 83 |
{ |
branches/piloto3d/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/FLyrRaster.java | ||
---|---|---|
54 | 54 |
import java.lang.reflect.InvocationTargetException; |
55 | 55 |
import java.util.ArrayList; |
56 | 56 |
|
57 |
import javax.print.attribute.PrintRequestAttributeSet; |
|
57 | 58 |
import javax.swing.ImageIcon; |
58 | 59 |
|
59 | 60 |
import org.cresques.cts.IProjection; |
60 | 61 |
import org.cresques.filter.RasterFilterStack; |
61 |
import org.cresques.filter.RasterStats; |
|
62 |
import org.cresques.io.data.Grid; |
|
63 |
import org.cresques.io.datastruct.Statistic; |
|
62 | 64 |
import org.cresques.px.Extent; |
63 | 65 |
|
64 | 66 |
import com.hardcode.driverManager.Driver; |
... | ... | |
68 | 70 |
import com.iver.cit.gvsig.fmap.ViewPort; |
69 | 71 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
70 | 72 |
import com.iver.cit.gvsig.fmap.drivers.GeorreferencedRasterDriver; |
73 |
import com.iver.cit.gvsig.fmap.drivers.RasterDriver; |
|
71 | 74 |
import com.iver.cit.gvsig.fmap.layers.layerOperations.StringXMLItem; |
72 | 75 |
import com.iver.cit.gvsig.fmap.layers.layerOperations.XMLItem; |
76 |
import com.iver.cit.gvsig.fmap.rendering.VectorialLegend; |
|
77 |
import com.iver.utiles.DoubleUtilities; |
|
73 | 78 |
import com.iver.utiles.XMLEntity; |
74 | 79 |
import com.iver.utiles.swing.threads.Cancellable; |
75 | 80 |
|
... | ... | |
384 | 389 |
return data; |
385 | 390 |
} |
386 | 391 |
|
387 |
public XMLItem[] getInfo(Point p, double tolerance) throws DriverException { |
|
392 |
public XMLItem[] getInfo(Point p, double tolerance, Cancellable cancel) throws DriverException {
|
|
388 | 393 |
|
389 | 394 |
Point2D pReal = getMapContext().getViewPort().toMapPoint(p); |
390 | 395 |
Point2D px = null; |
... | ... | |
401 | 406 |
if(a[0].toString().equals("Height")) |
402 | 407 |
h = ((Integer)a[1]).intValue(); |
403 | 408 |
} |
404 |
px = new Point(); |
|
409 |
px = new Point2D.Double();
|
|
405 | 410 |
px.setLocation( ((pReal.getX() - this.getMinX()) * w) / getWidth(), |
406 | 411 |
((this.getMaxY() - pReal.getY()) * h) / getHeight()); |
407 | 412 |
} |
408 | 413 |
|
409 | 414 |
int[] rgb = this.getPixel(pReal.getX(), pReal.getY()); |
410 |
|
|
415 |
|
|
411 | 416 |
StringXMLItem[] item = new StringXMLItem[1]; |
412 | 417 |
String data = "<file:"+normalizeAsXMLTag(getName())+">\n"; |
413 |
|
|
418 |
|
|
414 | 419 |
data += " <raster\n"; |
415 | 420 |
data += " View_Point=\""+p.getX()+" , "+p.getY()+"\"\n"; |
416 |
data += " World_Point=\""+pReal.getX()+" , "+pReal.getY()+"\"\n";
|
|
421 |
data += " World_Point=\""+DoubleUtilities.format(pReal.getX(), 5)+" , "+DoubleUtilities.format(pReal.getY(), 5)+"\"\n";
|
|
417 | 422 |
if(px == null) |
418 | 423 |
data += " Pixel_Point=\"Out\"\n"; |
419 |
else |
|
420 |
data += " Pixel_Point=\""+px.getX()+" , "+px.getY()+"\"\n"; |
|
421 |
data += " RGB=\""+rgb[1]+", "+rgb[2]+", "+rgb[3]+"\"\n"; |
|
424 |
else{ |
|
425 |
data += " Pixel_Point=\""+(int)px.getX()+" , "+(int)px.getY()+"\"\n"; |
|
426 |
data += " Band_Value=\""; |
|
427 |
|
|
428 |
for(int i = 0; i < this.getSource().getNumBands(); i++){ |
|
429 |
Object pxData = ((RasterDriver)this.getSource().getDriver()).getData((int)px.getX(), (int)px.getY(), i); |
|
430 |
if(pxData != null){ |
|
431 |
if(this.getSource().getDataType() >= 0 && this.getSource().getDataType() <= 3) |
|
432 |
data += ((Integer)pxData).intValue()+" "; |
|
433 |
|
|
434 |
if(this.getSource().getDataType() >= 4) |
|
435 |
data += ((Float)pxData).floatValue()+" "; |
|
436 |
|
|
437 |
if(this.getSource().getDataType() >= 5) |
|
438 |
data += ((Double)pxData).doubleValue()+" "; |
|
439 |
} |
|
440 |
} |
|
441 |
data += "\"\n"; |
|
442 |
} |
|
443 |
|
|
444 |
data += " RGB=\""+rgb[1]+" "+rgb[2]+" "+rgb[3]+"\"\n"; |
|
445 |
|
|
422 | 446 |
data += " />\n"; |
423 |
|
|
424 | 447 |
data += "</file:"+normalizeAsXMLTag(getName())+">\n"; |
425 | 448 |
|
426 | 449 |
item[0] = new StringXMLItem(data, this); |
... | ... | |
542 | 565 |
/* (non-Javadoc) |
543 | 566 |
* @see com.iver.cit.gvsig.fmap.layers.FLayer#print(java.awt.Graphics2D, com.iver.cit.gvsig.fmap.ViewPort, com.iver.cit.gvsig.fmap.operations.Cancellable) |
544 | 567 |
*/ |
545 |
public void print(Graphics2D g, ViewPort viewPort, Cancellable cancel,double scale)
|
|
568 |
public void print(Graphics2D g, ViewPort viewPort, Cancellable cancel, double scale, PrintRequestAttributeSet propeties)
|
|
546 | 569 |
throws DriverException { |
547 | 570 |
|
548 | 571 |
if (isVisible() && isWithinScale(scale)){ |
... | ... | |
560 | 583 |
//Si es la primera lectura salvamos los valores de m?ximo y m?nimo para la aplicaci?n |
561 | 584 |
//de realce si la imagen es de 16 bits. |
562 | 585 |
|
563 |
RasterStats stats = getSource().getFilterStack().getStats();
|
|
586 |
Statistic stats = getSource().getFilterStack().getStats();
|
|
564 | 587 |
if(stats != null) |
565 | 588 |
stats.history.add(stats.new History(getName(), stats.minBandValue, stats.maxBandValue, stats.secondMinBandValue, stats.secondMaxBandValue)); |
566 | 589 |
|
... | ... | |
760 | 783 |
public boolean isGeoreferenced() { |
761 | 784 |
return getSource().isGeoreferenced(); |
762 | 785 |
} |
786 |
|
|
787 |
/** |
|
788 |
* Obtiene el grid asociado |
|
789 |
* @return grid |
|
790 |
*/ |
|
791 |
public Grid getGrid(){ |
|
792 |
return getSource().getGrid(); |
|
793 |
} |
|
794 |
|
|
795 |
/** |
|
796 |
* Obtiene el tipo de dato de la capa raster |
|
797 |
* @return Entero que representa el tipo de dato de la capa raster. |
|
798 |
*/ |
|
799 |
public int getDataType() { |
|
800 |
return getSource().getDataType(); |
|
801 |
} |
|
802 |
|
|
803 |
/* |
|
804 |
* (non-Javadoc) |
|
805 |
* @see com.iver.cit.gvsig.fmap.layers.FLayer#cloneLayer() |
|
806 |
*/ |
|
807 |
public FLayer cloneLayer() throws Exception { |
|
808 |
FLyrRaster clonedLayer = new FLyrRaster(); |
|
809 |
|
|
810 |
File f = new File(getSource().getFiles()[0].getName()); |
|
811 |
RasterAdapter adapter = new RasterFileAdapter(f); |
|
812 |
com.hardcode.driverManager.Driver driver = LayerFactory.getDM().getDriver("gvSIG Image Driver"); |
|
813 |
adapter.setDriver(driver); |
|
814 |
|
|
815 |
clonedLayer.setName(getName()); |
|
816 |
clonedLayer.setVisible(isVisible()); |
|
817 |
clonedLayer.setSource(adapter); |
|
818 |
clonedLayer.setProjection(getProjection()); |
|
819 |
|
|
820 |
clonedLayer.setXMLEntity(getXMLEntity()); |
|
821 |
|
|
822 |
clonedLayer.load(); |
|
823 |
|
|
824 |
return clonedLayer; |
|
825 |
} |
|
763 | 826 |
} |
branches/piloto3d/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/LayerCollectionListener.java | ||
---|---|---|
107 | 107 |
* mensaje de la excepci?n es el que se mostrar? al usuario en su |
108 | 108 |
* caso |
109 | 109 |
*/ |
110 |
void activationChanged(LayerCollectionEvent e) throws CancelationException; |
|
110 |
// useless. Please, use LayerListener interface instead |
|
111 |
// void activationChanged(LayerCollectionEvent e) throws CancelationException; |
|
111 | 112 |
|
112 | 113 |
/** |
113 | 114 |
* Invocado cuando se visualiza/oculta una capa |
branches/piloto3d/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/IFLayerStatus.java | ||
---|---|---|
45 | 45 |
* |
46 | 46 |
* $Id$ |
47 | 47 |
* $Log$ |
48 |
* Revision 1.1 2006-09-21 17:23:39 azabala |
|
48 |
* Revision 1.1.4.1 2007-01-03 15:12:33 sbayarri |
|
49 |
* v10 synch & 3D |
|
50 |
* |
|
51 |
* Revision 1.1.2.1 2006/11/15 04:11:12 jjdelcerro |
|
52 |
* *** empty log message *** |
|
53 |
* |
|
54 |
* Revision 1.1 2006/09/21 17:23:39 azabala |
|
49 | 55 |
* First version in cvs |
50 | 56 |
* |
51 | 57 |
* |
branches/piloto3d/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/RasterAdapter.java | ||
---|---|---|
53 | 53 |
import org.cresques.cts.ICoordTrans; |
54 | 54 |
import org.cresques.filter.RasterFilterStack; |
55 | 55 |
import org.cresques.io.GeoRasterFile; |
56 |
import org.cresques.io.data.Grid; |
|
56 | 57 |
|
57 | 58 |
import com.hardcode.driverManager.Driver; |
58 | 59 |
import com.iver.cit.gvsig.fmap.ViewPort; |
60 |
import com.iver.cit.gvsig.fmap.core.ISymbol; |
|
59 | 61 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
62 |
import com.iver.cit.gvsig.fmap.drivers.GeorreferencedRasterDriver; |
|
60 | 63 |
import com.iver.cit.gvsig.fmap.drivers.RasterDriver; |
61 | 64 |
import com.iver.utiles.swing.threads.Cancellable; |
62 | 65 |
|
... | ... | |
111 | 114 |
} |
112 | 115 |
|
113 | 116 |
/** |
114 |
* @see com.iver.cit.gvsig.fmap.layers.LayerOperations#draw(java.awt.image.BufferedImage, java.awt.Graphics2D, com.iver.cit.gvsig.fmap.ViewPort)
|
|
117 |
* @see com.iver.cit.gvsig.fmap.layers.LayerOperations#draw(java.awt.image.BufferedImage, java.awt.Graphics2D, ISymbol)
|
|
115 | 118 |
*/ |
116 | 119 |
public void draw(BufferedImage image, Graphics2D g, ViewPort vp, Cancellable cancel) throws DriverIOException { |
117 | 120 |
((RasterDriver) driver).draw(image,g, vp); |
... | ... | |
242 | 245 |
* @return true si est? georreferenciada y false si no lo est?. |
243 | 246 |
*/ |
244 | 247 |
public boolean isGeoreferenced() { |
245 |
return ((RasterDriver)driver).isGeoreferenced(); |
|
248 |
return ((GeorreferencedRasterDriver)driver).isGeoreferenced();
|
|
246 | 249 |
} |
250 |
|
|
251 |
/** |
|
252 |
* Obtiene el grid asociado |
|
253 |
* @return grid |
|
254 |
*/ |
|
255 |
public Grid getGrid(){ |
|
256 |
return ((RasterDriver)driver).getGrid(); |
|
257 |
} |
|
247 | 258 |
} |
branches/piloto3d/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/LayersIterator.java | ||
---|---|---|
20 | 20 |
ArrayList layersList =new ArrayList(); |
21 | 21 |
int index = 0; |
22 | 22 |
|
23 |
public LayersIterator() { |
|
24 |
|
|
25 |
} |
|
26 |
|
|
27 | 23 |
public LayersIterator(FLayer layer) { |
28 | 24 |
this.appendLayer(layer); |
29 | 25 |
} |
30 | 26 |
|
31 |
protected void appendLayer(FLayer layer) {
|
|
27 |
private void appendLayer(FLayer layer) {
|
|
32 | 28 |
if (this.evaluate(layer)) { |
33 | 29 |
layersList.add(layer); |
34 | 30 |
} |
branches/piloto3d/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/FLyrDefault.java | ||
---|---|---|
44 | 44 |
import java.util.ArrayList; |
45 | 45 |
import java.util.Hashtable; |
46 | 46 |
import java.util.Iterator; |
47 |
import java.util.List; |
|
48 |
import java.util.Set; |
|
47 | 49 |
|
48 | 50 |
import javax.swing.ImageIcon; |
49 | 51 |
|
... | ... | |
51 | 53 |
import org.cresques.cts.ICoordTrans; |
52 | 54 |
import org.cresques.cts.IProjection; |
53 | 55 |
|
56 |
import com.hardcode.driverManager.Driver; |
|
57 |
import com.hardcode.driverManager.DriverLoadException; |
|
54 | 58 |
import com.iver.cit.gvsig.fmap.DriverException; |
55 | 59 |
import com.iver.cit.gvsig.fmap.MapContext; |
56 | 60 |
import com.iver.cit.gvsig.fmap.crs.CRSFactory; |
... | ... | |
58 | 62 |
import com.iver.cit.gvsig.fmap.edition.EditionException; |
59 | 63 |
import com.iver.cit.gvsig.fmap.operations.strategies.Strategy; |
60 | 64 |
import com.iver.utiles.XMLEntity; |
65 |
import com.iver.utiles.IPersistance; |
|
61 | 66 |
|
62 | 67 |
/** |
63 | 68 |
* Implementaci?n de las caracter?sticas de alto nivel de las capas: |
... | ... | |
78 | 83 |
|
79 | 84 |
private IProjection projection; |
80 | 85 |
|
81 |
private boolean visible = true; |
|
86 |
// private boolean visible = true; |
|
87 |
// |
|
88 |
// private boolean active; |
|
82 | 89 |
|
83 |
private boolean active; |
|
84 |
|
|
85 | 90 |
private int transparency = 0; |
86 | 91 |
|
87 | 92 |
private ICoordTrans ct; |
... | ... | |
90 | 95 |
|
91 | 96 |
private double maxScale = -1; |
92 | 97 |
|
93 |
private boolean isInTOC = true; |
|
98 |
// private boolean isInTOC = true;
|
|
94 | 99 |
|
95 | 100 |
protected ArrayList layerListeners = new ArrayList(); |
96 | 101 |
|
97 | 102 |
private Strategy privateStrategy = null; |
98 | 103 |
|
99 |
private boolean isediting; |
|
104 |
// private boolean isediting;
|
|
100 | 105 |
|
101 | 106 |
private Hashtable properties = new Hashtable(); |
102 | 107 |
|
103 |
private boolean bCacheDrawnLayers; |
|
104 |
|
|
108 |
// private boolean bCacheDrawnLayers;
|
|
109 |
|
|
105 | 110 |
private BufferedImage cacheImageDrawnLayers = null; |
106 |
|
|
107 |
private boolean bDirty; |
|
108 |
|
|
109 |
private boolean available = true; |
|
110 | 111 |
|
112 |
// private boolean bDirty; |
|
113 |
|
|
114 |
// private boolean available = true; |
|
115 |
|
|
116 |
//by default, all is active, visible and avalaible |
|
117 |
private FLayerStatus status = new FLayerStatus(); |
|
118 |
|
|
111 | 119 |
public Object getProperty(Object key) { |
112 | 120 |
return properties.get(key); |
113 | 121 |
} |
... | ... | |
120 | 128 |
* @see com.iver.cit.gvsig.fmap.layers.FLayer#setActive(boolean) |
121 | 129 |
*/ |
122 | 130 |
public void setActive(boolean selected) { |
123 |
active = selected; |
|
131 |
//active = selected; |
|
132 |
status.active = selected; |
|
124 | 133 |
callActivationChanged(LayerEvent.createActivationChangedEvent(this, |
125 | 134 |
"active")); |
126 | 135 |
} |
... | ... | |
129 | 138 |
* @see com.iver.cit.gvsig.fmap.layers.FLayer#isActive() |
130 | 139 |
*/ |
131 | 140 |
public boolean isActive() { |
132 |
return active; |
|
141 |
// return active; |
|
142 |
return status.active; |
|
133 | 143 |
} |
134 | 144 |
|
135 | 145 |
/** |
... | ... | |
157 | 167 |
* @see com.iver.cit.gvsig.fmap.layers.FLayer#setVisible(boolean) |
158 | 168 |
*/ |
159 | 169 |
public void setVisible(boolean visibility) { |
160 |
visible = visibility; |
|
170 |
// visible = visibility; |
|
171 |
boolean changed = status.visible != visibility; |
|
172 |
status.visible = visibility; |
|
161 | 173 |
setDirty(true); |
174 |
if (changed){ |
|
175 |
if (this.getMapContext() != null){ |
|
176 |
this.getMapContext().clearAllCachingImageDrawnLayers(); |
|
177 |
} |
|
178 |
} |
|
162 | 179 |
callVisibilityChanged(LayerEvent.createVisibilityChangedEvent(this, |
163 | 180 |
"visible")); |
164 | 181 |
} |
... | ... | |
167 | 184 |
* @see com.iver.cit.gvsig.fmap.layers.FLayer#isVisible() |
168 | 185 |
*/ |
169 | 186 |
public boolean isVisible() { |
170 |
return visible && this.available; |
|
187 |
// return visible && this.available; |
|
188 |
return status.visible && status.available; |
|
171 | 189 |
} |
172 | 190 |
|
173 | 191 |
/** |
174 | 192 |
* Devuelve la capa padre de la actual. |
175 |
*
|
|
193 |
* |
|
176 | 194 |
* @return FLayers padre. |
177 | 195 |
*/ |
178 | 196 |
public FLayers getParentLayer() { |
... | ... | |
181 | 199 |
|
182 | 200 |
/** |
183 | 201 |
* Inserta la capa padre. |
184 |
*
|
|
202 |
* |
|
185 | 203 |
* @param root |
186 | 204 |
* capa padre. |
187 | 205 |
*/ |
... | ... | |
191 | 209 |
|
192 | 210 |
/** |
193 | 211 |
* Inserta una proyecci?n. |
194 |
*
|
|
212 |
* |
|
195 | 213 |
* @param proj |
196 | 214 |
* Proyecci?n. |
197 | 215 |
*/ |
... | ... | |
224 | 242 |
|
225 | 243 |
/** |
226 | 244 |
* Devuelve el nivel de transparencia de la capa. |
227 |
*
|
|
245 |
* |
|
228 | 246 |
* @return Entero que representa el nivel de transparencia. |
229 | 247 |
*/ |
230 | 248 |
public int getTransparency() { |
... | ... | |
233 | 251 |
|
234 | 252 |
/** |
235 | 253 |
* Inserta el nivel de transparencia de la capa. |
236 |
*
|
|
254 |
* |
|
237 | 255 |
* @param trans |
238 | 256 |
* Nivel de transparencia. |
239 | 257 |
*/ |
... | ... | |
244 | 262 |
|
245 | 263 |
/** |
246 | 264 |
* Devuelve el XMLEntity a partir del objeto. |
247 |
*
|
|
265 |
* |
|
248 | 266 |
* @return XMLEntity. |
249 | 267 |
* @throws XMLException |
250 | 268 |
*/ |
... | ... | |
255 | 273 |
if (this instanceof FLayers) { |
256 | 274 |
} |
257 | 275 |
|
258 |
xml.putProperty("active", active); |
|
276 |
// xml.putProperty("active", active); |
|
277 |
xml.putProperty("active", status.active); |
|
259 | 278 |
xml.putProperty("name", name); |
260 | 279 |
xml.putProperty("minScale", minScale); |
261 | 280 |
xml.putProperty("maxScale", maxScale); |
262 | 281 |
|
263 | 282 |
// TODO xml.addChild(parentLayer.getXMLEntity()); |
264 |
xml.putProperty("visible", visible); |
|
283 |
// xml.putProperty("visible", visible); |
|
284 |
xml.putProperty("visible", status.visible); |
|
265 | 285 |
if (projection != null) { |
266 | 286 |
xml.putProperty("proj", projection.getAbrev()); |
267 | 287 |
} |
268 | 288 |
xml.putProperty("transparency", transparency); |
269 |
xml.putProperty("isInTOC", isInTOC); |
|
289 |
// xml.putProperty("isInTOC", isInTOC); |
|
290 |
xml.putProperty("isInTOC", status.inTOC); |
|
291 |
|
|
292 |
// persist Properties hashTable |
|
293 |
|
|
294 |
Set keyset = properties.keySet(); |
|
295 |
xml.putProperty("numProperties", keyset.size()); |
|
296 |
|
|
297 |
Iterator keyitr = keyset.iterator(); |
|
298 |
while (keyitr.hasNext()) { |
|
299 |
String propName = (String)keyitr.next(); |
|
300 |
Object obj = properties.get(propName); |
|
301 |
if (obj instanceof IPersistance) |
|
302 |
{ |
|
303 |
IPersistance persistObj = (IPersistance)obj; |
|
304 |
XMLEntity xmlPropObj = persistObj.getXMLEntity(); |
|
305 |
// make sure the node contains the class name |
|
306 |
if (!xmlPropObj.contains("className")) { |
|
307 |
try { |
|
308 |
String propClassName = persistObj.getClassName(); |
|
309 |
System.out.println("PROP CLASS NAME "+propClassName); |
|
310 |
xmlPropObj.putProperty("className", propClassName); |
|
311 |
} catch (Exception e) { |
|
312 |
e.printStackTrace(); |
|
313 |
} |
|
314 |
} |
|
315 |
xmlPropObj.putProperty("layerPropertyName", propName); |
|
316 |
xml.addChild(xmlPropObj); |
|
317 |
} |
|
318 |
} |
|
319 |
|
|
270 | 320 |
return xml; |
271 | 321 |
} |
272 | 322 |
|
273 | 323 |
/* |
274 | 324 |
* Inserta los valores de los atributos del XMLEntity al objeto. |
275 |
*
|
|
325 |
* |
|
276 | 326 |
* @param xml XMLEntity. |
277 |
*
|
|
327 |
* |
|
278 | 328 |
* @throws XMLException @throws DriverException @throws DriverIOException |
279 |
*
|
|
329 |
* |
|
280 | 330 |
* public void setXMLEntity03(XMLEntity xml) throws XMLException { active = |
281 | 331 |
* xml.getBooleanProperty("active"); name = xml.getStringProperty("name"); |
282 | 332 |
* minScale=xml.getDoubleProperty("minScale"); |
... | ... | |
289 | 339 |
|
290 | 340 |
/** |
291 | 341 |
* Inserta los valores de los atributos del XMLEntity al objeto. |
292 |
*
|
|
342 |
* |
|
293 | 343 |
* @param xml |
294 | 344 |
* XMLEntity. |
295 |
*
|
|
345 |
* |
|
296 | 346 |
* @throws XMLException |
297 | 347 |
* @throws DriverException |
298 | 348 |
* @throws DriverIOException |
299 | 349 |
*/ |
300 | 350 |
public void setXMLEntity(XMLEntity xml) throws XMLException { |
301 |
active = xml.getBooleanProperty("active"); |
|
351 |
// active = xml.getBooleanProperty("active"); |
|
352 |
status.active = xml.getBooleanProperty("active"); |
|
302 | 353 |
name = xml.getStringProperty("name"); |
303 | 354 |
minScale = xml.getDoubleProperty("minScale"); |
304 | 355 |
maxScale = xml.getDoubleProperty("maxScale"); |
305 |
visible = xml.getBooleanProperty("visible"); |
|
356 |
// visible = xml.getBooleanProperty("visible"); |
|
357 |
status.visible = xml.getBooleanProperty("visible"); |
|
306 | 358 |
if (xml.contains("proj")) { |
307 | 359 |
setProjection(CRSFactory.getCRS(xml.getStringProperty("proj"))); |
308 | 360 |
} |
309 | 361 |
if (xml.contains("transparency")) |
310 | 362 |
transparency = xml.getIntProperty("transparency"); |
311 | 363 |
if (xml.contains("isInTOC")) |
312 |
isInTOC = xml.getBooleanProperty("isInTOC"); |
|
364 |
// isInTOC = xml.getBooleanProperty("isInTOC"); |
|
365 |
status.inTOC = xml.getBooleanProperty("isInTOC"); |
|
366 |
|
|
367 |
// recreate Properties hashTable |
|
368 |
|
|
369 |
if (xml.contains("numProperties")) { |
|
370 |
int numProps = xml.getIntProperty("numProperties"); |
|
371 |
|
|
372 |
for (int iProp=0; iProp<numProps; iProp++) { |
|
373 |
XMLEntity xmlProp = xml.getChild(iProp); |
|
374 |
try { |
|
375 |
String className = xmlProp.getStringProperty("className"); |
|
376 |
Class classProp = Class.forName(className); |
|
377 |
Object obj = classProp.newInstance(); |
|
378 |
IPersistance objPersist = (IPersistance)obj; |
|
379 |
objPersist.setXMLEntity(xmlProp); |
|
380 |
String propName = xmlProp.getStringProperty("layerPropertyName"); |
|
381 |
properties.put(propName, obj); |
|
382 |
} catch (Exception e) { |
|
383 |
continue; |
|
384 |
} |
|
385 |
// remove Properties children to avoid breaking layers' XML reading logic |
|
386 |
for (iProp=0; iProp<numProps; iProp++) |
|
387 |
xml.removeChild(numProps-1-iProp); |
|
388 |
} |
|
389 |
} |
|
313 | 390 |
} |
314 | 391 |
|
315 | 392 |
/** |
316 | 393 |
* Inserta los valores de los atributos del XMLEntity al objeto. |
317 |
*
|
|
394 |
* |
|
318 | 395 |
* @param xml |
319 | 396 |
* XMLEntity. |
320 |
*
|
|
397 |
* |
|
321 | 398 |
* @throws XMLException |
322 | 399 |
* @throws DriverException |
323 | 400 |
* @throws DriverIOException |
324 | 401 |
*/ |
325 | 402 |
public void setXMLEntity03(XMLEntity xml) throws XMLException { |
326 |
active = xml.getBooleanProperty("active"); |
|
403 |
// active = xml.getBooleanProperty("active"); |
|
404 |
status.active = xml.getBooleanProperty("active"); |
|
327 | 405 |
name = xml.getStringProperty("name"); |
328 | 406 |
minScale = xml.getDoubleProperty("minScale"); |
329 | 407 |
maxScale = xml.getDoubleProperty("maxScale"); |
330 |
visible = xml.getBooleanProperty("visible"); |
|
408 |
// visible = xml.getBooleanProperty("visible"); |
|
409 |
status.visible = xml.getBooleanProperty("visible"); |
|
331 | 410 |
if (xml.contains("proj")) { |
332 | 411 |
setProjection(CRSFactory.getCRS(xml.getStringProperty("proj"))); |
333 | 412 |
} |
... | ... | |
348 | 427 |
|
349 | 428 |
/** |
350 | 429 |
* A?ade a la lista de listener un nuevo LayerListener. |
351 |
*
|
|
430 |
* |
|
352 | 431 |
* @param o |
353 | 432 |
* LayerListener. |
354 |
*
|
|
433 |
* |
|
355 | 434 |
* @return boolean. |
356 | 435 |
*/ |
357 | 436 |
public boolean addLayerListener(LayerListener o) { |
... | ... | |
364 | 443 |
} |
365 | 444 |
/** |
366 | 445 |
* Borra de la lista de listeners el que se pasa como par?metro. |
367 |
*
|
|
446 |
* |
|
368 | 447 |
* @param o |
369 | 448 |
* LayerListener a borrar. |
370 |
*
|
|
449 |
* |
|
371 | 450 |
* @return True si ha sido correcto el borrado del Listener. |
372 | 451 |
*/ |
373 | 452 |
public boolean removeLayerListener(LayerListener o) { |
... | ... | |
376 | 455 |
|
377 | 456 |
/** |
378 | 457 |
* Llamada al metodo nameChanged de los Listeners dados de alta. |
379 |
*
|
|
458 |
* |
|
380 | 459 |
* @param e |
381 | 460 |
* LayerEvent. |
382 | 461 |
*/ |
... | ... | |
390 | 469 |
|
391 | 470 |
/** |
392 | 471 |
* Llamada al m?todo visibilityChanged de los Listeners. |
393 |
*
|
|
472 |
* |
|
394 | 473 |
* @param e |
395 | 474 |
* LayerEvent. |
396 | 475 |
*/ |
... | ... | |
404 | 483 |
|
405 | 484 |
/** |
406 | 485 |
* Llamada al m?todo activationChanged de los Listener. |
407 |
*
|
|
486 |
* |
|
408 | 487 |
* @param e |
409 | 488 |
* LayerEvent. |
410 | 489 |
*/ |
... | ... | |
418 | 497 |
|
419 | 498 |
/** |
420 | 499 |
* Devuelve las capas virtuales. |
421 |
*
|
|
500 |
* |
|
422 | 501 |
* @return FLayers. |
423 | 502 |
*/ |
424 | 503 |
public FLayers getVirtualLayers() { |
... | ... | |
427 | 506 |
|
428 | 507 |
/** |
429 | 508 |
* Inserta las capas virtuales. |
430 |
*
|
|
509 |
* |
|
431 | 510 |
* @param virtualLayers |
432 | 511 |
* FLayers. |
433 | 512 |
*/ |
... | ... | |
437 | 516 |
|
438 | 517 |
/** |
439 | 518 |
* Devuelve la capa de texto. |
440 |
*
|
|
519 |
* |
|
441 | 520 |
* @return capa de texto. |
442 | 521 |
*/ |
443 | 522 |
public FLyrText getLayerText() { |
... | ... | |
446 | 525 |
|
447 | 526 |
/** |
448 | 527 |
* Inserta la capa de texto. |
449 |
*
|
|
528 |
* |
|
450 | 529 |
* @param layerText |
451 | 530 |
* Capa de texto. |
452 | 531 |
*/ |
... | ... | |
456 | 535 |
|
457 | 536 |
/** |
458 | 537 |
* Inserta la Transformaci?n de coordenadas. |
459 |
*
|
|
538 |
* |
|
460 | 539 |
* @param ct |
461 | 540 |
* Transformaci?n de coordenadas. |
462 | 541 |
*/ |
... | ... | |
466 | 545 |
|
467 | 546 |
/** |
468 | 547 |
* Devuelve las transformaci?n de coordenadas. |
469 |
*
|
|
548 |
* |
|
470 | 549 |
* @return ct. |
471 | 550 |
*/ |
472 | 551 |
public ICoordTrans getCoordTrans() { |
... | ... | |
489 | 568 |
|
490 | 569 |
/* |
491 | 570 |
* (non-Javadoc) |
492 |
*
|
|
571 |
* |
|
493 | 572 |
* @see com.iver.cit.gvsig.fmap.layers.FLayer#getMaxScale() |
494 | 573 |
*/ |
495 | 574 |
public double getMaxScale() { |
... | ... | |
528 | 607 |
} |
529 | 608 |
|
530 | 609 |
public void setEditing(boolean b) throws EditionException { |
531 |
isediting = b; |
|
610 |
// isediting = b; |
|
611 |
status.editing = b; |
|
532 | 612 |
setDirty(true); |
533 | 613 |
setCachingDrawnLayers(b); |
534 | 614 |
} |
... | ... | |
542 | 622 |
} |
543 | 623 |
|
544 | 624 |
public boolean isEditing() { |
545 |
return isediting; |
|
625 |
// return isediting; |
|
626 |
return status.editing; |
|
546 | 627 |
} |
547 | 628 |
|
548 | 629 |
public ImageIcon getTocImageIcon() { |
... | ... | |
550 | 631 |
} |
551 | 632 |
|
552 | 633 |
public boolean isInTOC() { |
553 |
return isInTOC; |
|
634 |
// return isInTOC; |
|
635 |
return status.inTOC; |
|
554 | 636 |
} |
555 | 637 |
|
556 | 638 |
/* (non-Javadoc) |
557 | 639 |
* @see com.iver.cit.gvsig.fmap.layers.FLayer#isCachingDrawnLayers() |
558 | 640 |
*/ |
559 | 641 |
public boolean isCachingDrawnLayers() { |
560 |
return bCacheDrawnLayers; |
|
642 |
// return bCacheDrawnLayers; |
|
643 |
return status.cacheDrawnLayers; |
|
561 | 644 |
} |
562 | 645 |
|
563 | 646 |
/* (non-Javadoc) |
564 | 647 |
* @see com.iver.cit.gvsig.fmap.layers.FLayer#setCachingDrawnLayers(boolean) |
565 | 648 |
*/ |
566 | 649 |
public void setCachingDrawnLayers(boolean bCacheDrawnLayers) { |
567 |
this.bCacheDrawnLayers = bCacheDrawnLayers; |
|
568 |
if (bCacheDrawnLayers == false) |
|
650 |
// this.bCacheDrawnLayers = bCacheDrawnLayers; |
|
651 |
status.cacheDrawnLayers = bCacheDrawnLayers; |
|
652 |
if (status.cacheDrawnLayers == false) |
|
569 | 653 |
this.cacheImageDrawnLayers = null; |
570 | 654 |
} |
571 | 655 |
|
... | ... | |
578 | 662 |
} |
579 | 663 |
|
580 | 664 |
public boolean isDirty() { |
581 |
return bDirty;
|
|
665 |
return status.dirty;
|
|
582 | 666 |
} |
583 | 667 |
|
584 | 668 |
public void setDirty(boolean dirty) { |
585 |
bDirty = dirty;
|
|
669 |
status.dirty = dirty;
|
|
586 | 670 |
} |
587 |
|
|
671 |
|
|
588 | 672 |
public boolean isAvailable() { |
589 |
return this.available;
|
|
673 |
return status.available;
|
|
590 | 674 |
} |
591 |
|
|
675 |
|
|
592 | 676 |
public void setAvailable(boolean available) { |
593 |
this.available = available;
|
|
677 |
status.available = available;
|
|
594 | 678 |
} |
595 |
|
|
679 |
|
|
596 | 680 |
public void reload() throws DriverIOException { |
597 | 681 |
this.setAvailable(true); |
598 | 682 |
} |
599 |
|
|
683 |
|
|
684 |
/** |
|
685 |
* Returns the status of the layer |
|
686 |
*/ |
|
687 |
public FLayerStatus getFLayerStatus(){ |
|
688 |
return status; |
|
689 |
} |
|
690 |
/** |
|
691 |
* Sets the status of the layer |
|
692 |
* @param status |
|
693 |
*/ |
|
694 |
public void setFLayerStatus(FLayerStatus status){ |
|
695 |
this.status = status; |
|
696 |
} |
|
697 |
|
|
698 |
/* |
|
699 |
* This stuff is to save error's info that causes |
|
700 |
* unavailable status. |
|
701 |
* */ |
|
702 |
|
|
703 |
public boolean isOk(){ |
|
704 |
return status.isOk(); |
|
705 |
} |
|
706 |
|
|
707 |
public int getNumErrors(){ |
|
708 |
return status.getNumErrors(); |
|
709 |
} |
|
710 |
|
|
711 |
public DriverException getError(int i){ |
|
712 |
return status.getError(i); |
|
713 |
} |
|
714 |
|
|
715 |
public List getErrors(){ |
|
716 |
return status.getErrors(); |
|
717 |
} |
|
718 |
|
|
719 |
public void addError(DriverException error){ |
|
720 |
status.addLayerError(error); |
|
721 |
} |
|
722 |
|
|
600 | 723 |
public boolean visibleRequired() { |
601 |
return this.visible;
|
|
724 |
return status.visible;
|
|
602 | 725 |
} |
603 |
|
|
726 |
|
|
604 | 727 |
public String getInfoString() { |
605 | 728 |
return null; |
606 | 729 |
} |
607 | 730 |
|
608 | 731 |
public boolean isWritable() { |
609 |
// TODO Auto-generated method stub |
|
610 |
return false; |
|
732 |
return status.writable; |
|
611 | 733 |
} |
734 |
|
|
735 |
/* (non-Javadoc) |
|
736 |
* @see com.iver.cit.gvsig.fmap.layers.FLayer#cloneLayer() |
|
737 |
*/ |
|
738 |
public FLayer cloneLayer() throws Exception { |
|
739 |
return this; |
|
740 |
} |
|
612 | 741 |
|
613 | 742 |
|
743 |
|
|
614 | 744 |
} |
branches/piloto3d/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/FLayer.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
package com.iver.cit.gvsig.fmap.layers; |
42 | 42 |
|
43 |
import java.awt.Graphics2D; |
|
44 |
import java.awt.geom.Rectangle2D; |
|
45 |
import java.awt.image.BufferedImage; |
|
46 |
import java.util.List; |
|
47 |
|
|
48 |
import javax.print.attribute.PrintRequestAttributeSet; |
|
49 |
import javax.swing.ImageIcon; |
|
50 |
|
|
51 |
import org.cresques.cts.ICoordTrans; |
|
52 |
import org.cresques.geo.Projected; |
|
53 |
|
|
43 | 54 |
import com.iver.cit.gvsig.fmap.DriverException; |
44 | 55 |
import com.iver.cit.gvsig.fmap.MapContext; |
45 | 56 |
import com.iver.cit.gvsig.fmap.ViewPort; |
46 | 57 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
47 | 58 |
import com.iver.cit.gvsig.fmap.edition.EditionException; |
48 |
|
|
49 | 59 |
import com.iver.utiles.XMLEntity; |
50 | 60 |
import com.iver.utiles.swing.threads.Cancellable; |
51 | 61 |
|
52 |
import org.cresques.cts.ICoordTrans; |
|
53 | 62 |
|
54 |
import org.cresques.geo.Projected; |
|
55 |
|
|
56 |
import java.awt.Graphics2D; |
|
57 |
import java.awt.geom.Rectangle2D; |
|
58 |
import java.awt.image.BufferedImage; |
|
59 |
|
|
60 |
import javax.swing.ImageIcon; |
|
61 |
|
|
62 |
|
|
63 | 63 |
/** |
64 | 64 |
* Interfaz que tienen que implementar todas las capas. |
65 | 65 |
*/ |
... | ... | |
200 | 200 |
* |
201 | 201 |
* @throws DriverException |
202 | 202 |
*/ |
203 |
void print(Graphics2D g, ViewPort viewPort, Cancellable cancel,double scale)
|
|
203 |
void print(Graphics2D g, ViewPort viewPort, Cancellable cancel, double scale, PrintRequestAttributeSet properties)
|
|
204 | 204 |
throws DriverException; |
205 | 205 |
|
206 | 206 |
/** |
... | ... | |
304 | 304 |
|
305 | 305 |
public void setCacheImageDrawnLayers(BufferedImage cacheImageDrawnLayers); |
306 | 306 |
|
307 |
|
|
307 | 308 |
/** |
309 |
* Returns the status of the layer |
|
310 |
*/ |
|
311 |
public FLayerStatus getFLayerStatus(); |
|
312 |
/** |
|
313 |
* Sets the status of the layer |
|
314 |
* @param status |
|
315 |
*/ |
|
316 |
public void setFLayerStatus(FLayerStatus status); |
|
317 |
|
|
318 |
|
|
319 |
/* |
|
320 |
* This stuff is to save error's info that causes |
|
321 |
* unavailable status. |
|
322 |
* */ |
|
323 |
/** |
|
324 |
* Return if the layer is in OK status |
|
325 |
* (it hasnt got errors) |
|
326 |
*/ |
|
327 |
public boolean isOk(); |
|
328 |
/** |
|
329 |
* returns the number of errors that causes layer |
|
330 |
* unavailable status |
|
331 |
* @return |
|
332 |
*/ |
|
333 |
public int getNumErrors(); |
|
334 |
|
|
335 |
/** |
|
336 |
* return the specified error |
|
337 |
* @param i |
|
338 |
* @return |
|
339 |
*/ |
|
340 |
public DriverException getError(int i); |
|
341 |
|
|
342 |
/** |
|
343 |
* add an error cause to describe the layer's wrong status |
|
344 |
* @param error |
|
345 |
*/ |
|
346 |
public void addError(DriverException error); |
|
347 |
|
|
348 |
/** |
|
349 |
* Returns a list with all layer errors |
|
350 |
* @return |
|
351 |
*/ |
|
352 |
public List getErrors(); |
|
353 |
|
|
354 |
|
|
355 |
/** |
|
308 | 356 |
* @return set layer aviable or not. |
309 | 357 |
*/ |
310 | 358 |
public void setAvailable(boolean available); |
... | ... | |
345 | 393 |
* edits in itself. |
346 | 394 |
*/ |
347 | 395 |
public boolean isWritable(); |
396 |
|
|
397 |
/** |
|
398 |
* Useful to associate any object to a layer. For example, you |
|
399 |
* can attach a network definition to key "network" and |
|
400 |
* check if a layer has a network loaded if getAssociatedObject("network") |
|
401 |
* is not null |
|
402 |
* |
|
403 |
* @param key |
|
404 |
* @return null if key is not found |
|
405 |
*/ |
|
406 |
public Object getProperty(Object key); |
|
407 |
|
|
408 |
/** |
|
409 |
* @param key |
|
410 |
* @param obj |
|
411 |
*/ |
|
412 |
public void setProperty(Object key, Object obj); |
|
348 | 413 |
|
414 |
/** |
|
415 |
* This method can be used to have a fast cloned layer. The implementations should take care of |
|
416 |
* NOT recreate the layer. Instead of this, is better to use the same source (driver) and deepclone |
|
417 |
* the legend. Exception=> the labels aren't deepcloned to avoid memory consumption. |
|
418 |
* Note: Labels are memory consuming to speed up layers like PostGIS and so on. |
|
419 |
* @return clonedLayer |
|
420 |
* @throws Exception |
|
421 |
*/ |
|
422 |
public FLayer cloneLayer() throws Exception; |
|
349 | 423 |
|
424 |
|
|
350 | 425 |
} |
branches/piloto3d/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/FLyrGT2_old.java | ||
---|---|---|
52 | 52 |
import java.awt.image.BufferedImage; |
53 | 53 |
import java.io.IOException; |
54 | 54 |
|
55 |
import javax.print.attribute.PrintRequestAttributeSet; |
|
56 |
|
|
55 | 57 |
import org.geotools.data.FeatureSource; |
56 | 58 |
import org.geotools.map.DefaultMapContext; |
57 | 59 |
import org.geotools.map.MapContext; |
... | ... | |
140 | 142 |
/** |
141 | 143 |
* @see com.iver.cit.gvsig.fmap.layers.FLayer#print(java.awt.Graphics2D, com.iver.cit.gvsig.fmap.ViewPort, com.iver.utiles.swing.threads.Cancellable) |
142 | 144 |
*/ |
143 |
public void print(Graphics2D g, ViewPort viewPort, Cancellable cancel,double scale) throws DriverException { |
|
145 |
public void print(Graphics2D g, ViewPort viewPort, Cancellable cancel,double scale, PrintRequestAttributeSet properties) throws DriverException {
|
|
144 | 146 |
} |
145 | 147 |
|
146 | 148 |
} |
branches/piloto3d/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/FLyrGT2.java | ||
---|---|---|
49 | 49 |
import java.io.IOException; |
50 | 50 |
import java.util.NoSuchElementException; |
51 | 51 |
|
52 |
import javax.print.attribute.PrintRequestAttributeSet; |
|
53 |
|
|
52 | 54 |
import org.geotools.data.DataStore; |
53 | 55 |
import org.geotools.data.DefaultQuery; |
54 | 56 |
import org.geotools.data.DefaultTransaction; |
... | ... | |
167 | 169 |
} |
168 | 170 |
|
169 | 171 |
public void print(Graphics2D g, ViewPort viewPort, Cancellable cancel, |
170 |
double scale) throws DriverException { |
|
172 |
double scale, PrintRequestAttributeSet properties) throws DriverException {
|
|
171 | 173 |
// TODO Auto-generated method stub |
172 | 174 |
|
173 | 175 |
} |
branches/piloto3d/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/FLyrVect.java | ||
---|---|---|
50 | 50 |
import java.io.File; |
51 | 51 |
import java.io.IOException; |
52 | 52 |
|
53 |
import javax.print.attribute.PrintRequestAttributeSet; |
|
54 |
|
|
53 | 55 |
import org.apache.log4j.Logger; |
54 | 56 |
import org.cresques.cts.ICoordTrans; |
55 | 57 |
|
56 |
import com.hardcode.driverManager.Driver; |
|
57 | 58 |
import com.hardcode.driverManager.DriverLoadException; |
58 | 59 |
import com.hardcode.gdbms.engine.data.DataSourceFactory; |
59 | 60 |
import com.hardcode.gdbms.engine.data.NoSuchTableException; |
60 | 61 |
import com.hardcode.gdbms.engine.instruction.FieldNotFoundException; |
61 | 62 |
import com.iver.cit.gvsig.fmap.DriverException; |
63 |
import com.iver.cit.gvsig.fmap.DriverNotLoadedExceptionType; |
|
62 | 64 |
import com.iver.cit.gvsig.fmap.ViewPort; |
63 | 65 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
66 |
import com.iver.cit.gvsig.fmap.core.ISymbol; |
|
64 | 67 |
import com.iver.cit.gvsig.fmap.core.v02.FSymbol; |
65 | 68 |
import com.iver.cit.gvsig.fmap.drivers.BoundedShapes; |
66 | 69 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
... | ... | |
89 | 92 |
import com.iver.cit.gvsig.fmap.operations.strategies.Strategy; |
90 | 93 |
import com.iver.cit.gvsig.fmap.operations.strategies.StrategyManager; |
91 | 94 |
import com.iver.cit.gvsig.fmap.operations.strategies.VisitException; |
95 |
import com.iver.cit.gvsig.fmap.rendering.ClassifiedLegendInfo; |
|
92 | 96 |
import com.iver.cit.gvsig.fmap.rendering.Legend; |
93 | 97 |
import com.iver.cit.gvsig.fmap.rendering.LegendChangedEvent; |
94 | 98 |
import com.iver.cit.gvsig.fmap.rendering.LegendFactory; |
... | ... | |
143 | 147 |
private boolean bHasJoin = false; |
144 | 148 |
|
145 | 149 |
private XMLEntity orgXMLEntity = null; |
146 |
|
|
150 |
|
|
147 | 151 |
private XMLEntity loadSelection = null; |
148 | 152 |
private VectorialLegend loadLegend = null; |
149 |
|
|
150 | 153 |
|
154 |
|
|
151 | 155 |
/** |
152 | 156 |
* A?ade un SelectionListener a la lista de listeners. |
153 | 157 |
* |
... | ... | |
301 | 305 |
public Rectangle2D getFullExtent() throws DriverException { |
302 | 306 |
try { |
303 | 307 |
Rectangle2D rAux; |
304 |
logger.debug(getName() + "_source.start()"); |
|
308 |
// logger.debug(getName() + "_source.start()");
|
|
305 | 309 |
source.start(); |
306 | 310 |
rAux = (Rectangle2D)source.getFullExtent().clone(); |
307 |
logger.debug(getName() + "_source.stop()"); |
|
311 |
// logger.debug(getName() + "_source.stop()");
|
|
308 | 312 |
source.stop(); |
309 | 313 |
|
310 | 314 |
// Si existe reproyecci?n, reproyectar el extent |
Also available in: Unified diff