source: osm/applications/editors/josm/plugins/scripting/scripts/HelloWorld.groovy@ 25374

Last change on this file since 25374 was 25083, checked in by guggis, 14 years ago

Updated sample scripts

File size: 344 bytes
Line 
1/*
2 * HelloWorld.groovy - displays the number of actually open layers
3 */
4import javax.swing.JOptionPane;
5import org.openstreetmap.josm.Main;
6
7def numlayers = Main.main?.map?.mapView?.numLayers
8if (numlayers == null) numlayers = 0
9
10JOptionPane.showMessageDialog(Main.parent, "[Groovy] Hello World!\nYou have ${numlayers} layer(s).")
Note: See TracBrowser for help on using the repository browser.