Ignore:
Timestamp:
2011-01-16T19:47:42+01:00 (15 years ago)
Author:
guggis
Message:

Updated sample scripts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/scripting/scripts/HelloWorld.groovy

    r25071 r25083  
     1/*
     2 * HelloWorld.groovy - displays the number of actually open layers
     3 */
    14import javax.swing.JOptionPane;
    25import org.openstreetmap.josm.Main;
    36
     7def numlayers = Main.main?.map?.mapView?.numLayers
     8if (numlayers == null) numlayers = 0
    49
    5 JOptionPane.showMessageDialog(Main.parent, "[Groovy] Hello World!")
     10JOptionPane.showMessageDialog(Main.parent, "[Groovy] Hello World!\nYou have ${numlayers} layer(s).")
Note: See TracChangeset for help on using the changeset viewer.