Revision 30187

View differences:

branches/v2_0_0_prep/extensions/extEditing/src/org/gvsig/editing/ExportTo.java
676 676
			FeatureAttributeDescriptor fad=(FeatureAttributeDescriptor)type.get(type.getDefaultGeometryAttributeName());
677 677
			type.remove(fad.getName());
678 678
			EditableFeatureAttributeDescriptor efad=type.add(fad.getName(), fad.getDataType(), fad.getSize());
679
			efad.setDefaultValue(fad.getDefaultValue());
679
			efad.setDefaultDynValue(fad.getDefaultValue());
680 680
			efad.setGeometryType(geometryType);
681 681
			efad.setPrecision(fad.getPrecision());
682 682
			type.setDefaultGeometryAttributeName(fad.getName());
branches/v2_0_0_prep/extensions/extWCS/src/org/gvsig/wcs/fmap/layers/FLyrWCS.java
307 307
		return data;
308 308
	}
309 309

  
310
	/**
311
	 * @see com.iver.cit.gvsig.fmap.layers.layerOperations.InfoByPoint#getInfo
312
	 */
313
	public XMLItem[] getInfo(Point point, double tolerance, Cancellable cancel)
314
			throws ReadException {
315
		return super.getInfo(point, tolerance, cancel);
316
	}
310
//	/**
311
//	 * @see com.iver.cit.gvsig.fmap.layers.layerOperations.InfoByPoint#getInfo
312
//	 */
313
//	public XMLItem[] getInfo(Point point, double tolerance, Cancellable cancel)
314
//			throws ReadException {
315
//		return super.getInfo(point, tolerance, cancel);
316
//	}
317 317

  
318 318
	/**
319 319
	 * Devuelve el envelope en la proyeccion de la vista
branches/v2_0_0_prep/extensions/extWMS/src/org/gvsig/wms/fmap/layers/FLyrWMS.java
40 40
*/
41 41
package org.gvsig.wms.fmap.layers;
42 42

  
43
import java.awt.Component;
44 43
import java.awt.Dimension;
45 44
import java.awt.Graphics2D;
46 45
import java.awt.Image;
......
69 68

  
70 69
import javax.print.attribute.PrintRequestAttributeSet;
71 70
import javax.swing.ImageIcon;
72
import javax.swing.JOptionPane;
73 71

  
74 72
import org.cresques.cts.ICoordTrans;
75 73
import org.cresques.geo.ViewPortData;
......
78 76
import org.gvsig.andami.PluginServices;
79 77
import org.gvsig.andami.messages.NotificationManager;
80 78
import org.gvsig.fmap.crs.CRSFactory;
79
import org.gvsig.fmap.dal.exception.DataException;
81 80
import org.gvsig.fmap.dal.exception.ReadException;
82 81
import org.gvsig.fmap.geom.GeometryLocator;
83 82
import org.gvsig.fmap.geom.GeometryManager;
......
89 88
import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException;
90 89
import org.gvsig.fmap.mapcontext.exceptions.URLLayerException;
91 90
import org.gvsig.fmap.mapcontext.exceptions.UnsupportedVersionLayerException;
92
import org.gvsig.fmap.mapcontext.exceptions.XMLLayerException;
93 91
import org.gvsig.fmap.mapcontext.layers.FLayer;
94 92
import org.gvsig.fmap.mapcontext.layers.Tiling;
95 93
import org.gvsig.fmap.mapcontext.layers.operations.ComposedLayer;
96 94
import org.gvsig.fmap.mapcontext.layers.operations.IHasImageLegend;
97
import org.gvsig.fmap.mapcontext.layers.operations.StringXMLItem;
98
import org.gvsig.fmap.mapcontext.layers.operations.XMLItem;
99 95
import org.gvsig.fmap.mapcontext.rendering.legend.ILegend;
100 96
import org.gvsig.fmap.raster.layers.FLyrRasterSE;
101 97
import org.gvsig.fmap.raster.layers.IRasterLayerActions;
......
580 576
		firstLoad = true;
581 577
	}
582 578

  
583
	/**
584
	 * @throws ReadDriverException
585
	 * @throws LoadLayerException
586
	 * @see com.iver.cit.gvsig.fmap.layers.layerOperations.InfoByPoint#queryByPoint(com.iver.cit.gvsig.fmap.operations.QueriedPoint)
587
	 */
588
	public XMLItem[] getInfo(Point p, double tolerance, Cancellable cancellable)
589
			throws ReadException {
590
		XMLItem[] item = new XMLItem[1];
591
		try {
592
			if (queryable) 	{
593
				//TODO
594
				// check if there are layers which are not queryable
595
				ViewPort viewPort = getMapContext().getViewPort();
579
//	/**
580
//	 * @throws ReadDriverException
581
//	 * @throws LoadLayerException
582
//	 * @see com.iver.cit.gvsig.fmap.layers.layerOperations.InfoByPoint#queryByPoint(com.iver.cit.gvsig.fmap.operations.QueriedPoint)
583
//	 */
584
//	public XMLItem[] getInfo(Point p, double tolerance, Cancellable cancellable)
585
//			throws ReadException {
586
//		XMLItem[] item = new XMLItem[1];
587
//		try {
588
//			if (queryable) 	{
589
//				//TODO
590
//				// check if there are layers which are not queryable
591
//				ViewPort viewPort = getMapContext().getViewPort();
592
//
593
//				Point tiledPoint = new Point((int) p.getX() % maxTilePrintWidth, (int) p.getY() % maxTilePrintHeight);
594
//				Rectangle rect = new Rectangle(0, 0, viewPort.getImageWidth() - 1, viewPort.getImageHeight() - 1);
595
//				Tiling tiles = new Tiling(maxTilePrintWidth, maxTilePrintHeight, rect);
596
//				tiles.setAffineTransform((AffineTransform) viewPort.getAffineTransform().clone());
597
//				int nCols = tiles.getNumCols();
598
//
599
//				int col = (int) p.getX() / maxTilePrintWidth;
600
//				int row = (int) p.getY() / maxTilePrintHeight;
601
//				int tileIndex = (row*nCols) + col;
602
//
603
//				ViewPort vp = tiles.getTileViewPort(viewPort, tileIndex);
604
//				wmsStatus.setExtent(this.getRectable2DFromEnvelope(vp
605
//						.getAdjustedExtent()));
606
//				wmsStatus.setHeight(vp.getImageHeight());
607
//				wmsStatus.setWidth(vp.getImageWidth());
608
//				wmsStatus.setOnlineResource((String) onlineResources.get("GetFeatureInfo"));
609
//
610
//
611
//				wmsStatus.setFormat( m_Format );
612
//				wmsStatus.setLayerNames(Utilities.createVector(layerQuery,","));
613
//				wmsStatus.setSrs(m_SRS);
614
//				wmsStatus.setStyles(styles);
615
//				wmsStatus.setDimensions(dimensions);
616
//				wmsStatus.setTransparency(wmsTransparency);
617
//				wmsStatus.setSrs(m_SRS);
618
//				MyCancellable c = new MyCancellable(cancellable);
619
//				try {
620
//					item[0] = new StringXMLItem(new String(getDriver()
621
//							.getFeatureInfo(wmsStatus, (int) tiledPoint.getX(), (int) tiledPoint.getY(), Integer.MAX_VALUE, c)),this);
622
//				} catch (UnsupportedVersionLayerException e) {
623
//					throw new ReadException(FMapWMSDriver.class.getName()
624
//							+ "::" + getName()
625
//							+ " - UnsupportedVersionLayerException", e);
626
//				} catch (IllegalStateException e) {
627
//					throw new ReadException(FMapWMSDriver.class.getName()
628
//							+ "::" + getName() + " - IllegalStateException", e);
629
//				}
630
//				return item;
631
//			}
632
//			else
633
//			{
634
//				JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(),this.getName() + " " +
635
//						PluginServices.getText(this,"layer_not_queryable"));
636
//				item[0] =  new StringXMLItem("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><info></info>",this);
637
//				return item;
638
//				//return null;
639
//			}
640
//		} catch (WMSException  e) {
641
//			item[0] = new StringXMLItem("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><exception>" +
642
//			e.getMessage() + "</exception>", this);
643
//			return item;
644
//		} catch (ValidationException e) {
645
//			throw new ReadException(FMapWMSDriver.class.getName() + "::"
646
//					+ getName() + " - ValidationException", e);
647
//		} catch (IOException e) {
648
//			throw new ReadException(FMapWMSDriver.class.getName() + "::"
649
//					+ getName() + " - IOException", e);
650
//		} catch (NoninvertibleTransformException e) {
651
//			NotificationManager.addError("NotinvertibleTransform", e);
652
//		}
653
//		return null;
654
//	}
596 655

  
597
				Point tiledPoint = new Point((int) p.getX() % maxTilePrintWidth, (int) p.getY() % maxTilePrintHeight);
598
				Rectangle rect = new Rectangle(0, 0, viewPort.getImageWidth() - 1, viewPort.getImageHeight() - 1);
599
				Tiling tiles = new Tiling(maxTilePrintWidth, maxTilePrintHeight, rect);
600
				tiles.setAffineTransform((AffineTransform) viewPort.getAffineTransform().clone());
601
				int nCols = tiles.getNumCols();
602

  
603
				int col = (int) p.getX() / maxTilePrintWidth;
604
				int row = (int) p.getY() / maxTilePrintHeight;
605
				int tileIndex = (row*nCols) + col;
606

  
607
				ViewPort vp = tiles.getTileViewPort(viewPort, tileIndex);
608
				wmsStatus.setExtent(this.getRectable2DFromEnvelope(vp
609
						.getAdjustedExtent()));
610
				wmsStatus.setHeight(vp.getImageHeight());
611
				wmsStatus.setWidth(vp.getImageWidth());
612
				wmsStatus.setOnlineResource((String) onlineResources.get("GetFeatureInfo"));
613

  
614

  
615
				wmsStatus.setFormat( m_Format );
616
				wmsStatus.setLayerNames(Utilities.createVector(layerQuery,","));
617
				wmsStatus.setSrs(m_SRS);
618
				wmsStatus.setStyles(styles);
619
				wmsStatus.setDimensions(dimensions);
620
				wmsStatus.setTransparency(wmsTransparency);
621
				wmsStatus.setSrs(m_SRS);
622
				MyCancellable c = new MyCancellable(cancellable);
623
				try {
624
					item[0] = new StringXMLItem(new String(getDriver()
625
							.getFeatureInfo(wmsStatus, (int) tiledPoint.getX(), (int) tiledPoint.getY(), Integer.MAX_VALUE, c)),this);
626
				} catch (UnsupportedVersionLayerException e) {
627
					throw new ReadException(FMapWMSDriver.class.getName()
628
							+ "::" + getName()
629
							+ " - UnsupportedVersionLayerException", e);
630
				} catch (IllegalStateException e) {
631
					throw new ReadException(FMapWMSDriver.class.getName()
632
							+ "::" + getName() + " - IllegalStateException", e);
633
				}
634
				return item;
635
			}
636
			else
637
			{
638
				JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(),this.getName() + " " +
639
						PluginServices.getText(this,"layer_not_queryable"));
640
				item[0] =  new StringXMLItem("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><info></info>",this);
641
				return item;
642
				//return null;
643
			}
644
		} catch (WMSException  e) {
645
			item[0] = new StringXMLItem("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><exception>" +
646
			e.getMessage() + "</exception>", this);
647
			return item;
648
		} catch (ValidationException e) {
649
			throw new ReadException(FMapWMSDriver.class.getName() + "::"
650
					+ getName() + " - ValidationException", e);
651
		} catch (IOException e) {
652
			throw new ReadException(FMapWMSDriver.class.getName() + "::"
653
					+ getName() + " - IOException", e);
654
		} catch (NoninvertibleTransformException e) {
655
			NotificationManager.addError("NotinvertibleTransform", e);
656
		}
