assertTrue(service.getGeometry() != null);
assertEquals("sphere", ((GeometryMapTree) service.getGeometry()).getBase());
// then download the first texture map tile and heightfield map tile
GeometryMapTree geometry = (GeometryMapTree) service.getGeometry();
geometry.addListener(new DownloadFinishedListener() {
public void downloadFinished(DownloadFinishedData dfd) {
synchronized(sl) {
sl.notifyAll();
}
}
public void downloadFailed(DownloadFinishedData dfd, Exception e) {
InfoWindow.showError(e);
synchronized(sl) {
sl.notifyAll();
}
}
});
geometry.download();
synchronized(sl) {
sl.wait();
}
BufferedImage heightfieldImage = geometry.getHeightfield().getImg();
assertEquals(BufferedImage.TYPE_USHORT_GRAY, geometry.getHeightfield().getImg().getType());
assertEquals(63234, heightfieldImage.getData().getSample(50, 50, 0));
assertEquals(256, geometry.getTexture().getImg().getWidth());
assertEquals(256, geometry.getHeightfield().getImg().getWidth());
// JFrame imgWindow = new JFrame();
// JLabel label = new JLabel();
// imgWindow.getContentPane().add(label);
// label.setIcon(new ImageIcon(geometry.getHeightfield().getImg()));