Hello,
I am working with GeoTools 2.7 M3 and I want to draw simple shapes over
map without redrawing the map context (this is because the map is not
repainted very often but the painted shapes are). I used GlassPane, but the
map context repaint GlassPane every time - it means, that my glass pane was
under the painted map. Do anybody know, what to do with it? I need my shapes
(I am drawing them into the GlassPane) above the map. I am sending a code
snipet for example.
The GlassPane class:
public class MyGlassPane extends JComponent {
public MyGlassPane() {
setOpaque(false);
}
protected void paintComponent(Graphics g) {
g.setColor(Color.BLACK);
g.fillRect(0, 0, 150, 150);
g.fillRect(150, 150, 150, 150);
g.fillRect(300, 300, 150, 150);
}
The class which is responsible for loading map, setting map options, adding
layers into map etc. :
public class GeoViewer {
.
.
.
final MapContext map = new DefaultMapContext();
map.setTitle("GeoViewer");
map.addLayer(reader, rasterStyle);
.
.
.
frame = new MyFrame(map);
frame.setSize(800, 600);
frame.setVisible(true);
MyGlassPane glassPane = new MyGlassPane();
frame.setGlassPane(glassPane);
.
.
.
this.frame.getMapPane().addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
frame.getGlassPane().setVisible(true);
}
}
}
Thanks for any respons.
Regards Stepan
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users