source: osm/applications/editors/josm/plugins/scripting/scripts/HelloWorld.py@ 25107

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

Updated sample scripts

File size: 475 bytes
Line 
1#
2# HelloWorld.py - displays the number of actually open layers
3#
4from javax.swing import JOptionPane
5from org.openstreetmap.josm import Main
6
7def getMapView():
8 if Main.main == None:
9 return None
10 if Main.main.map == None:
11 return None
12 return Main.main.map.mapView
13
14
15numlayers = 0
16mv = getMapView()
17if mv != None:
18 numlayers = mv.getNumLayers()
19
20JOptionPane.showMessageDialog(Main.parent, "[Python] Hello World! You have %s layer(s)." % numlayers)
Note: See TracBrowser for help on using the repository browser.