Revision 4221

View differences:

branches/v05/extensions/extWMS/src/com/iver/cit/gvsig/fmap/layers/FLyrWMS.java
97 97
* 
98 98
*/
99 99
public class FLyrWMS extends FLyrDefault implements InfoByPoint, RasterOperations {
100
	private boolean isPrinting = false;
101
	private boolean mustTileDraw = false;
102
	private boolean mustTilePrint = true;
103
	private final int maxTileDrawWidth = -1;
104
	private final int maxTileDrawHeight = -1;
105
	private final int maxTilePrintWidth = 1500;
106
	private final int maxTilePrintHeight = 1200;
100
	private boolean 					isPrinting = false;
101
	private boolean 					mustTileDraw = false;
102
	private boolean 					mustTilePrint = true;
103
	private final int 					maxTileDrawWidth = -1;
104
	private final int 					maxTileDrawHeight = -1;
105
	private final int 					maxTilePrintWidth = 1200;
106
	private final int 					maxTilePrintHeight = 1200;
107 107
    
108
    public URL host;
109
    public String m_Format;
108
    public URL 							host;
109
    public String 						m_Format;
110 110
    
111
	private String m_SRS;
112
	private String layerQuery;
113
	private String infoLayerQuery;
114
	private FMapWMSDriver wms;
115
	private WMSStatus wmsStatus = new WMSStatus();
116
	private Rectangle2D fullExtent;
117
	private boolean wmsTransparency;
118
    private Vector styles;
119
    private Vector dimensions;
111
	private String 						m_SRS;
112
	private String 						layerQuery;
113
	private String 						infoLayerQuery;
114
	private FMapWMSDriver 				wms;
115
	private WMSStatus 					wmsStatus = new WMSStatus();
116
	private Rectangle2D 				fullExtent;
117
	private boolean						wmsTransparency;
118
    private Vector 						styles;
119
    private Vector 						dimensions;
120 120
	private StatusRasterInterface		status = null;
121 121
	private int 						posX = 0, posY = 0;
122 122
	private double 						posXWC = 0, posYWC = 0;
......
128 128
	private int 						transparency = -1;
129 129
	private int 						rband = 0, gband = 1, bband = 2;
130 130
	private RasterFilterStackManager	stackManager = null;
131
	private Hashtable onlineResources = new Hashtable();
132
	private Dimension fixedSize;
133
	private boolean queryable = true;
131
	private Hashtable 					onlineResources = new Hashtable();
132
	private Dimension 					fixedSize;
133
	private boolean 					queryable = true;
134
	private VisualStatusWMS				visualStatus = new VisualStatusWMS();
135
	
136
	/**
137
	 * Clase que contiene los datos de visualizaci?n de WMS.
138
	 * @author Nacho Brodin (brodin_ign@gva.es)
139
	 */
140
	private class VisualStatusWMS{
141
		/**
142
		 * Ancho y alto de la imagen o del conjunto de tiles si los tiene. Coincide con 
143
		 * el ancho y alto del viewPort
144
		 */
145
		private	int							width = 0, height = 0;
146
		private double						minX = 0D, minY = 0D, maxX = 0D, maxY = 0D;
147
	}
148
	 
134 149

  
135

  
136

  
137 150
	/**
138
	 * Devuelve el XMLEntity con la informacin necesaria para reproducir la
151
	 * Devuelve el XMLEntity con la informaci?n necesaria para reproducir la
139 152
	 * capa.
140 153
	 *
141 154
	 * @return XMLEntity.
......
434 447
			Point2D p = viewPort.getOffset();
435 448
			// p will be (0, 0) when drawing a view or other when painting onto
436 449
			// the Layout.
437
			
450
			visualStatus.width =  viewPort.getImageWidth();
451
			visualStatus.height =  viewPort.getImageHeight();
452
			visualStatus.minX = viewPort.getAdjustedExtent().getMinX();
453
			visualStatus.minY = viewPort.getAdjustedExtent().getMinY();
454
			visualStatus.maxX = viewPort.getAdjustedExtent().getMaxX();
455
			visualStatus.maxY = viewPort.getAdjustedExtent().getMaxY();
438 456
			if (isSizeFixed()) {
439 457
				// This condition handles those situations in which the server can
440 458
				// only give static extent and resolution maps despite we need
......
581 599
	}
582 600

  
583 601
	/**
584
	 * Obtiene la extensi�n del fichero de georreferenciaci�n
602
	 * Obtiene la extensi?n del fichero de georreferenciaci?n
585 603
	 * @return String con la extensi�n del fichero de georreferenciaci�n dependiendo
586 604
	 * del valor del formato obtenido del servidor. Por defecto asignaremos un .wld 
587 605
	 */
......
595 613
	}
596 614
	
