Changeset 12588 in osm for applications/editors/josm/plugins/agpifoj
- Timestamp:
- 2008-12-25T19:01:06+01:00 (16 years ago)
- Location:
- applications/editors/josm/plugins/agpifoj
- Files:
-
- 5 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/agpifoj/build.xml
r10439 r12588 49 49 <attribute name="Plugin-Early" value="false" /> 50 50 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> 51 <attribute name="Plugin-Mainversion" value="1180"/> 51 52 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/> 52 53 </manifest> -
applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/AgpifojDialog.java
r10258 r12588 22 22 import org.openstreetmap.josm.plugins.agpifoj.AgpifojLayer.ImageEntry; 23 23 import org.openstreetmap.josm.tools.ImageProvider; 24 import org.openstreetmap.josm.tools.Shortcut; 24 25 25 26 public class AgpifojDialog extends ToggleDialog implements ActionListener { … … 45 46 46 47 private AgpifojDialog() { 47 super(tr("AgPifoJ - Geotagged pictures"), "agpifoj", tr("Display geotagged photos"), KeyEvent.VK_Y, 200);48 48 super(tr("AgPifoJ - Geotagged pictures"), "agpifoj", tr("Display geotagged photos"), Shortcut.registerShortcut("tools:geotagged", tr("Tool: {0}", tr("Display geotagged photos")), KeyEvent.VK_Y, Shortcut.GROUP_EDIT), 200); 49 49 50 if (INSTANCE != null) { 50 51 throw new IllegalStateException("Agpifoj dialog should not be instanciated twice !"); -
applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/AgpifojPlugin.java
r10122 r12588 23 23 import org.openstreetmap.josm.Main; 24 24 import org.openstreetmap.josm.actions.JosmAction; 25 import org.openstreetmap.josm.gui.IconToggleButton; 25 26 import org.openstreetmap.josm.gui.MapFrame; 27 import org.openstreetmap.josm.gui.MainMenu; 26 28 import org.openstreetmap.josm.gui.layer.Layer; 27 29 import org.openstreetmap.josm.plugins.Plugin; … … 35 37 "agpifoj-open", 36 38 tr("Load set of images as a new layer."), 37 0, 0, false);39 null, false); 38 40 } 39 41 … … 82 84 83 85 public AgpifojPlugin() { 84 85 JMenuBar menu = Main.main.menu; 86 JMenu view = null; 87 JMenuItem agpifojMenu = new JMenuItem(new Action()); 88 89 for (int i = 0; i < menu.getMenuCount(); ++i) { 90 if (menu.getMenu(i) != null 91 && tr("File").equals(menu.getMenu(i).getText())) { 92 view = menu.getMenu(i); 93 break; 94 } 95 } 96 97 if (view != null) { 98 view.insert(agpifojMenu, 2); 99 100 } else if (menu.getMenuCount() > 0) { 101 view = menu.getMenu(0); 102 view.insert(agpifojMenu, 0); 103 } 104 105 agpifojMenu.setVisible(true); 86 MainMenu.add(Main.main.menu.fileMenu, new Action()); 106 87 } 107 88 … … 113 94 public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) { 114 95 if (newFrame != null) { 115 if (newFrame.getLayout() instanceof BorderLayout) {116 newFrame.remove(newFrame.toolBarActions);117 newFrame.add(new ScrollViewport(newFrame.toolBarActions, ScrollViewport.VERTICAL_DIRECTION),118 BorderLayout.WEST);119 newFrame.repaint();120 }121 122 96 AgpifojDialog dialog = AgpifojDialog.getInstance(); 123 newFrame.addToggleDialog(dialog);124 97 IconToggleButton b = newFrame.addToggleDialog(dialog); 98 125 99 boolean found = false; 126 100 for (Layer layer : newFrame.mapView.getAllLayers()) { … … 130 104 } 131 105 } 132 JToolBar tb = newFrame.toolBarActions; 133 ((JToggleButton) tb.getComponent(tb.getComponentCount() - 1)).getModel().setSelected(found); 134 106 b.setSelected(found); 135 107 } else { 136 108 AgpifojDialog.getInstance().displayImage(null, null);
Note:
See TracChangeset
for help on using the changeset viewer.