657
		return null;
658
	}
659

  
660 656
	/*
661 657
	 *
662 658
	 * @see com.iver.cit.gvsig.fmap.layers.FLayer#draw(java.awt.image.BufferedImage,
......
2153 2149
		}
2154 2150
		return null;
2155 2151
	}
2152
	
2153
	public Iterator getInfo(Point p, double tolerance, Cancellable cancel)
2154
		throws LoadLayerException, DataException {
2155
		// TODO Auto-generated method stub
2156
//		XMLItem[] item = new XMLItem[1];
2157
//		try {
2158
//			if (queryable) 	{
2159
//				//TODO
2160
//				// check if there are layers which are not queryable
2161
//				ViewPort viewPort = getMapContext().getViewPort();
2162
//
2163
//				Point tiledPoint = new Point((int) p.getX() % maxTilePrintWidth, (int) p.getY() % maxTilePrintHeight);
2164
//				Rectangle rect = new Rectangle(0, 0, viewPort.getImageWidth() - 1, viewPort.getImageHeight() - 1);
2165
//				Tiling tiles = new Tiling(maxTilePrintWidth, maxTilePrintHeight, rect);
2166
//				tiles.setAffineTransform((AffineTransform) viewPort.getAffineTransform().clone());
2167
//				int nCols = tiles.getNumCols();
2168
//
2169
//				int col = (int) p.getX() / maxTilePrintWidth;
2170
//				int row = (int) p.getY() / maxTilePrintHeight;
2171
//				int tileIndex = (row*nCols) + col;
2172
//
2173
//				ViewPort vp = tiles.getTileViewPort(viewPort, tileIndex);
2174
//				wmsStatus.setExtent(this.getRectable2DFromEnvelope(vp
2175
//						.getAdjustedExtent()));
2176
//				wmsStatus.setHeight(vp.getImageHeight());
2177
//				wmsStatus.setWidth(vp.getImageWidth());
2178
//				wmsStatus.setOnlineResource((String) onlineResources.get("GetFeatureInfo"));
2179
//
2180
//
2181
//				wmsStatus.setFormat( m_Format );
2182
//				wmsStatus.setLayerNames(Utilities.createVector(layerQuery,","));
2183
//				wmsStatus.setSrs(m_SRS);
2184
//				wmsStatus.setStyles(styles);
2185
//				wmsStatus.setDimensions(dimensions);
2186
//				wmsStatus.setTransparency(wmsTransparency);
2187
//				wmsStatus.setSrs(m_SRS);
2188
//				MyCancellable c = new MyCancellable(cancellable);
2189
//				try {
2190
//					item[0] = new StringXMLItem(new String(getDriver()
2191
//							.getFeatureInfo(wmsStatus, (int) tiledPoint.getX(), (int) tiledPoint.getY(), Integer.MAX_VALUE, c)),this);
2192
//				} catch (UnsupportedVersionLayerException e) {
2193
//					throw new ReadException(FMapWMSDriver.class.getName()
2194
//							+ "::" + getName()
2195
//							+ " - UnsupportedVersionLayerException", e);
2196
//				} catch (IllegalStateException e) {
2197
//					throw new ReadException(FMapWMSDriver.class.getName()
2198
//							+ "::" + getName() + " - IllegalStateException", e);
2199
//				}
2200
//				return item;
2201
//			}
2202
//			else
2203
//			{
2204
//				JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(),this.getName() + " " +
2205
//						PluginServices.getText(this,"layer_not_queryable"));
2206
//				item[0] =  new StringXMLItem("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><info></info>",this);
2207
//				return item;
2208
//				//return null;
2209
//			}
2210
//		} catch (WMSException  e) {
2211
//			item[0] = new StringXMLItem("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><exception>" +
2212
//			e.getMessage() + "</exception>", this);
2213
//			return item;
2214
//		} catch (ValidationException e) {
2215
//			throw new ReadException(FMapWMSDriver.class.getName() + "::"
2216
//					+ getName() + " - ValidationException", e);
2217
//		} catch (IOException e) {
2218
//			throw new ReadException(FMapWMSDriver.class.getName() + "::"
2219
//					+ getName() + " - IOException", e);
2220
//		} catch (NoninvertibleTransformException e) {
2221
//			NotificationManager.addError("NotinvertibleTransform", e);
2222
//		}
2223
//		return null;
2224
		return null;
2225
	}
2156 2226

  
2157 2227
}
branches/v2_0_0_prep/extensions/extRasterTools-SE/src/org/gvsig/fmap/raster/layers/FLyrRasterSE.java
29 29
import java.awt.image.BufferedImage;
30 30
import java.io.File;
31 31
import java.io.IOException;
32
import java.lang.reflect.Constructor;
33
import java.lang.reflect.InvocationTargetException;
34 32
import java.util.ArrayList;
35 33
import java.util.HashMap;
34
import java.util.Iterator;
36 35
import java.util.Set;
37 36

  
38 37
import org.cresques.cts.IProjection;
......
40 39
import org.gvsig.fmap.crs.CRSFactory;
41 40
import org.gvsig.fmap.dal.DataStore;
42 41
import org.gvsig.fmap.dal.coverage.dataset.io.DefaultRasterIOLibrary;
42
import org.gvsig.fmap.dal.exception.DataException;
43 43
import org.gvsig.fmap.dal.exception.ReadException;
44 44
import org.gvsig.fmap.dal.raster.CoverageStore;
45 45
import org.gvsig.fmap.dal.store.raster.RasterStoreParameters;
......
52 52
import org.gvsig.fmap.mapcontext.ViewPort;
53 53
import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException;
54 54
import org.gvsig.fmap.mapcontext.exceptions.ReloadLayerException;
55
import org.gvsig.fmap.mapcontext.exceptions.XMLLayerException;
56 55
import org.gvsig.fmap.mapcontext.layers.FLayer;
57 56
import org.gvsig.fmap.mapcontext.layers.FLyrDefault;
58 57
import org.gvsig.fmap.mapcontext.layers.LayerChangeSupport;
......
61 60
import org.gvsig.fmap.mapcontext.layers.operations.Classifiable;
62 61
import org.gvsig.fmap.mapcontext.layers.operations.InfoByPoint;
63 62
import org.gvsig.fmap.mapcontext.layers.operations.SingleLayer;
64
import org.gvsig.fmap.mapcontext.layers.operations.StringXMLItem;
65
import org.gvsig.fmap.mapcontext.layers.operations.XMLItem;
66 63
import org.gvsig.fmap.mapcontext.rendering.legend.ILegend;
67 64
import org.gvsig.fmap.mapcontext.rendering.legend.events.listeners.LegendListener;
68 65
import org.gvsig.fmap.raster.legend.ColorTableLegend;
......
111 108
import org.gvsig.raster.util.MathUtils;
112 109
import org.gvsig.raster.util.RasterToolsUtil;
113 110
import org.gvsig.tools.task.Cancellable;
114
import org.gvsig.utils.NotExistInXMLEntity;
115
import org.gvsig.utils.XMLEntity;
116
import org.gvsig.utils.XMLException;
117 111
import org.slf4j.Logger;
118 112
import org.slf4j.LoggerFactory;
119 113

  
......
810 804
		return px;
811 805
	}
812 806

  
813
	/*
814
	 * (non-Javadoc)
815
	 * @see com.iver.cit.gvsig.fmap.layers.layerOperations.InfoByPoint#getInfo(java.awt.Point, double, com.iver.utiles.swing.threads.Cancellable)
816
	 */
