Revision 982

View differences:

org.gvsig.raster.tools/trunk/org.gvsig.raster.tools/org.gvsig.raster.tools.app/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/InfoPanel.java
39 39
import org.gvsig.fmap.dal.coverage.store.props.Metadata;
40 40
import org.gvsig.gui.beans.panelGroup.panels.AbstractPanel;
41 41
import org.gvsig.raster.fmap.layers.FLyrRaster;
42
import org.gvsig.raster.impl.store.properties.SimpleProviderHistogramComputer;
42 43
import org.gvsig.utils.swing.JComboBox;
44
import org.slf4j.Logger;
45
import org.slf4j.LoggerFactory;
43 46

  
44 47
/**
45 48
 * Panel de informaci?n sobre raster. La informaci?n que aparece en este panel
......
81 84
 *
82 85
 */
83 86
public class InfoPanel extends AbstractPanel {
84
	private static final long serialVersionUID = -3764465947289974528L;
85
	private final String      bgColor0        = "\"#FEEDD6\""; // light salmon
86
	private final String      bgColor1        = "\"#EAEAEA\""; // light grey
87
	private final String      bgColor3        = "\"#FBFFE1\""; // light yellow
88
	private final String      bgColor4        = "\"#D6D6D6\""; // Gris
89
	private final String      bgColorBody     = "\"#FFFFFF\""; // white
87
	private static final long   serialVersionUID  = -3764465947289974528L;
88
	private static final Logger logger            = LoggerFactory.getLogger(SimpleProviderHistogramComputer.class);
89
	private final String        bgColor0          = "\"#FEEDD6\""; // light salmon
90
	private final String        bgColor1          = "\"#EAEAEA\""; // light grey
91
	private final String        bgColor3          = "\"#FBFFE1\""; // light yellow
92
	private final String        bgColor4          = "\"#D6D6D6\""; // Gris
93
	private final String        bgColorBody       = "\"#FFFFFF\""; // white
90 94

  
91
	private JScrollPane       jScrollPane     = null;
92
	public JEditorPane        jEditorPane     = null;
93
	private JComboBox         jComboBox       = null;
94
	private int               selectedDataSet = 0;
95
	private boolean           jComboBoxEvent  = false;
95
	private JScrollPane         jScrollPane       = null;
96
	public JEditorPane          jEditorPane       = null;
97
	private JComboBox           jComboBox         = null;
98
	private int                 selectedDataSet   = 0;
99
	private boolean             jComboBoxEvent    = false;
96 100
	/**
97 101
	 * Cabecera de las columnas del dialogo
98 102
	 */
99
	public Object[]           columnNames     = { "Propiedad", "Valor" };
100
	private FLyrRaster        lyr             = null;
103
	public Object[]             columnNames       = { "Propiedad", "Valor" };
104
	private FLyrRaster          lyr               = null;
101 105
	/**
102 106
	 * Booleano que est? a true cuando la fila a dibujar es par y a false cuando
103 107
	 * es impar.
104 108
	 */
105
	private boolean           rowColor        = true;
106
	private RasterManager     rManager        = null;
109
	private boolean             rowColor          = true;
110
	private RasterManager       rManager          = null;
107 111

  
108 112
	/**
109 113
	 * This is the default constructor
......
378 382

  
379 383
			data = "";
380 384
			try {
381
				int count = lyr.getDataStore().getOverviewCountByProvider(j)[selectedDataSet];
385
				int count = lyr.getDataStore().getOverviewCount(j);
382 386
				if (count > 0) {
383 387
					for (int i = 0; i < count; i++) {
384
						if (!data.equals(""))
385
							data += ", ";
386
						data += lyr.getDataStore().getOverviewSizeByProvider(j, i)[selectedDataSet];
388
						int w = lyr.getDataStore().getOverviewWidth(j, i);
389
						int h = lyr.getDataStore().getOverviewHeight(j, i);
390
						if(w != 0 && h != 0)
391
							data += i + ": " + "(" + w + "X" + h + ")<BR>";
387 392
					}
388 393
					propiedades += setHTMLBasicProperty("Overviews", data);
389 394
				}
390 395
			} catch (BandAccessException e) {
391
				// No se obtiene el contador de overviews
396
				logger.info("Error reading overviews", e);
397
			} catch (RasterDriverException e) {
398
				logger.info("Error reading overviews", e);
392 399
			}
393 400
		}
394 401

  
org.gvsig.raster.cache/trunk/org.gvsig.raster.cache/org.gvsig.raster.cache.lib.impl/src/main/java/org/gvsig/raster/cache/tile/impl/provider/DefaultCacheStruct.java
221 221
	 * @see org.gvsig.raster.cache.tile.provider.CacheStruct#getLayerWidthOfTileMatrixByLevel(int)
222 222
	 */
223 223
	public int getLayerWidthOfTileMatrixByLevel(int level) {
224
		TileMatrixLimits l = limits.get(level);
225
		return l.getMaxTileRow() - l.getMinTileRow();
224
		if(level < limits.size()) {
225
			TileMatrixLimits l = limits.get(level);
226
			return (l.getMaxTileRow() - l.getMinTileRow()) + 1;
227
		}
228
		return 0;
226 229
	}
227 230
	
228 231
	/*
......
230 233
	 * @see org.gvsig.raster.cache.tile.provider.CacheStruct#getLayerHeightOfTileMatrixByLevel(int)
231 234
	 */
232 235
	public int getLayerHeightOfTileMatrixByLevel(int level) {
233
		TileMatrixLimits l = limits.get(level);
234
		return l.getMaxTileCol() - l.getMinTileCol();
236
		if(level < limits.size()) {
237
			TileMatrixLimits l = limits.get(level);
238
			return (l.getMaxTileCol() - l.getMinTileCol()) + 1;
239
		}
240
		return 0;
235 241
	}
236 242

  
237 243
	/*
org.gvsig.raster.tilecache/trunk/org.gvsig.raster.tilecache/org.gvsig.raster.tilecache.io/src/main/java/org/gvsig/raster/tilecache/io/TileProvider.java
849 849
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getOverviewWidth(int, int)
850 850
	 */
851 851
	public int getOverviewWidth(int band, int overview) throws BandAccessException, RasterDriverException {
852
		return 0;
852
		return provider.getTileServer().getStruct().getLayerWidthOfTileMatrixByLevel(overview) * 
853
				provider.getTileServer().getStruct().getTileSizeByLevel(overview)[0];
853 854
	}
854 855

  
855 856
	/*
......
857 858
	 * @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getOverviewHeight(int, int)
858 859
	 */
859 860
	public int getOverviewHeight(int band, int overview) throws BandAccessException, RasterDriverException {
860
		return 0;
861
		return provider.getTileServer().getStruct().getLayerHeightOfTileMatrixByLevel(overview) * 
862
				provider.getTileServer().getStruct().getTileSizeByLevel(overview)[0];
861 863
	}
862 864

  
863 865
	/*

Also available in: Unified diff