| 1 | package UtilsPlugin;
|
|---|
| 2 |
|
|---|
| 3 | import static org.openstreetmap.josm.tools.I18n.tr;
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 | import java.awt.event.ActionEvent;
|
|---|
| 7 | import javax.swing.AbstractAction;
|
|---|
| 8 | import javax.swing.JMenuItem;
|
|---|
| 9 | import javax.swing.JOptionPane;
|
|---|
| 10 | import javax.swing.JPanel;
|
|---|
| 11 | import javax.swing.BoxLayout;
|
|---|
| 12 |
|
|---|
| 13 | import org.openstreetmap.josm.Main;
|
|---|
| 14 | import org.openstreetmap.josm.plugins.Plugin;
|
|---|
| 15 | import org.openstreetmap.josm.gui.MapFrame;
|
|---|
| 16 | import org.openstreetmap.josm.gui.MainMenu;
|
|---|
| 17 | import org.openstreetmap.josm.gui.IconToggleButton;
|
|---|
| 18 | import org.openstreetmap.josm.actions.JosmAction;
|
|---|
| 19 |
|
|---|
| 20 | public class UtilsPlugin extends Plugin {
|
|---|
| 21 | JMenuItem SimplifyWay;
|
|---|
| 22 | JMenuItem JoinAreas;
|
|---|
| 23 | JumpToAction JumpToAct = new JumpToAction();
|
|---|
| 24 |
|
|---|
| 25 | public UtilsPlugin() {
|
|---|
| 26 | SimplifyWay = MainMenu.add(Main.main.menu.toolsMenu, new SimplifyWayAction());
|
|---|
| 27 | JoinAreas = MainMenu.add(Main.main.menu.toolsMenu, new JoinAreasAction());
|
|---|
| 28 | SimplifyWay.setEnabled(false);
|
|---|
| 29 | }
|
|---|
| 30 |
|
|---|
| 31 | @Override
|
|---|
| 32 | public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
|
|---|
| 33 | if (oldFrame == null && newFrame != null) {
|
|---|
| 34 | SimplifyWay.setEnabled(true);
|
|---|
| 35 | JoinAreas.setEnabled(true);
|
|---|
| 36 | newFrame.statusLine.addMouseListener(JumpToAct);
|
|---|
| 37 | }
|
|---|
| 38 | }
|
|---|
| 39 | }
|
|---|