597 615
	/**
598
	 * Calcula el contenido del fichero de georreferenciacin de una imagen.
599
	 * @param bBox Tama�o y posici�n de la imagen (en coordenadas de usuario)
600
	 * @param sz Tama�o de la imagen en p�xeles.
616
	 * Calcula el contenido del fichero de georreferenciaci?n de una imagen.
617
	 * @param bBox Tama?o y posici?n de la imagen (en coordenadas de usuario)
618
	 * @param sz Tama?o de la imagen en pixeles.
601 619
	 * @return el 'WorldFile', como String.
602 620
	 * @throws IOException
603 621
	 */
......
613 631
	}
614 632
		
615 633
	/**
616
	 * Dibuja una imgen usando PxRaster
634
	 * Dibuja una imagen usando PxRaster
617 635
	 * @param g	Graphics2D en el que hay que dibujar.
618
	 * @param vpData Par�metros de visualizaci�n
619
	 * @param file La im�gen en cuesti�n.
636
	 * @param vpData Par?metros de visualizaci?n
637
	 * @param file La imagen en cuesti?n.
620 638
	 */
621 639
	private void rasterProcess(Graphics2D g, ViewPortData vpData, File file) {
622 640
		
......
753 771
	}
754 772

  
755 773
	/**
756
	 * Devuelve la informacin de la consulta.
774
	 * Devuelve la informaci?n de la consulta.
757 775
	 *
758 776
	 * @return String.
759 777
	 */
......
925 943
	 * @see com.iver.cit.gvsig.fmap.layers.RasterOperations#getHeight()
926 944
	 */
927 945
	public double getHeight() {
928
		if(getGeoRasterFile() != null)
929
			return getGeoRasterFile().getHeight();
930
        return 0;
946
		return visualStatus.height;
931 947
	}
932 948
	
933 949
	/* (non-Javadoc)
934 950
	 * @see com.iver.cit.gvsig.fmap.layers.RasterOperations#getMaxX()
935 951
	 */
936 952
	public double getMaxX() {
937
		if(getPxRaster() != null)
938
			return getPxRaster().getExtent().getMax().getX();
939
        return 0;
953
		return visualStatus.maxX;
940 954
	}
941 955
	
942 956
	/* (non-Javadoc)
943 957
	 * @see com.iver.cit.gvsig.fmap.layers.RasterOperations#getMaxY()
944 958
	 */
945 959
	public double getMaxY() {
946
		if(getPxRaster() != null)
947
			return getPxRaster().getExtent().getMax().getY();
948
        return 0;
960
		return visualStatus.maxY;
949 961
	}
950 962
	
951 963
	/* (non-Javadoc)
952 964
	 * @see com.iver.cit.gvsig.fmap.layers.RasterOperations#getMinX()
953 965
	 */
954 966
	public double getMinX() {
955
		if(getPxRaster() != null)
956
			return getPxRaster().getExtent().getMin().getX();
957
        return 0;
967
		return visualStatus.minX;
958 968
	}
959 969
	
960 970
	/* (non-Javadoc)
961 971
	 * @see com.iver.cit.gvsig.fmap.layers.RasterOperations#getMinY()
962 972
	 */
963 973
	public double getMinY() {
964
		if(getPxRaster() != null)
965
			return getPxRaster().getExtent().getMin().getY();
966
        return 0;
974
		return visualStatus.minY;
967 975
	}
968 976
	/* (non-Javadoc)
969 977
	 * @see com.iver.cit.gvsig.fmap.layers.RasterOperations#getPixel(double, double)
......
983 991
	 * @see com.iver.cit.gvsig.fmap.layers.RasterOperations#getWidth()
984 992
	 */
985 993
	public double getWidth() {
986
		if(getGeoRasterFile() != null)
987
			return getGeoRasterFile().getWidth();
988
        return 0;
994
		return visualStatus.width;
989 995
	}
990 996
	/* (non-Javadoc)
991 997
	 * @see com.iver.cit.gvsig.fmap.layers.RasterOperations#setBand(int, int)
branches/v05/extensions/extWMS/src/com/iver/cit/gvsig/gui/dialogs/WMSRasterPropsDialog.java
254 254
		    props[4][1] = type;
255 255
			props[5][0] = new String(PluginServices.getText(this,"coor_geograficas"));
256 256
			props[6][0] = new String(PluginServices.getText(this,"xmin"));
257
			props[6][1] = String.valueOf(px.getExtent().minX());
257
			props[6][1] = String.valueOf(fLayer.getMinX());
258 258
			props[7][0] = new String(PluginServices.getText(this,"ymin"));
259
			props[7][1] = String.valueOf(px.getExtent().minY());
259
			props[7][1] = String.valueOf(fLayer.getMinY());
260 260
			props[8][0] = new String(PluginServices.getText(this,"xmax"));
261
			props[8][1] = String.valueOf(px.getExtent().maxX());
261
			props[8][1] = String.valueOf(fLayer.getMaxX());
262 262
			props[9][0] = new String(PluginServices.getText(this,"ymax"));
263
			props[9][1] = String.valueOf(px.getExtent().maxY());
263
			props[9][1] = String.valueOf(fLayer.getMaxY());
264 264
			
265 265
		}else{
266 266
			props = new Object[1][2];

Also available in: Unified diff