817
	public XMLItem[] getInfo(Point p, double tolerance, Cancellable cancel)
818
			throws ReadException {
819
		if (!isOpen()) {
820
			StringXMLItem[] item = new StringXMLItem[1];
821
			String data = "<file:" + normalizeAsXMLTag(getName()) + ">\n";
822
			data += "  <raster\n" + "  Layer=\" Not available\"\n" + "  />\n";
823
			data += "</file:" + normalizeAsXMLTag(getName()) + ">\n";
824
			item[0] = new StringXMLItem(data, this);
825
			return item;
826
		}
807
//	/*
808
//	 * (non-Javadoc)
809
//	 * @see com.iver.cit.gvsig.fmap.layers.layerOperations.InfoByPoint#getInfo(java.awt.Point, double, com.iver.utiles.swing.threads.Cancellable)
810
//	 */
811
//	public XMLItem[] getInfo(Point p, double tolerance, Cancellable cancel)
812
//			throws ReadException {
813
//		if (!isOpen()) {
814
//			StringXMLItem[] item = new StringXMLItem[1];
815
//			String data = "<file:" + normalizeAsXMLTag(getName()) + ">\n";
816
//			data += "  <raster\n" + "  Layer=\" Not available\"\n" + "  />\n";
817
//			data += "</file:" + normalizeAsXMLTag(getName()) + ">\n";
818
//			item[0] = new StringXMLItem(data, this);
819
//			return item;
820
//		}
821
//
822
//		Point2D pReal = getMapContext().getViewPort().toMapPoint(p);
823
//		Point2D px = new Point2D.Double();
824
//		if(	pReal.getX() > this.getMinX() &&
825
//			pReal.getX() < this.getMaxX() &&
826
//			pReal.getY() > this.getMinY() &&
827
//			pReal.getY() < this.getMaxY())
828
//			try {
829
//				px = transformPoint(0, pReal);
830
//			} catch (NoninvertibleTransformException e) {
831
//				throw new ReadException("Error in the transformation", e);
832
//			}
833
//		int[] rgb = getPixel((int) p.getX(), (int) p.getY());
834
//		ColorConversion conv = new ColorConversion();
835
//
836
//		StringXMLItem[] item = new StringXMLItem[1];
837
//		String data = "<file:" + normalizeAsXMLTag(getName()) + ">\n";
838
//
839
//		data += "  <raster\n";
840
//		data += "    View_Point=\"" + p.getX() + " , " + p.getY() + "\"\n";
841
//		data += "    World_Point=\"" + MathUtils.format(pReal.getX(), 3) + " , " + MathUtils.format(pReal.getY(), 3) + "\"\n";
842
//		if (px == null)
843
//			data += "    Pixel_Point=\"Out\"\n";
844
//		else
845
//			data += "    Pixel_Point=\"" + (int) px.getX() + " , " + (int) px.getY() + "\"\n";
846
//		data += "    RGB=\"" + rgb[1] + "  " + rgb[2] + "  " + rgb[3] + "\"\n";
847
//		double[] cmyk = conv.RGBtoCMYK(rgb[1] & 0xff, rgb[2] & 0xff, rgb[3] & 0xff, 1D);
848
//		data += "    CMYK=\"" + MathUtils.format(cmyk[0], 4) + ", " + MathUtils.format(cmyk[1], 4) + ", " + MathUtils.format(cmyk[2], 4) + "," + MathUtils.format(cmyk[3], 4) + "\"\n";
849
//		double[] hsl = conv.RGBtoHSL(rgb[1] & 0xff, rgb[2] & 0xff, rgb[3] & 0xff);
850
//		hsl[0] = (int)(255.0 * hsl[0] / 360.0 + 0.5);
851
//		hsl[2] = (int) (hsl[2] * 255. + 0.5);
852
//		hsl[1] = (int) (hsl[1] * 255. + 0.5);
853
//		data += "    HSL=\"" + MathUtils.format(hsl[0], 4) + ", " + MathUtils.format(hsl[1], 4) + ", " + MathUtils.format(hsl[2], 4) + "\"\n";
854
//		data += "    Band_Value=\"";
855
//		try {
856
//			if (px != null) {
857
//				if(getDataType()[0] >= 0 && getDataType()[0] <= 3)
858
//					for(int i = 0; i < getBandCount(); i++)
859
//						if(getDataSource().isInside(pReal)) {
860
//							Point2D pxAux = transformPoint(i, pReal);
861
//							data += ((Integer)getDataSource().getData((int)pxAux.getX(), (int)pxAux.getY(), i)).intValue() + "  ";
862
//						}
863
//				if(getDataType()[0] == 4)
864
//					for(int i = 0; i < getBandCount(); i++)
865
//						if(getDataSource().isInside(pReal)) {
866
//							Point2D pxAux = transformPoint(i, pReal);
867
//							data += ((Float)getDataSource().getData((int)pxAux.getX(), (int)pxAux.getY(), i)).floatValue() + "  ";
868
//						}
869
//				if(getDataType()[0] == 5)
870
//					for(int i = 0; i < getBandCount(); i++)
871
//						if(getDataSource().isInside(pReal)) {
872
//							Point2D pxAux = transformPoint(i, pReal);
873
//							data += ((Double)getDataSource().getData((int)pxAux.getX(), (int)pxAux.getY(), i)).doubleValue() + "  ";
874
//						}
875
//			}
876
//		} catch (RasterDriverException ex) {
877
//			throw new ReadException("Error en el acceso al dataset", ex);
878
//		} catch (InvalidSetViewException ex) {
879
//			throw new ReadException(
880
//					"Error en la asignaci?n de la vista en getData", ex);
881
//		} catch (FileNotOpenException ex) {
882
//			throw new ReadException("Fichero no abierto en el dataset", ex);
883
//		} catch (NoninvertibleTransformException ex) {
884
//			throw new ReadException("Error in the transformation", ex);
885
//		}
886
//		data += "\"\n";
887
//		data += "  />\n";
888
//		data += "</file:" + normalizeAsXMLTag(getName()) + ">\n";
889
//
890
//		item[0] = new StringXMLItem(data, this);
891
//		return item;
892
//	}
827 893

  
828
		Point2D pReal = getMapContext().getViewPort().toMapPoint(p);
829
		Point2D px = new Point2D.Double();
830
		if(	pReal.getX() > this.getMinX() &&
831
			pReal.getX() < this.getMaxX() &&
832
			pReal.getY() > this.getMinY() &&
833
			pReal.getY() < this.getMaxY())
834
			try {
835
				px = transformPoint(0, pReal);
836
			} catch (NoninvertibleTransformException e) {
837
				throw new ReadException("Error in the transformation", e);
838
			}
839
		int[] rgb = getPixel((int) p.getX(), (int) p.getY());
840
		ColorConversion conv = new ColorConversion();
841

  
842
		StringXMLItem[] item = new StringXMLItem[1];
843
		String data = "<file:" + normalizeAsXMLTag(getName()) + ">\n";
844

  
845
		data += "  <raster\n";
846
		data += "    View_Point=\"" + p.getX() + " , " + p.getY() + "\"\n";
847
		data += "    World_Point=\"" + MathUtils.format(pReal.getX(), 3) + " , " + MathUtils.format(pReal.getY(), 3) + "\"\n";
848
		if (px == null)
849
			data += "    Pixel_Point=\"Out\"\n";
850
		else
851
			data += "    Pixel_Point=\"" + (int) px.getX() + " , " + (int) px.getY() + "\"\n";
852
		data += "    RGB=\"" + rgb[1] + "  " + rgb[2] + "  " + rgb[3] + "\"\n";
853
		double[] cmyk = conv.RGBtoCMYK(rgb[1] & 0xff, rgb[2] & 0xff, rgb[3] & 0xff, 1D);
854
		data += "    CMYK=\"" + MathUtils.format(cmyk[0], 4) + ", " + MathUtils.format(cmyk[1], 4) + ", " + MathUtils.format(cmyk[2], 4) + "," + MathUtils.format(cmyk[3], 4) + "\"\n";
855
		double[] hsl = conv.RGBtoHSL(rgb[1] & 0xff, rgb[2] & 0xff, rgb[3] & 0xff);
856
		hsl[0] = (int)(255.0 * hsl[0] / 360.0 + 0.5);
857
		hsl[2] = (int) (hsl[2] * 255. + 0.5);
858
		hsl[1] = (int) (hsl[1] * 255. + 0.5);
859
		data += "    HSL=\"" + MathUtils.format(hsl[0], 4) + ", " + MathUtils.format(hsl[1], 4) + ", " + MathUtils.format(hsl[2], 4) + "\"\n";
860
		data += "    Band_Value=\"";
861
		try {
862
			if (px != null) {
863
				if(getDataType()[0] >= 0 && getDataType()[0] <= 3)
864
					for(int i = 0; i < getBandCount(); i++)
865
						if(getDataSource().isInside(pReal)) {
866
							Point2D pxAux = transformPoint(i, pReal);
867
							data += ((Integer)getDataSource().getData((int)pxAux.getX(), (int)pxAux.getY(), i)).intValue() + "  ";
868
						}
869
				if(getDataType()[0] == 4)
870
					for(int i = 0; i < getBandCount(); i++)
871
						if(getDataSource().isInside(pReal)) {
872
							Point2D pxAux = transformPoint(i, pReal);
873
							data += ((Float)getDataSource().getData((int)pxAux.getX(), (int)pxAux.getY(), i)).floatValue() + "  ";
874
						}
875
				if(getDataType()[0] == 5)
876
					for(int i = 0; i < getBandCount(); i++)
877
						if(getDataSource().isInside(pReal)) {
878
							Point2D pxAux = transformPoint(i, pReal);
879
							data += ((Double)getDataSource().getData((int)pxAux.getX(), (int)pxAux.getY(), i)).doubleValue() + "  ";
880
						}
881
			}
882
		} catch (RasterDriverException ex) {
883
			throw new ReadException("Error en el acceso al dataset", ex);
884
		} catch (InvalidSetViewException ex) {
885
			throw new ReadException(
886
					"Error en la asignaci?n de la vista en getData", ex);
887
		} catch (FileNotOpenException ex) {
888
			throw new ReadException("Fichero no abierto en el dataset", ex);
889
		} catch (NoninvertibleTransformException ex) {
890
			throw new ReadException("Error in the transformation", ex);
891
		}
892
		data += "\"\n";
893
		data += "  />\n";
894
		data += "</file:" + normalizeAsXMLTag(getName()) + ">\n";
895

  
896
		item[0] = new StringXMLItem(data, this);
897
		return item;
898
	}
