208 |
208 |
}
|
209 |
209 |
}
|
210 |
210 |
|
211 |
|
/*
|
212 |
|
* (non-Javadoc)
|
213 |
|
* @see org.gvsig.fmap.mapcontext.layers.operations.SingleLayer#setDataStore(org.gvsig.fmap.dal.DataStore)
|
214 |
|
*/
|
215 |
211 |
public void setDataStore(DataStore dataStore) throws LoadLayerException {
|
216 |
212 |
this.dataStore = (RasterDataStore) dataStore;
|
217 |
213 |
try {
|
... | ... | |
246 |
242 |
return (String)formats.get(0);
|
247 |
243 |
}
|
248 |
244 |
|
249 |
|
/*
|
250 |
|
* (non-Javadoc)
|
251 |
|
* @see org.gvsig.raster.fmap.layers.DefaultFLyrRaster#loadFromState(org.gvsig.tools.persistence.PersistentState)
|
252 |
|
*/
|
253 |
245 |
@Override
|
254 |
246 |
public void loadFromState(PersistentState state)
|
255 |
247 |
throws PersistenceException {
|
... | ... | |
282 |
274 |
this.colorTableLoadedFromProject = null;
|
283 |
275 |
}
|
284 |
276 |
|
285 |
|
/*
|
286 |
|
* (non-Javadoc)
|
287 |
|
* @see org.gvsig.raster.fmap.layers.DefaultFLyrRaster#saveToState(org.gvsig.tools.persistence.PersistentState)
|
288 |
|
*/
|
289 |
277 |
@Override
|
290 |
278 |
public void saveToState(PersistentState state) throws PersistenceException {
|
291 |
279 |
super.saveToState(state);
|
... | ... | |
319 |
307 |
definition.addDynFieldString("name").setMandatory(false);
|
320 |
308 |
}
|
321 |
309 |
|
322 |
|
/*
|
323 |
|
* (non-Javadoc)
|
324 |
|
* @see org.gvsig.raster.fmap.layers.DefaultFLyrRaster#draw(java.awt.image.BufferedImage, java.awt.Graphics2D, org.gvsig.fmap.mapcontext.ViewPort, org.gvsig.tools.task.Cancellable, double)
|
325 |
|
*/
|
326 |
310 |
public void draw(BufferedImage image, Graphics2D g, ViewPort viewPort,
|
327 |
311 |
Cancellable cancel, double scale) throws ReadException {
|
328 |
312 |
TaskStatusManager manager = ToolsLocator.getTaskStatusManager();
|
... | ... | |
333 |
317 |
if(!firstLoad) {
|
334 |
318 |
try {
|
335 |
319 |
initFilters();
|
|
320 |
try {
|
|
321 |
if(!isOpen())
|
|
322 |
enableOpen();
|
|
323 |
} catch (NotAvailableStateException e) {
|
|
324 |
throw new ReadException("Fallo el estado de open. Closed=" + isClosed() + " Awake=" + isAwake(), e);
|
|
325 |
}
|
336 |
326 |
} catch (FilePaletteException e) {
|
337 |
327 |
logger.error(e.getMessage(), this, e);
|
338 |
328 |
}
|
... | ... | |
724 |
714 |
return "icon-layer-wms";
|
725 |
715 |
}
|
726 |
716 |
|
727 |
|
/*
|
728 |
|
* (non-Javadoc)
|
729 |
|
* @see com.iver.cit.gvsig.fmap.layers.RasterOperations#getTileSize()
|
730 |
|
*/
|
731 |
717 |
public int[] getTileSize() {
|
732 |
718 |
int[] size = {maxTileDrawWidth, maxTileDrawHeight};
|
733 |
719 |
return size;
|
734 |
720 |
}
|
735 |
721 |
|
736 |
|
/*
|
737 |
|
* (non-Javadoc)
|
738 |
|
* @see com.iver.cit.gvsig.fmap.layers.RasterOperations#isTiled()
|
739 |
|
*/
|
740 |
722 |
public boolean isTiled() {
|
741 |
723 |
return mustTileDraw;
|
742 |
724 |
}
|
743 |
725 |
|
744 |
|
/* (non-Javadoc)
|
745 |
|
* @see com.iver.cit.gvsig.fmap.layers.FLayer#newComposedLayer()
|
746 |
|
*/
|
747 |
726 |
public ComposedLayer newComposedLayer() {
|
748 |
727 |
Preferences prefs = Preferences.userRoot().node("gvsig.wms");
|
749 |
728 |
|
... | ... | |
831 |
810 |
return true;
|
832 |
811 |
}
|
833 |
812 |
|
834 |
|
/*
|
835 |
|
* (non-Javadoc)
|
836 |
|
* @see org.gvsig.fmap.raster.layers.FLyrRasterSE#isActionEnabled(int)
|
837 |
|
*/
|
838 |
813 |
public boolean isActionEnabled(int action) {
|
839 |
814 |
switch (action) {
|
840 |
815 |
case IRasterLayerActions.ZOOM_PIXEL_RESOLUTION:
|
... | ... | |
857 |
832 |
return super.isActionEnabled(action);
|
858 |
833 |
}
|
859 |
834 |
|
860 |
|
/*
|
861 |
|
* (non-Javadoc)
|
862 |
|
* @see org.gvsig.fmap.raster.layers.FLyrRasterSE#getLegend()
|
863 |
|
*/
|
864 |
835 |
public ILegend getLegend() {
|
865 |
836 |
if(getDataStore() != null)
|
866 |
837 |
return new ImageLegend(getDataStore().getImageLegend());
|
867 |
838 |
return null;
|
868 |
839 |
}
|
869 |
840 |
|
870 |
|
/*
|
871 |
|
* (non-Javadoc)
|
872 |
|
* @see org.gvsig.raster.fmap.layers.FLyrRaster#isRemote()
|
873 |
|
*/
|
874 |
841 |
public boolean isRemote() {
|
875 |
842 |
return true;
|
876 |
843 |
}
|
877 |
844 |
|
878 |
|
/*
|
879 |
|
* (non-Javadoc)
|
880 |
|
* @see org.gvsig.fmap.raster.layers.FLyrRasterSE#overviewsSupport()
|
881 |
|
*/
|
882 |
845 |
public boolean overviewsSupport() {
|
883 |
846 |
return false;
|
884 |
847 |
}
|
... | ... | |
948 |
911 |
return null;
|
949 |
912 |
}
|
950 |
913 |
|
951 |
|
/*
|
952 |
|
* (non-Javadoc)
|
953 |
|
* @see org.gvsig.raster.fmap.layers.FLyrRaster#getFileFormat()
|
954 |
|
*/
|
955 |
914 |
@Override
|
956 |
915 |
public String getFileFormat() {
|
957 |
916 |
return "WMS";
|
958 |
917 |
}
|
959 |
918 |
|
960 |
|
/*
|
961 |
|
* (non-Javadoc)
|
962 |
|
* @see org.gvsig.raster.fmap.layers.DefaultFLyrRaster#getFileLayer()
|
963 |
|
*/
|
964 |
919 |
@Override
|
965 |
920 |
public FLayer getFileLayer() throws RasterDriverException {
|
966 |
921 |
/*if(getDataStore() instanceof DefaultRemoteRasterStore) {
|
... | ... | |
1023 |
978 |
|
1024 |
979 |
}
|
1025 |
980 |
|
1026 |
|
/*
|
1027 |
|
* (non-Javadoc)
|
1028 |
|
* @see org.gvsig.raster.fmap.layers.FLyrRaster#getFullRasterExtent()
|
1029 |
|
*/
|
1030 |
981 |
public Extent getFullRasterExtent() {
|
1031 |
982 |
return getExtentFromEnvelope(getFullEnvelope());
|
1032 |
983 |
}
|
... | ... | |
1189 |
1140 |
return this.explorer;
|
1190 |
1141 |
}
|
1191 |
1142 |
|
1192 |
|
/*
|
1193 |
|
* (non-Javadoc)
|
1194 |
|
* @see org.gvsig.fmap.mapcontext.layers.FLyrDefault#cloneLayer()
|
1195 |
|
*/
|
1196 |
1143 |
public FLayer cloneLayer() throws Exception {
|
1197 |
1144 |
RasterDataStore ds = dataStore.cloneDataStore();
|
1198 |
1145 |
FLyrWMS newLayer = new FLyrWMS();
|