Ignore:
Timestamp:
2008-12-25T19:01:06+01:00 (16 years ago)
Author:
stoecker
Message:

updated a lot

Location:
applications/editors/josm/plugins/agpifoj
Files:
5 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/agpifoj/build.xml

    r10439 r12588  
    4949        <attribute name="Plugin-Early" value="false" />
    5050        <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
     51        <attribute name="Plugin-Mainversion" value="1180"/>
    5152        <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
    5253      </manifest>
  • applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/AgpifojDialog.java

    r10258 r12588  
    2222import org.openstreetmap.josm.plugins.agpifoj.AgpifojLayer.ImageEntry;
    2323import org.openstreetmap.josm.tools.ImageProvider;
     24import org.openstreetmap.josm.tools.Shortcut;
    2425
    2526public class AgpifojDialog extends ToggleDialog implements ActionListener {
     
    4546
    4647    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
    4950        if (INSTANCE != null) {
    5051            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  
    2323import org.openstreetmap.josm.Main;
    2424import org.openstreetmap.josm.actions.JosmAction;
     25import org.openstreetmap.josm.gui.IconToggleButton;
    2526import org.openstreetmap.josm.gui.MapFrame;
     27import org.openstreetmap.josm.gui.MainMenu;
    2628import org.openstreetmap.josm.gui.layer.Layer;
    2729import org.openstreetmap.josm.plugins.Plugin;
     
    3537                  "agpifoj-open",
    3638                  tr("Load set of images as a new layer."),
    37                   0, 0, false);
     39                  null, false);
    3840        }
    3941
     
    8284
    8385    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());
    10687    }
    10788
     
    11394    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
    11495        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            
    12296            AgpifojDialog dialog = AgpifojDialog.getInstance();
    123             newFrame.addToggleDialog(dialog);
    124        
     97            IconToggleButton b = newFrame.addToggleDialog(dialog);
     98
    12599            boolean found = false;
    126100            for (Layer layer : newFrame.mapView.getAllLayers()) {
     
    130104                }
    131105            }
    132             JToolBar tb = newFrame.toolBarActions;
    133             ((JToggleButton) tb.getComponent(tb.getComponentCount() - 1)).getModel().setSelected(found);
    134        
     106            b.setSelected(found);
    135107        } else {
    136108            AgpifojDialog.getInstance().displayImage(null, null);
Note: See TracChangeset for help on using the changeset viewer.