899

  
900 894
	/**
901 895
	 * Filters a string for being suitable as XML Tag, erasing
902 896
	 * all not alphabetic or numeric characters.
......
2117 2111
		this.readingData = readingData;
2118 2112
	}
2119 2113

  
2114
	public Iterator getInfo(Point p, double tolerance, Cancellable cancel)
2115
			throws LoadLayerException, DataException {
2116
		// TODO Auto-generated method stub
2117
		return null;
2118
	}
2119

  
2120 2120
}
branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/project/documents/table/gui/CreateNewAttributePanel.java
309 309
		EditableFeatureAttributeDescriptor ead = featureType.add(nameAttr,
310 310
				typeAttr, sizeAttr);
311 311
		ead.setPrecision(precisionAttr);
312
		ead.setDefaultValue(defaultValueAttr);
312
		ead.setDefaultDynValue(defaultValueAttr);
313 313
		return ead;
314 314
	}
315 315

  
branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/project/documents/view/toolListeners/InfoListener.java
43 43
import java.awt.Image;
44 44
import java.awt.Point;
45 45
import java.awt.geom.Point2D;
46
import java.util.Iterator;
46 47
import java.util.Vector;
47 48

  
48 49
import javax.swing.JDialog;
......
232 233
					InfoByPoint layer = (InfoByPoint) laCapa;
233 234
//					text = layer.getInfo(imagePoint, tol);
234 235
//					items[i] = new StringXMLItem(text);
235
					items[i] = layer.getInfo(imagePoint, tol, null)[0];
236
					numLayersInfoable++;
237
				} catch (DataException e) {
238
					throw new BehaviorException("No se pudo procesar la capa",
239
							e);
240
				} catch (LoadLayerException e) {
241
					throw new BehaviorException("No se pudo procesar la capa",
242
							e);
243
				}
236
					
237
					//TODO:jcarrasco Adapt this to the new infoByPoint
238
//					items[i] = layer.getInfo(imagePoint, tol, null)[0];
239
//					numLayersInfoable++;
240
//				} catch (DataException e) {
241
//					throw new BehaviorException("No se pudo procesar la capa",
242
//							e);
243
//				} catch (LoadLayerException e) {
244
//					throw new BehaviorException("No se pudo procesar la capa",
245
//							e);
246
				} finally {}
244 247
			}
245 248
		}
246 249

  
......
323 326
			if (laCapa instanceof InfoByPoint) {
324 327
				try {
325 328
					InfoByPoint layer = (InfoByPoint) laCapa;
326
					aux = layer.getInfo(imagePoint, tol, null);
327
					for(int j = 0; j < aux.length; j++){
328
						itemsVector.add(aux[j]);
329
						numLayersInfoable++;
330
					}
331
				} catch (DataException e) {
332
					throw new BehaviorException("Processing layer",e);
333
				} catch (LoadLayerException e) {
334
					throw new BehaviorException("No se pudo procesar la capa",
335
							e);
336
				}
329
					//TODO: jcarrasco Adapt it to the new layer.getInfo()
330
					//aux = layer.getInfo(imagePoint, tol, null);
331
//					for(int j = 0; j < aux.length; j++){
332
//						itemsVector.add(aux[j]);
333
//						numLayersInfoable++;
334
//					}
335
//				} catch (DataException e) {
336
//					throw new BehaviorException("Processing layer",e);
337
//				} catch (LoadLayerException e) {
338
//					throw new BehaviorException("No se pudo procesar la capa",
339
//							e);
340
				} finally{}
337 341
			}
338 342
		}
339 343
		final XMLItem[] items = (XMLItem[])itemsVector.toArray(new XMLItem[0]);
......
411 415
			if (laCapa instanceof InfoByPoint) {
412 416
				try {
413 417
					InfoByPoint layer = (InfoByPoint) laCapa;
414
					if (!(laCapa.getParentLayer().isActive())){
415
						aux = layer.getInfo(imagePoint, tol, null);
416
						for(int j = 0; j < aux.length; j++){
417
							itemsVector.add(aux[j]);
418
							numLayersInfoable++;
419
						}
420
					}
421
				} catch (DataException e) {
422
					throw new BehaviorException("Processing layer",e);
423
				} catch (LoadLayerException e) {
424
					throw new BehaviorException("No se pudo procesar la capa",
425
							e);
426
				}
418
//					if (!(laCapa.getParentLayer().isActive())){
419
						//TODO: jcarrasco Adapt it to the new layer.getInfo()
420
						//Iterator it = layer.getInfo(imagePoint, tol, null);
421
//						while(it.hasNext()){
422
//							
423
//						}
424
//						for(int j = 0; j < aux.length; j++){
425
//							itemsVector.add(aux[j]);
426
//							numLayersInfoable++;
427
//						}
428
//					}
429
//				} catch (DataException e) {
430
//					throw new BehaviorException("Processing layer",e);
431
//				} catch (LoadLayerException e) {
432
//					throw new BehaviorException("No se pudo procesar la capa",
433
//							e);
434
				} finally{}
427 435
			}
428 436
		}
429 437
		final XMLItem[] items = (XMLItem[])itemsVector.toArray(new XMLItem[0]);
branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/fmap/dal/serverexplorer/filesystem/swing/DynObjectEditor.java
985 985
							"DynClas to test DynObjectEditor");
986 986

  
987 987
			DynField field = dClass.addDynField("field1");
988
			field.setDefaultValue("field1");
988
			field.setDefaultDynValue("field1");
989 989
			field.setDescription("field1 (simple) string");
990 990
			field.setType(DataTypes.STRING);
991 991
			field.setMandatory(true);
992 992

  
993 993
			field = dClass.addDynField("field2");
994
			field.setDefaultValue("field2");
994
			field.setDefaultDynValue("field2");
995 995
			field.setDescription("field2 (choice) string");
996 996
			field.setType(DataTypes.STRING);
997 997
			field.setTheTypeOfAvailableValues(DynField.CHOICE);
......
1001 1001
					new DynObjectValueItem("v3", "Value3 (v3)"),
1002 1002
					new DynObjectValueItem("v4", "Value4 (v4)"), });
1003 1003

  
1004
			field.setDefaultValue("v3");
1004
			field.setDefaultDynValue("v3");
1005 1005

  
1006 1006
			field = dClass.addDynField("field3");
1007 1007
			field.setDescription("field3 (range) integer(-5,28)");
1008
			field.setDefaultValue(new Integer(10));
1008
			field.setDefaultDynValue(new Integer(10));
1009 1009
			field.setType(DataTypes.INT);
1010 1010
			field.setTheTypeOfAvailableValues(DynField.RANGE);
1011 1011
			field.setMinValue(new Integer(-5));
......
1013 1013

  
1014 1014
			field = dClass.addDynField("field4");
1015 1015
			field.setDescription("field3 (range) float(-5.2,28.55)");
1016
			field.setDefaultValue(new Float(10));
1016
			field.setDefaultDynValue(new Float(10));
1017 1017
			field.setType(DataTypes.FLOAT);
1018 1018
			field.setTheTypeOfAvailableValues(DynField.RANGE);
1019 1019
			field.setMinValue(new Float(-5.2));
branches/v2_0_0_prep/libraries/libFMap_dal/src-test/org/gvsig/fmap/dal/feature/BaseTestEditableFeatureStore.java
1299 1299
		.getDefaultFeatureType().getEditable();
1300 1300

  
1301 1301
		edFtype.add("__ATTR1__", DataTypes.STRING).setSize(10)
1302
		.setDefaultValue("HOLA");
1302
		.setDefaultDynValue("HOLA");
1303 1303

  
1304 1304
		result.update(edFtype);
1305 1305

  
branches/v2_0_0_prep/libraries/libFMap_dal/src/org/gvsig/fmap/dal/feature/FeatureAttributeDescriptor.java
5 5
import org.cresques.cts.IProjection;
6 6
import org.gvsig.fmap.dal.DataTypes;
7 7
import org.gvsig.fmap.geom.Geometry;
8
import org.gvsig.tools.dynobject.DynField;
8 9
import org.gvsig.tools.evaluator.Evaluator;
9 10

  
10 11

  
......
17 18
 *
18 19
 *
19 20
 */
