source: osm/applications/editors/josm/plugins/waypoints/src/WaypointPlugin.java@ 6491

Last change on this file since 6491 was 1495, checked in by nick, 18 years ago

New waypoint import plugin for JOSM

File size: 722 bytes
Line 
1package waypoints;
2
3import java.awt.Component;
4import javax.swing.JMenuItem;
5import javax.swing.JSeparator;
6
7import org.openstreetmap.josm.Main;
8import org.openstreetmap.josm.plugins.Plugin;
9
10public class WaypointPlugin extends Plugin {
11
12
13 public WaypointPlugin() {
14 JMenuItem waypointItem = new JMenuItem(new WaypointOpenAction());
15 int index = findFirstSeparator();
16 Main.main.menu.fileMenu.add(waypointItem,index<0 ? 0: index);
17 }
18
19 private int findFirstSeparator()
20 {
21 Component[] components = Main.main.menu.fileMenu.getMenuComponents();
22 for(int count=0; count<components.length; count++)
23 {
24 if(components[count] instanceof JSeparator)
25 return count;
26 }
27 return -1;
28 }
29}
Note: See TracBrowser for help on using the repository browser.