65 |
65 |
import java.util.Map;
|
66 |
66 |
import java.util.Vector;
|
67 |
67 |
|
68 |
|
import javax.imageio.ImageIO;
|
69 |
68 |
import javax.print.attribute.PrintRequestAttributeSet;
|
70 |
69 |
import javax.swing.ImageIcon;
|
71 |
70 |
import javax.swing.JOptionPane;
|
... | ... | |
83 |
82 |
import org.gvsig.remoteClient.wms.WMSStatus;
|
84 |
83 |
|
85 |
84 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException;
|
|
85 |
import com.hardcode.gdbms.engine.data.driver.DriverException;
|
86 |
86 |
import com.iver.andami.PluginServices;
|
87 |
87 |
import com.iver.andami.messages.NotificationManager;
|
88 |
88 |
import com.iver.cit.gvsig.exceptions.layers.ConnectionErrorLayerException;
|
... | ... | |
91 |
91 |
import com.iver.cit.gvsig.exceptions.layers.UnsupportedVersionLayerException;
|
92 |
92 |
import com.iver.cit.gvsig.exceptions.visitors.VisitorException;
|
93 |
93 |
import com.iver.cit.gvsig.fmap.ConnectionErrorExceptionType;
|
94 |
|
import com.iver.cit.gvsig.fmap.UnknownResponseFormatExceptionType;
|
95 |
|
import com.iver.cit.gvsig.fmap.UnsuportedProtocolVersionExceptionType;
|
96 |
94 |
import com.iver.cit.gvsig.fmap.ViewPort;
|
97 |
95 |
import com.iver.cit.gvsig.fmap.WMSDriverExceptionType;
|
98 |
96 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
|
... | ... | |
100 |
98 |
import com.iver.cit.gvsig.fmap.drivers.wms.FMapWMSDriverFactory;
|
101 |
99 |
import com.iver.cit.gvsig.fmap.drivers.wms.WMSException;
|
102 |
100 |
import com.iver.cit.gvsig.fmap.layers.WMSLayerNode.FMapWMSStyle;
|
|
101 |
import com.iver.cit.gvsig.fmap.layers.layerOperations.ComposedLayer;
|
103 |
102 |
import com.iver.cit.gvsig.fmap.layers.layerOperations.IHasImageLegend;
|
104 |
103 |
import com.iver.cit.gvsig.fmap.layers.layerOperations.InfoByPoint;
|
105 |
104 |
import com.iver.cit.gvsig.fmap.layers.layerOperations.StringXMLItem;
|
... | ... | |
546 |
545 |
wmsStatus.setHeight(vp.getImageHeight());
|
547 |
546 |
wmsStatus.setWidth(vp.getImageWidth());
|
548 |
547 |
wmsStatus.setOnlineResource((String) onlineResources.get("GetFeatureInfo"));
|
|
548 |
|
|
549 |
|
|
550 |
wmsStatus.setFormat( m_Format );
|
|
551 |
wmsStatus.setLayerNames(Utilities.createVector(layerQuery,","));
|
|
552 |
wmsStatus.setSrs(m_SRS);
|
|
553 |
wmsStatus.setStyles(styles);
|
|
554 |
wmsStatus.setDimensions(dimensions);
|
|
555 |
wmsStatus.setTransparency(wmsTransparency);
|
|
556 |
wmsStatus.setSrs(m_SRS);
|
549 |
557 |
MyCancellable c = new MyCancellable(cancellable);
|
550 |
558 |
item[0] = new StringXMLItem(new String(getDriver()
|
551 |
559 |
.getFeatureInfo(wmsStatus, (int) tiledPoint.getX(), (int) tiledPoint.getY(), Integer.MAX_VALUE, c)),this);
|
... | ... | |
1484 |
1492 |
* @param styles
|
1485 |
1493 |
*/
|
1486 |
1494 |
public void setStyles(Vector styles) {
|
|
1495 |
this.styles = styles;
|
1487 |
1496 |
//laura:
|
1488 |
1497 |
//layer query is built with the layer in reverse order
|
1489 |
1498 |
// so here we build the styles upside-down.
|
1490 |
|
if (styles != null)
|
1491 |
|
{
|
1492 |
|
this.styles = new Vector();
|
1493 |
|
for(int i = styles.size()-1; i>=0; i--)
|
1494 |
|
{
|
1495 |
|
this.styles.add(styles.elementAt(i));
|
1496 |
|
}
|
1497 |
|
}
|
|
1499 |
// if (styles != null)
|
|
1500 |
// {
|
|
1501 |
// this.styles = new Vector();
|
|
1502 |
// for(int i = styles.size()-1; i>=0; i--)
|
|
1503 |
// {
|
|
1504 |
// this.styles.add(styles.elementAt(i));
|
|
1505 |
// }
|
|
1506 |
// }
|
1498 |
1507 |
}
|
1499 |
1508 |
|
1500 |
1509 |
/**
|
... | ... | |
1765 |
1774 |
}
|
1766 |
1775 |
}
|
1767 |
1776 |
|
|
1777 |
/* (non-Javadoc)
|
|
1778 |
* @see com.iver.cit.gvsig.fmap.layers.FLayer#newComposedLayer()
|
|
1779 |
*/
|
|
1780 |
public ComposedLayer newComposedLayer() {
|
|
1781 |
return new ComposedLayerWMS();
|
|
1782 |
// return null;
|
|
1783 |
}
|
|
1784 |
|
|
1785 |
/**
|
|
1786 |
* @param styles
|
|
1787 |
*/
|
|
1788 |
public Vector getStyles() {
|
|
1789 |
return this.styles;
|
|
1790 |
}
|
|
1791 |
|
|
1792 |
|
|
1793 |
/* Checks if can make a single petition for
|
|
1794 |
* the two layers to the server
|
|
1795 |
*
|
|
1796 |
* @see com.iver.cit.gvsig.fmap.layers.ComposedLayerWMS#canAdd(com.iver.cit.gvsig.fmap.layers.FLayer)
|
|
1797 |
*/
|
|
1798 |
boolean isComposedLayerCompatible(FLayer layer) {
|
|
1799 |
FLyrWMS aLayer;
|
|
1800 |
|
|
1801 |
if (!(layer instanceof FLyrWMS)) {
|
|
1802 |
return false;
|
|
1803 |
}
|
|
1804 |
aLayer = (FLyrWMS)layer;
|
|
1805 |
if (!this.getHost().equals(aLayer.getHost())) {
|
|
1806 |
return false;
|
|
1807 |
}
|
|
1808 |
if (!this.getFormat().equals(aLayer.getFormat())) {
|
|
1809 |
return false;
|
|
1810 |
}
|
|
1811 |
if (!this.getSRS().equals(aLayer.getSRS())) {
|
|
1812 |
return false;
|
|
1813 |
}
|
|
1814 |
if (this.getInfoLayerQuery() != null) {
|
|
1815 |
if (!this.getInfoLayerQuery().equals(aLayer.getInfoLayerQuery())) {
|
|
1816 |
return false;
|
|
1817 |
}
|
|
1818 |
}else if (aLayer.getInfoLayerQuery() != null) {
|
|
1819 |
return false;
|
|
1820 |
}
|
|
1821 |
|
|
1822 |
|
|
1823 |
// isFixedSize es privado
|
|
1824 |
if ((this.fixedSize != null) &&
|
|
1825 |
(aLayer.fixedSize!= null)) {
|
|
1826 |
if (this.fixedSize.equals(aLayer.fixedSize)) {
|
|
1827 |
return false;
|
|
1828 |
}
|
|
1829 |
} else if ((this.fixedSize != null) != (aLayer.fixedSize != null)) {
|
|
1830 |
return false;
|
|
1831 |
}
|
|
1832 |
|
|
1833 |
// time elevation (dimensions)
|
|
1834 |
if ((this.dimensions != null) &&
|
|
1835 |
(aLayer.dimensions != null)) {
|
|
1836 |
if (this.dimensions.size() != aLayer.dimensions.size()) {
|
|
1837 |
return false;
|
|
1838 |
} else {
|
|
1839 |
Iterator iter = this.dimensions.iterator();
|
|
1840 |
while (iter.hasNext()) {
|
|
1841 |
if (!aLayer.dimensions.contains(iter.next())) {
|
|
1842 |
return false;
|
|
1843 |
}
|
|
1844 |
}
|
|
1845 |
}
|
1768 |
1846 |
|
|
1847 |
} else if ((this.dimensions != null) != (aLayer.dimensions != null)) {
|
|
1848 |
return false;
|
|
1849 |
}
|
|
1850 |
|
|
1851 |
|
|
1852 |
return true;
|
|
1853 |
|
|
1854 |
}
|
|
1855 |
|
1769 |
1856 |
}
|