20
public interface FeatureAttributeDescriptor {
21
public interface FeatureAttributeDescriptor extends DynField{
21 22

  
22 23
	/**
23 24
	 * Returns a clone of this attribute descriptor
branches/v2_0_0_prep/libraries/libFMap_dal/src/org/gvsig/fmap/dal/feature/Feature.java
6 6
import org.cresques.cts.IProjection;
7 7
import org.gvsig.fmap.geom.Geometry;
8 8
import org.gvsig.fmap.geom.primitive.Envelope;
9
import org.gvsig.tools.dynobject.DynObject;
9 10

  
10 11
/**
11 12
 * <p>Represents the basic data unit of a tabular structure, equivalent 
......
41 42
 * </p>
42 43
 *
43 44
 */
44
public interface Feature {
45
public interface Feature extends DynObject{
45 46

  
46 47
	/**
47 48
	 * Returns a unique identifier for this Feature in the associated store. 
branches/v2_0_0_prep/libraries/libFMap_dal/src/org/gvsig/fmap/dal/feature/impl/DefaultFeatureAttributeDescriptor.java
11 11
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
12 12
import org.gvsig.fmap.dal.feature.exception.UnsupportedDataTypeException;
13 13
import org.gvsig.fmap.geom.Geometry;
14
import org.gvsig.tools.dynobject.DynField;
15
import org.gvsig.tools.dynobject.DynObjectValueItem;
14 16
import org.gvsig.tools.evaluator.Evaluator;
15 17

  
16 18
public class DefaultFeatureAttributeDescriptor implements
......
187 189
		return this.isAutomatic;
188 190
	}
189 191

  
192

  
190 193
	private boolean compareObject(Object a, Object b) {
191 194
		if (a != b) {
192 195
			if (a != null) {
......
284 287

  
285 288
		return true;
286 289
	}
290

  
291
	
292
	/**
293
	 * Start of DynField interface Implementation
294
	 * READONLY
295
	 */
296
	
297
	
298
	public DynObjectValueItem[] getAvailableValues() {
299
		// TODO Auto-generated method stub
300
		return null;
301
	}
302

  
303
	public String getDescription() {
304
		// TODO Auto-generated method stub
305
		return null;
306
	}
307

  
308
	public Object getMaxValue() {
309
		// TODO Auto-generated method stub
310
		return null;
311
	}
312

  
313
	public Object getMinValue() {
314
		// TODO Auto-generated method stub
315
		return null;
316
	}
317

  
318
	public int getTheTypeOfAvailableValues() {
319
		// TODO Auto-generated method stub
320
		return 0;
321
	}
322

  
323
	public int getType() {
324
		return getDataType();
325
	}
326

  
327
	public boolean isMandatory() {
328
		// TODO Auto-generated method stub
329
		return false;
330
	}
331

  
332
	public boolean isPersistent() {
333
		// TODO Auto-generated method stub
334
		return false;
335
	}
336

  
337
	public DynField setAvailableValues(DynObjectValueItem[] values) {
338
		throw new UnsupportedOperationException();
339
	}
340

  
341
	public DynField setDescription(String description) {
342
		throw new UnsupportedOperationException();
343
	}
344

  
345
	public DynField setMandatory(boolean mandatory) {
346
		throw new UnsupportedOperationException();
347
	}
348

  
349
	public DynField setMaxValue(Object maxValue) {
350
		throw new UnsupportedOperationException();
351
	}
352

  
353
	public DynField setMinValue(Object minValue) {
354
		throw new UnsupportedOperationException();
355
	}
356

  
357
	public DynField setPersistent(boolean persistent) {
358
		throw new UnsupportedOperationException();
359
	}
360

  
361
	public DynField setTheTypeOfAvailableValues(int type) {
362
		throw new UnsupportedOperationException();
363
	}
364

  
365
	public DynField setType(int type) {
366
		throw new UnsupportedOperationException();
367
	}
368

  
369
	public DynField setDefaultDynValue(Object defaultValue) {
370
		throw new UnsupportedOperationException();
371
	}
372

  
287 373
}
branches/v2_0_0_prep/libraries/libFMap_dal/src/org/gvsig/fmap/dal/feature/impl/DefaultFeature.java
20 20
import org.gvsig.fmap.dal.feature.spi.FeatureProvider;
21 21
import org.gvsig.fmap.geom.Geometry;
22 22
import org.gvsig.fmap.geom.primitive.Envelope;
23
import org.gvsig.tools.dynobject.DynClass;
24
import org.gvsig.tools.dynobject.DynObject;
25
import org.gvsig.tools.dynobject.exception.DynFieldNotFoundException;
26
import org.gvsig.tools.dynobject.exception.DynMethodException;
23 27
import org.gvsig.tools.evaluator.Evaluator;
24 28
import org.gvsig.tools.evaluator.EvaluatorData;
25 29
import org.gvsig.tools.evaluator.EvaluatorException;
......
466 470
		return this.data.getType().getIndex(name) >= 0;
467 471
	}
468 472

  
473
	/**
474
	 * Start of DynField interface Implementation
475
	 * READONLY
476
	 */
477
	
478
	public void delegate(DynObject dynObject) {
479
		throw new UnsupportedOperationException();
480
	}
481

  
482
	public DynClass getDynClass() {
483
		return getType();
484
	}
485

  
486
	public Object getDynValue(String name) throws DynFieldNotFoundException {
487
		return get(name);
488
	}
489

  
490
	public boolean hasDynValue(String name) {
491
		if (data.getType().getIndex(name)<0)
492
			return false;
493
		return true;
494
	}
495

  
496
	public void implement(DynClass dynClass) {
497
		throw new UnsupportedOperationException();
498
		
499
	}
500

  
501
	public Object invokeDynMethod(String name, DynObject context)
502
			throws DynMethodException {
503
		throw new UnsupportedOperationException();
504
	}
505

  
506
	public Object invokeDynMethod(int code, DynObject context)
507
			throws DynMethodException {
508
		throw new UnsupportedOperationException();
509
	}
510

  
511
	public void setDynValue(String name, Object value)
512
			throws DynFieldNotFoundException {
513
		throw new UnsupportedOperationException();
514
		
515
	}
516

  
469 517
}
branches/v2_0_0_prep/libraries/libFMap_dal/src/org/gvsig/fmap/dal/feature/impl/DefaultFeatureType.java
14 14
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
15 15
import org.gvsig.fmap.dal.feature.FeatureRules;
16 16
import org.gvsig.fmap.dal.feature.FeatureType;
17
import org.gvsig.tools.dynobject.DynClass;
18
import org.gvsig.tools.dynobject.DynField;
19
import org.gvsig.tools.dynobject.DynMethod;
20
import org.gvsig.tools.dynobject.DynObject;
21
import org.gvsig.tools.dynobject.DynObjectValueItem;
22
import org.gvsig.tools.dynobject.exception.DynMethodException;
23
import org.gvsig.tools.dynobject.exception.DynObjectValidateException;
17 24

  
18 25
public class DefaultFeatureType extends ArrayList implements FeatureType {
19 26

  
......
363 370
		return (FeatureAttributeDescriptor) super
364 371
				.get(this.defaultGeometryAttributeIndex);
365 372
	}
373
	
366 374

  
367 375

  
368 376
	public boolean equals(Object other) {
......
403 411

  
404 412
	}
405 413

  
414
	/**
415
	 * Start of DynClass interface implementation 
416
	 * READONLY
417
	 */
418

  
419
	public DynField addDynField(String name) {
420
		throw new UnsupportedOperationException();
421
	}
422

  
423
	public DynField getDeclaredDynField(String name) {
424
		return getAttributeDescriptor(name);
425
	}
426

  
427
	public DynField[] getDeclaredDynFields() {
428
		return getAttributeDescriptors();
429
	}
430

  
431
	public String getDescription() {
432
		// TODO Auto-generated method stub
433
		return null;
434
	}
435

  
436
	public DynField getDynField(String name) {
437
		return getAttributeDescriptor(name);
438
	}
439

  
440
	public DynField[] getDynFields() {
441
		return getAttributeDescriptors();
442
	}
443

  
444
	public String getName() {
445
		return Long.toString(serialVersionUID);
446
	}
447

  
448
	public void removeDynField(String name) {
449
		throw new UnsupportedOperationException();
450
		
451
	}
452

  
453
	public void addDynMethod(DynMethod dynMethod) {
454
		throw new UnsupportedOperationException();
455
		
456
	}
457

  
458
	public void extend(DynClass dynClass) {
459
		throw new UnsupportedOperationException();
460
		
461
	}
462

  
463
	public void extend(String dynClassName) {
464
		throw new UnsupportedOperationException();
465
		
466
	}
467

  
468
	public DynMethod getDeclaredDynMethod(String name)
469
			throws DynMethodException {
470
		// TODO Auto-generated method stub
471
		return null;
472
	}
473

  
474
	public DynMethod[] getDeclaredDynMethods() throws DynMethodException {
475
		// TODO Auto-generated method stub
476
		return null;
477
	}
478

  
479
	public DynMethod getDynMethod(String name) throws DynMethodException {
480
		// TODO Auto-generated method stub
481
		return null;
482
	}
483

  
484
	public DynMethod getDynMethod(int code) throws DynMethodException {
485
		// TODO Auto-generated method stub
486
		return null;
487
	}
488

  
489
	public DynMethod[] getDynMethods() throws DynMethodException {
490
		// TODO Auto-generated method stub
491
		return null;
492
	}
493

  
494
	public DynClass[] getSuperDynClasses() {
495
		// TODO Auto-generated method stub
496
		return null;
497
	}
498

  
499
	public boolean isInstance(DynObject dynObject) {
500
		if (dynObject.getDynClass().getName() == getName())
501
			return true;
502
		return false;
503
	}
504

  
505
	public DynObject newInstance() {
506

  
507
		throw new UnsupportedOperationException();
508
	}
509

  
510
	public void removeDynMethod(String name) {
511
		throw new UnsupportedOperationException();
512
		
513
	}
514

  
515
	public DynField addDynFieldChoice(String name, int type,
516
			Object defaultValue, DynObjectValueItem[] values,
517
			boolean mandatory, boolean persistent) {
518
		throw new UnsupportedOperationException();
519
	}
520

  
521
	public DynField addDynFieldRange(String name, int type,
522
			Object defaultValue, Object min, Object max, boolean mandatory,
523
			boolean persistent) {
524
		throw new UnsupportedOperationException();
525
	}
526

  
527
	public DynField addDynFieldSingle(String name, int type,
528
			Object defaultValue, boolean mandatory, boolean persistent) {
529
		throw new UnsupportedOperationException();
530
	}
531

  
532
	public void validate(DynObject object) throws DynObjectValidateException {
533
		//FIXME: not sure it's the correct code
534
		if (object instanceof Feature) {
535
			Feature fea = (Feature) object;
536
			if (fea.getType().equals(this))
537
				return;
538
		}
539
		throw new DynObjectValidateException(
540
				"The object is not a Feature or is not this FeatureType", 
541
				"NOT_THIS_FEATURE_TYPE", -1);
542
	}
543

  
544

  
545

  
406 546
}
branches/v2_0_0_prep/libraries/libFMap_dal/src/org/gvsig/fmap/dal/feature/FeatureType.java
5 5

  
6 6
import org.cresques.cts.IProjection;
7 7
import org.gvsig.fmap.geom.Geometry;
8
import org.gvsig.tools.dynobject.DynClass;
9
import org.gvsig.tools.dynobject.DynStruct;
8 10
import org.gvsig.tools.evaluator.Evaluator;
9 11

  
10 12
/**
......
47 49
 * <li>Getting the default spatial reference system.
48 50
 * <ul/>
49 51
 */
