Revision 7836 trunk/extensions/extWMS/src/com/iver/cit/gvsig/fmap/layers/FLyrWMS.java
FLyrWMS.java | ||
---|---|---|
43 | 43 |
import java.awt.Component; |
44 | 44 |
import java.awt.Dimension; |
45 | 45 |
import java.awt.Graphics2D; |
46 |
import java.awt.Image; |
|
46 | 47 |
import java.awt.Point; |
47 | 48 |
import java.awt.Rectangle; |
48 | 49 |
import java.awt.geom.AffineTransform; |
... | ... | |
64 | 65 |
import java.util.Map; |
65 | 66 |
import java.util.Vector; |
66 | 67 |
|
68 |
import javax.imageio.ImageIO; |
|
67 | 69 |
import javax.swing.ImageIcon; |
68 | 70 |
import javax.swing.JOptionPane; |
69 | 71 |
|
... | ... | |
93 | 95 |
import com.iver.cit.gvsig.fmap.drivers.wms.FMapWMSDriverFactory; |
94 | 96 |
import com.iver.cit.gvsig.fmap.drivers.wms.WMSException; |
95 | 97 |
import com.iver.cit.gvsig.fmap.layers.WMSLayerNode.FMapWMSStyle; |
98 |
import com.iver.cit.gvsig.fmap.layers.layerOperations.IHasImageLegend; |
|
96 | 99 |
import com.iver.cit.gvsig.fmap.layers.layerOperations.InfoByPoint; |
97 | 100 |
import com.iver.cit.gvsig.fmap.layers.layerOperations.StringXMLItem; |
98 | 101 |
import com.iver.cit.gvsig.fmap.layers.layerOperations.XMLItem; |
... | ... | |
111 | 114 |
* Nacho Brodin |
112 | 115 |
* |
113 | 116 |
*/ |
114 |
public class FLyrWMS extends FLyrDefault implements InfoByPoint, RasterOperations { |
|
117 |
public class FLyrWMS extends FLyrDefault implements InfoByPoint, RasterOperations, IHasImageLegend {
|
|
115 | 118 |
private boolean isPrinting = false; |
116 | 119 |
private boolean mustTileDraw = true; |
117 | 120 |
private boolean mustTilePrint = true; |
... | ... | |
1717 | 1720 |
return mustTileDraw; |
1718 | 1721 |
} |
1719 | 1722 |
|
1723 |
public Image getImageLegend() { |
|
1724 |
try { |
|
1725 |
File legend = getDriver().getLegendGraphic(layerQuery, null); |
|
1726 |
Image img = null; |
|
1727 |
img = ImageIO.read(legend); |
|
1728 |
return img; |
|
1729 |
}catch(Exception e){ |
|
1730 |
e.printStackTrace(); |
|
1731 |
return null; |
|
1732 |
} |
|
1733 |
} |
|
1720 | 1734 |
|
1735 |
|
|
1721 | 1736 |
} |
Also available in: Unified diff