50
public interface FeatureType {
52
public interface FeatureType extends DynClass{
51 53

  
52 54
	/**
53 55
	 * Returns a new copy of this FeatureType
branches/v2_0_0_prep/libraries/libFMap_dal/src/org/gvsig/fmap/dal/feature/EditableFeatureAttributeDescriptor.java
160 160
	 */
161 161
	public EditableFeatureAttributeDescriptor setDefaultValue(
162 162
			Object defaultValue);
163

  
163
 
164 164
	/**
165 165
	 * Sets additional information of the attribute
166 166
	 * @return TODO
branches/v2_0_0_prep/libraries/libFMap_daldb/src/org/gvsig/fmap/dal/store/jdbc/JDBCServerExplorerParameters.java
64 64
			field.setTheTypeOfAvailableValues(DynField.SINGLE);
65 65
			field.setDescription("Show information tables");
66 66
			field.setType(DataTypes.BOOLEAN);
67
			field.setDefaultValue(Boolean.FALSE);
67
			field.setDefaultDynValue(Boolean.FALSE);
68 68

  
69 69
		}
70 70
		return dynClass;
branches/v2_0_0_prep/libraries/libFMap_daldb/src/org/gvsig/fmap/dal/store/postgresql/PostgreSQLResourceParameters.java
67 67
			field.setTheTypeOfAvailableValues(DynField.SINGLE);
68 68
			field.setDescription("use SSL connetion");
69 69
			field.setType(DataTypes.BOOLEAN);
70
			field.setDefaultValue(Boolean.FALSE);
70
			field.setDefaultDynValue(Boolean.FALSE);
71 71

  
72 72
			field = dynClass.addDynField(DYNFIELDNAME_JDBC_DRIVER_CLASS_NAME);
73 73
			field.setTheTypeOfAvailableValues(DynField.SINGLE);
74 74
			field.setDescription("JDBC Driver class");
75 75
			field.setMandatory(true);
76 76
			field.setType(DataTypes.STRING);
77
			field.setDefaultValue(PostgreSQLLibrary.DEFAULT_JDCB_DRIVER_NAME);
77
			field.setDefaultDynValue(PostgreSQLLibrary.DEFAULT_JDCB_DRIVER_NAME);
78 78

  
79 79

  
80 80
		}
branches/v2_0_0_prep/libraries/libFMap_daldb/src/org/gvsig/fmap/dal/store/mysql/MySQLResourceParameters.java
67 67
			field.setTheTypeOfAvailableValues(DynField.SINGLE);
68 68
			field.setDescription("use SSL connetion");
69 69
			field.setType(DataTypes.BOOLEAN);
70
			field.setDefaultValue(Boolean.FALSE);
70
			field.setDefaultDynValue(Boolean.FALSE);
71 71

  
72 72
			field = dynClass.addDynField(DYNFIELDNAME_JDBC_DRIVER_CLASS_NAME);
73 73
			field.setTheTypeOfAvailableValues(DynField.SINGLE);
74 74
			field.setDescription("JDBC Driver class");
75 75
			field.setMandatory(true);
76 76
			field.setType(DataTypes.STRING);
77
			field.setDefaultValue(MySQLLibrary.DEFAULT_JDCB_DRIVER_NAME);
77
			field.setDefaultDynValue(MySQLLibrary.DEFAULT_JDCB_DRIVER_NAME);
78 78

  
79 79

  
80 80
		}
branches/v2_0_0_prep/libraries/libFMap_daldb/src-test/org/gvsig/fmap/dal/store/postgresql/TestPostgreSQLWrite.java
255 255
				org = (FeatureAttributeDescriptor) iter.next();
256 256
				trg = ftTrg.add(org.getName(), org.getDataType());
257 257
				trg.setAllowNull(org.allowNull());
258
				trg.setDefaultValue(org.getDefaultValue());
258
				trg.setDefaultDynValue(org.getDefaultValue());
259 259
				trg.setGeometrySubType(org.getGeometrySubType());
260 260
				trg.setGeometryType(org.getGeometryType());
261 261
				trg.setIsAutomatic(org.isAutomatic());
branches/v2_0_0_prep/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/layers/operations/InfoByPoint.java
41 41
package org.gvsig.fmap.mapcontext.layers.operations;
42 42

  
43 43
import java.awt.Point;
44
import java.util.Iterator;
44 45

  
45 46
import org.gvsig.fmap.dal.exception.DataException;
46 47
import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException;
......
63 64
	 *  singular implementation of this method would use it in a different way. The coordinates also depend on the implementation.
64 65
	 * @param cancel shared object that determines if this layer can continue being drawn
65 66
	 *
66
	 * @return an array with XML items that have the information of that point
67
	 * @return a DynObjectIterator. If the InfoByPoint Object is a vector layer it should return a Feature iterator. If the Object is a Layers object It will return an iterator of iterators
67 68
	 * @throws DataException TODO
68 69
	 * @throws LoadLayerException any exception produced using the driver.
69 70
	 */
70
	public XMLItem[] getInfo(Point p, double tolerance, Cancellable cancel) throws LoadLayerException, DataException;
71
	public Iterator getInfo(Point p, double tolerance, Cancellable cancel) throws LoadLayerException, DataException;
71 72
}
branches/v2_0_0_prep/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/layers/FLayers.java
873 873
	 * (non-Javadoc)
874 874
	 * @see com.iver.cit.gvsig.fmap.layers.layerOperations.InfoByPoint#getInfo(java.awt.Point, double, com.iver.utiles.swing.threads.Cancellable)
875 875
	 */
876
	public XMLItem[] getInfo(Point p, double tolerance, Cancellable cancel) throws LoadLayerException, DataException {
876
//	public XMLItem[] getInfo(Point p, double tolerance, Cancellable cancel) throws LoadLayerException, DataException {
877
//		int i;
878
//		Vector items = new Vector();
879
//		FLayer layer;
880
//		XMLItem[] aux;
881
//		for (i = 0; i < this.layers.size(); i++){
882
//			layer = (FLayer)layers.get(i);
883
//			if (layer instanceof InfoByPoint){
884
//				InfoByPoint queryable_layer = (InfoByPoint) layer;
885
//				aux = queryable_layer.getInfo(p, tolerance, null);
886
//				if (!(queryable_layer instanceof FLayers)){
887
//					for(int j = 0; j < aux.length; j++){
888
//						items.add(aux[j]);
889
//					}
890
//				}
891
//			}
892
//		}
893
//		return (XMLItem[])items.toArray(new XMLItem[0]);
894
//
895
//	}
896
	public Iterator getInfo(Point p, double tolerance,
897
			Cancellable cancel) throws LoadLayerException, DataException {
877 898
		int i;
878
		Vector items = new Vector();
879 899
		FLayer layer;
880
		XMLItem[] aux;
900
		ArrayList res = new ArrayList();
881 901
		for (i = 0; i < this.layers.size(); i++){
882 902
			layer = (FLayer)layers.get(i);
883 903
			if (layer instanceof InfoByPoint){
884 904
				InfoByPoint queryable_layer = (InfoByPoint) layer;
885
				aux = queryable_layer.getInfo(p, tolerance, null);
886
				if (!(queryable_layer instanceof FLayers)){
887
					for(int j = 0; j < aux.length; j++){
888
						items.add(aux[j]);
889
					}
890
				}
905
				Iterator it = queryable_layer.getInfo(p, tolerance, null);
906
				// Please be careful we add iterators, not the Dynobjects
907
				// we don't make the list flat so trees are supported
908
				res.add(it);
891 909
			}
892 910
		}
893
		return (XMLItem[])items.toArray(new XMLItem[0]);
894

  
911
		return res.iterator();
912
		
895 913
	}
896

  
914
	
915
	
897 916
	/*
898 917
	 * (non-Javadoc)
899 918
	 * @see com.iver.cit.gvsig.fmap.layers.FLyrDefault#getTocImageIcon()
branches/v2_0_0_prep/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/layers/vectorial/FLyrVect.java
46 46
import java.awt.geom.Point2D;
47 47
import java.awt.image.BufferedImage;
48 48
import java.net.URI;
49
import java.util.Iterator;
49 50
import java.util.Set;
50 51
import java.util.TreeSet;
51 52

  
......
137 138
	 */
138 139
	//    protected ISpatialIndex spatialIndex = null;
139 140
	private boolean bHasJoin = false;
140
//	private XMLEntity orgXMLEntity = null;
141

  
142
	private Object loadSelection = null;
143 141
	private IVectorLegend loadLegend = null;
144 142

  
145 143
	//Lo a?ado. Caracter?sticas de HyperEnlace (LINK)
......
1226 1224
		return getFeatureStore().getFeatureSet(featureQuery);
1227 1225

  
1228 1226
	}
1229
	
1230
	
1231
	public XMLItem[] getInfo(Point p, double tolerance, Cancellable cancel) throws LoadLayerException, DataException {
1232

  
1227
	public Iterator getInfo(Point p, double tolerance, Cancellable cancel) throws LoadLayerException, DataException {
1233 1228
		Point2D pReal = this.getMapContext().getViewPort().toMapPoint(p);
1234 1229
		FeatureSet featureCollection=null;
1235 1230
		try {
......
1238 1233
			// TODO Auto-generated catch block
1239 1234
			e.printStackTrace();
1240 1235
		}
1241
		VectorialXMLItem[] item = new VectorialXMLItem[1];
1242
		item[0] = new VectorialXMLItem(featureCollection, this);
1236
//		VectorialXMLItem[] item = new VectorialXMLItem[1];
1237
//		item[0] = new VectorialXMLItem(featureCollection, this);
1243 1238

  
1244
		return item;
1239
		return featureCollection.iterator();
1245 1240
	}
1246
	
1247
	
1248 1241

  
1249 1242
	public void legendCleared(LegendClearEvent event) {
1250 1243
		// this.updateDrawVersion(); TODO
branches/v2_0_0_prep/libraries/libTools/src/org/gvsig/tools/dynobject/DynField.java
35 35

  
36 36
	DynField setType(int type);
37 37

  
38
	DynField setDefaultValue(Object defaultValue);
38
	DynField setDefaultDynValue(Object defaultValue);
39 39

  
40 40
	DynField setMandatory(boolean mandatory);
41 41

  
branches/v2_0_0_prep/libraries/libTools/src/org/gvsig/tools/dynobject/impl/DefaultDynField.java
49 49
		return dataType;
50 50
	}
51 51

  
52
	public DynField setDefaultValue(Object defaultValue) {
52
	public DynField setDefaultDynValue(Object defaultValue) {
53 53
		this.defaultValue = defaultValue;
54 54
		return this;
55 55
	}
branches/v2_0_0_prep/libraries/libTools/src/org/gvsig/tools/dynobject/impl/DefaultDynClass.java
401 401
			boolean mandatory, boolean persistent) {
402 402
		return addDynField(name).setTheTypeOfAvailableValues(DynField.CHOICE)
403 403
				.setType(type)
404
				.setDefaultValue(defaultValue)
404
				.setDefaultDynValue(defaultValue)
405 405
				.setMandatory(mandatory)
406 406
				.setPersistent(persistent)
407 407
				.setAvailableValues(values);
......
411 411
			Object defaultValue, Object min, Object max, boolean mandatory,
412 412
			boolean persistent) {
413 413
		return addDynField(name).setTheTypeOfAvailableValues(DynField.RANGE)
414
				.setType(type).setDefaultValue(defaultValue)
414
				.setType(type).setDefaultDynValue(defaultValue)
415 415
				.setMandatory(mandatory)
416 416
				.setPersistent(persistent)
417 417
				.setMinValue(min)
......
422 422
			Object defaultValue, boolean mandatory, boolean persistent) {
423 423
		return addDynField(name).setTheTypeOfAvailableValues(DynField.SINGLE)
424 424
				.setType(type)
425
				.setDefaultValue(defaultValue)
425
				.setDefaultDynValue(defaultValue)
426 426
				.setMandatory(mandatory).
427 427
				setPersistent(persistent);
428 428
	}
branches/v2_0_0_prep/libraries/libFMap_dalfile/src/org/gvsig/fmap/dal/store/shp/SHPStoreProvider.java
224 224
			attr = fType.add(
225 225
					GEOMETRY_ATTIBUTE_NAME, DataTypes.GEOMETRY);
226 226
			try {
227
				attr.setDefaultValue(geomManager.createNullGeometry(SUBTYPES.GEOM2D));
227
				attr.setDefaultDynValue(geomManager.createNullGeometry(SUBTYPES.GEOM2D));
228 228
			} catch (CreateGeometryException e) {
229 229
				logger.error("Error creating the envelope", e);
230 230
			}
branches/v2_0_0_prep/libraries/libFMap_dalfile/src/org/gvsig/fmap/dal/store/dbf/DBFStoreProvider.java
246 246
				if (fieldType == 'L') {
247 247
					attr = fType
248 248
							.add(dbfFile.getFieldName(i), DataTypes.BOOLEAN);
249
					attr.setDefaultValue(new Boolean(false));
249
					attr.setDefaultDynValue(new Boolean(false));
250 250
					attr.setAllowNull(false);
251 251

  
252 252
				} else if ((fieldType == 'F') || (fieldType == 'N')) {
......
255 255
						attr = fType.add(dbfFile.getFieldName(i),
256 256
								DataTypes.DOUBLE, dbfFile.getFieldLength(i));
257 257
						attr.setPrecision(precision);
258
						attr.setDefaultValue(new Double(0));
258
						attr.setDefaultDynValue(new Double(0));
259 259

  
260 260
					} else {
261 261
						attr = fType
262 262
								.add(dbfFile.getFieldName(i), DataTypes.INT);
263
						attr.setDefaultValue(new Integer(0));
263
						attr.setDefaultDynValue(new Integer(0));
264 264
					}
265 265
					attr.setAllowNull(false);
266 266

  
267 267
				} else if (fieldType == 'C') {
268 268
					attr = fType.add(dbfFile.getFieldName(i), DataTypes.STRING);
269 269
					attr.setSize(dbfFile.getFieldLength(i));
270
					attr.setDefaultValue("");
270
					attr.setDefaultDynValue("");
271 271
					attr.setAllowNull(false);
272 272

  
273 273
				} else if (fieldType == 'D') {
274 274
					attr = fType.add(dbfFile.getFieldName(i), DataTypes.DATE);
275
					attr.setDefaultValue(null);
275
					attr.setDefaultDynValue(null);
276 276
					attr.setAllowNull(true);
277 277
				} else {
278 278
					throw new InitializeException(this.getName(),
branches/v2_0_0_prep/libraries/libFMap_dalfile/src/org/gvsig/fmap/dal/store/dbf/DBFStoreParameters.java
50 50
			field.setDescription("Encoding");
51 51
			field.setType(DataTypes.STRING);
52 52
			field.setMandatory(false);
53
			field.setDefaultValue(null);
53
			field.setDefaultDynValue(null);
54 54

  
55 55

  
56 56
			Set charsetSet = new LinkedHashSet(160);
branches/v2_0_0_prep/libraries/libFMap_dalfile/src/org/gvsig/fmap/dal/store/dbf/DBFLibrary.java
46 46

  
47 47
		DynField dynField = dynClass.addDynField(DYNFIELD_CODEPAGE_NAME);
48 48
		dynField.setDescription("Code Page");
49
		dynField.setDefaultValue(new Byte((byte) 0x2));
49
		dynField.setDefaultDynValue(new Byte((byte) 0x2));
50 50
		dynField.setType(DataTypes.BYTE);
51 51
		dynField.setTheTypeOfAvailableValues(DynField.CHOICE);
52 52
		dynField.setAvailableValues(new DynObjectValueItem[] {

Also available in: Unified diff