Changeset 14120 in osm for applications


Ignore:
Timestamp:
2009-03-18T15:55:16+01:00 (16 years ago)
Author:
stoecker
Message:

fix the menu changes in JOSM

Location:
applications/editors/josm/plugins
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/build.xml

    r14015 r14120  
    2626                <attribute name="Plugin-Description" value="A special handler for the french land registry WMS server."/>
    2727                <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/FR:JOSM/Fr:Plugin/Cadastre"/>
    28                 <attribute name="Plugin-Mainversion" value="1465"/>
     28                <attribute name="Plugin-Mainversion" value="1498"/>
    2929                <attribute name="Plugin-Stage" value="60"/>
    3030                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java

    r13784 r14120  
    11package cadastre_fr;
    22
     3import static org.openstreetmap.josm.tools.I18n.marktr;
    34import static org.openstreetmap.josm.tools.I18n.tr;
    45
     
    1011import javax.swing.JCheckBoxMenuItem;
    1112import javax.swing.JMenu;
    12 import javax.swing.JMenuBar;
    1313import javax.swing.JMenuItem;
    1414import javax.swing.JOptionPane;
     
    2020import org.openstreetmap.josm.actions.UploadAction.UploadHook;
    2121import org.openstreetmap.josm.gui.IconToggleButton;
     22import org.openstreetmap.josm.gui.MainMenu;
    2223import org.openstreetmap.josm.gui.MapFrame;
    2324import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
     
    2627
    2728/**
    28  * 
     29 *
    2930 * Plugin to access the french Cadastre WMS server at www.cadastre.gouv.fr This
    3031 * WMS server requires some specific handling like retrieving a cookie for a
    3132 * limitation in case of no activity, or the request to the server shall provide
    3233 * a city/town/village code.
    33  * 
    34  * @author Pieren <pieren3@gmail.com>, 
     34 *
     35 * @author Pieren <pieren3@gmail.com>,
    3536 * @author <matthieu.lochegnies@gmail.com> for the extension to codeCommune
    3637 * @version 0.8
    37  * History: 
    38  * 0.1 17-Jun-2008 first prototype using a first Lambert projection impl. in core 
     38 * History:
     39 * 0.1 17-Jun-2008 first prototype using a first Lambert projection impl. in core
    3940 * 0.2 22-Jun-2008 first stable version
    4041 * 0.3 24-Jun-2008 add code departement
     
    4344 *                 - add option to force a Lambert zone (for median locations)
    4445 *                 - add auto-sourcing
    45  * 0.5 16-Aug-2008 - add transparency in layer (allowing multiple wms layers displayed together) 
     46 * 0.5 16-Aug-2008 - add transparency in layer (allowing multiple wms layers displayed together)
    4647 *                 - no overlapping of grabbed images if transparency is enabled
    4748 *                 - set one layer per location
     
    6162 *                 - validate projection name by Lambert.toString() method
    6263 * 0.8 25-Jan-2009 - display returned list of communes if direct name is not recognized by server
    63  *                 - new possible grab factor of 100 square meters fixed size                     
     64 *                 - new possible grab factor of 100 square meters fixed size
    6465 *                 - minor fixes due to changes in JOSM core classes
    65  *                 - first draft of raster image support 
     66 *                 - first draft of raster image support
    6667 * 0.9 05-Feb-2009 - grab vectorized full commune bbox, save in file, convert to OSM way
    6768 *                   and simplify
    68  * 1.0 18-Feb-2009 - fix various bugs in color management and preference dialog 
     69 * 1.0 18-Feb-2009 - fix various bugs in color management and preference dialog
    6970 *                 - increase PNG picture size requested to WMS (800x1000)
    70  *                 - set 4th grab scale fixed size configurable (from 25 to 1000 meters) 
     71 *                 - set 4th grab scale fixed size configurable (from 25 to 1000 meters)
    7172 */
    7273public class CadastrePlugin extends Plugin {
     
    7879
    7980    public static String source = "";
    80    
     81
    8182    // true if the checkbox "auto-sourcing" is set in the plugin menu
    8283    public static boolean autoSourcing = false;
    83    
     84
    8485    // true when the plugin is first used, e.g. grab from WMS or download cache file
    8586    public static boolean pluginUsed = false;
    86    
     87
    8788    public static String cacheDir = null;
    88    
     89
    8990    public static boolean alterColors = false;
    90    
     91
    9192    public static boolean backgroundTransparent = false;
    92    
     93
    9394    public static float transparency = 1.0f;
    94    
     95
    9596    public static boolean drawBoundaries = false;
    96    
     97
    9798    static private boolean menuEnabled = false;
    9899
    99100    /**
    100101     * Creates the plugin and setup the default settings if necessary
    101      * 
     102     *
    102103     * @throws Exception
    103104     */
     
    123124    public void refreshMenu() throws Exception {
    124125        boolean isLambertProjection = Main.proj.toString().equals(new Lambert().toString());
    125         JMenuBar menu = Main.main.menu;
     126        MainMenu menu = Main.main.menu;
    126127
    127128        if (cadastreJMenu == null) {
    128             cadastreJMenu = new JMenu(tr("Cadastre"));
    129             cadastreJMenu.setMnemonic(KeyEvent.VK_C);
    130             menu.add(cadastreJMenu, menu.getMenuCount()-2);
     129            cadastreJMenu = menu.addMenu(marktr("Cadastre"), KeyEvent.VK_C, menu.defaultMenuPos);
    131130            if (isLambertProjection) {
    132131                JosmAction grab = new MenuActionGrab();
     
    138137                JMenuItem menuSettings = new JMenuItem(new MenuActionNewLocation());
    139138                final JCheckBoxMenuItem menuSource = new JCheckBoxMenuItem(tr("Auto sourcing"));
    140                 menuSource.setSelected(autoSourcing);     
     139                menuSource.setSelected(autoSourcing);
    141140                menuSource.addActionListener(new ActionListener() {
    142141                    public void actionPerformed(ActionEvent ev) {
     
    145144                    }
    146145                });
    147    
     146
    148147                JMenuItem menuResetCookie = new JMenuItem(new MenuActionResetCookie());
    149148                JMenuItem menuLambertZone = new JMenuItem(new MenuActionLambertZone());
     
    151150                //JMenuItem menuActionBoundaries = new JMenuItem(new MenuActionBoundaries());
    152151                //JMenuItem menuActionBuildings = new JMenuItem(new MenuActionBuildings());
    153                
     152
    154153                cadastreJMenu.add(menuGrab);
    155154                cadastreJMenu.add(menuSettings);
     
    159158                cadastreJMenu.add(menuLoadFromCache);
    160159                // all SVG features disabled until official WMS is released
    161                 //cadastreJMenu.add(menuActionBoundaries); 
     160                //cadastreJMenu.add(menuActionBoundaries);
    162161                //cadastreJMenu.add(menuActionBuildings);
    163162            } else {
  • applications/editors/josm/plugins/duplicateway/src/org/openstreetmap/josm/plugins/duplicateway/DuplicateWayPlugin.java

    r13497 r14120  
    2020  public DuplicateWayPlugin() {
    2121    name = tr("Duplicate Way");
    22     JMenu toolsMenu = null;
    23     for (int i = 0; i < Main.main.menu.getMenuCount() && toolsMenu == null; i++) {
    24       JMenu menu = Main.main.menu.getMenu(i);
    25       String name = menu.getText();
    26       if (name != null && name.equals(tr("Tools"))) {
    27         toolsMenu = menu;
    28       }
    29     }
    30 
    31     if (toolsMenu == null) {
    32       toolsMenu = new JMenu(name);
    33       toolsMenu.add(new JMenuItem(new DuplicateWayAction()));
    34       Main.main.menu.add(toolsMenu, 2);
    35     }
    36     else {
    37       toolsMenu.addSeparator();
    38       toolsMenu.add(new JMenuItem(new DuplicateWayAction()));
    39     }
    40 
     22    JMenu toolsMenu = Main.main.menu.toolsMenu;
     23    toolsMenu.addSeparator();
     24    toolsMenu.add(new JMenuItem(new DuplicateWayAction()));
    4125  }
    42 
    4326}
  • applications/editors/josm/plugins/grid/src/grid/GridPlugin.java

    r13497 r14120  
    1515import org.openstreetmap.josm.data.osm.DataSet;
    1616import org.openstreetmap.josm.data.osm.Node;
    17 import org.openstreetmap.josm.data.osm.Segment;
    1817import org.openstreetmap.josm.data.osm.Way;
    1918import org.openstreetmap.josm.data.osm.visitor.AddVisitor;
     
    2625    private class Action extends AbstractAction {
    2726    public Action() {
    28         super("add grid");
     27        super(tr("Add grid"));
    2928    }
    3029    public void actionPerformed(ActionEvent e) {
     
    3837
    3938    public GridPlugin() {
    40     JMenuBar menu = Main.main.menu;
    41     edit = null;
    42     for (int i = 0; i < menu.getMenuCount(); ++i) {
    43         if (menu.getMenu(i) != null && tr("Edit").equals(menu.getMenu(i).getName())) {
    44         edit = menu.getMenu(i);
    45         break;
    46         }
    47     }
    48     if (edit == null) {
    49         edit = new JMenu(tr("Edit"));
    50         menu.add(edit, 2);
    51         edit.setVisible(false);
    52     }
    53     edit.add(addGridMenu);
    54     addGridMenu.setVisible(false);
     39        edit = Main.main.menu.editMenu;
     40        edit.add(addGridMenu);
     41        addGridMenu.setVisible(false);
    5542    }
    5643    @Override
  • applications/editors/josm/plugins/imagewaypoint/build.xml

    r14015 r14120  
    2626                <attribute name="Plugin-Description" value="Another plugin to match images to the waypoints in a GPX file. A match is made when the 'name', 'cmt' or 'desc' attribute of a waypoint tag matches the filename of an image."/>
    2727                <attribute name="Plugin-Early" value="false"/>
    28                 <attribute name="Plugin-Mainversion" value="1465"/>
     28                <attribute name="Plugin-Mainversion" value="1498"/>
    2929                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    3030            </manifest>
  • applications/editors/josm/plugins/imagewaypoint/src/org/insignificant/josm/plugins/imagewaypoint/ImageWayPointPlugin.java

    r13497 r14120  
    1111
    1212import javax.swing.JFileChooser;
    13 import javax.swing.JMenu;
    14 import javax.swing.JMenuBar;
    15 import javax.swing.JMenuItem;
    1613import javax.swing.filechooser.FileFilter;
    1714
    1815import org.openstreetmap.josm.Main;
    1916import org.openstreetmap.josm.actions.JosmAction;
     17import org.openstreetmap.josm.gui.MainMenu;
    2018import org.openstreetmap.josm.gui.MapFrame;
    2119import org.openstreetmap.josm.gui.layer.Layer;
     
    9896     */
    9997    public ImageWayPointPlugin() {
    100     // find the File menu
    101     final JMenuBar menuBar = Main.main.menu;
    102     JMenu fileMenu = null;
    103 
    104     if (null != menuBar) {
    105         for (int index = 0; index < menuBar.getMenuCount()
    106             && null == fileMenu; index++) {
    107         if (I18n.tr("File").equals(menuBar.getMenu(index).getText())) {
    108             fileMenu = menuBar.getMenu(index);
    109         }
    110         }
    111     }
    112 
    113     if (null != fileMenu) {
    114         // now create our 'load' menu item and add to the file menu
    115         final JMenuItem menuItem = new JMenuItem(new LoadImagesAction(this));
    116         fileMenu.add(menuItem, 2);
    117     }
     98        MainMenu menu = Main.main.menu;
     99        menu.add(menu.fileMenu, new LoadImagesAction(this));
    118100    }
    119101
  • applications/editors/josm/plugins/livegps/build.xml

    r14015 r14120  
    2626                <attribute name="Plugin-Description" value="Support live GPS input (moving dot) through a connection to gpsd server."/>
    2727                <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/LiveGPS"/>
    28                 <attribute name="Plugin-Mainversion" value="1465"/>
     28                <attribute name="Plugin-Mainversion" value="1498"/>
    2929                <attribute name="Plugin-Stage" value="50"/>
    3030                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
  • applications/editors/josm/plugins/livegps/src/livegps/LiveGpsPlugin.java

    r14057 r14120  
    11package livegps;
    22
     3import static org.openstreetmap.josm.tools.I18n.marktr;
    34import static org.openstreetmap.josm.tools.I18n.tr;
    45
     
    1112import javax.swing.JCheckBoxMenuItem;
    1213import javax.swing.JMenu;
    13 import javax.swing.JMenuBar;
    1414import javax.swing.JMenuItem;
    1515
     
    8080    {
    8181        MainMenu menu = Main.main.menu;
    82         lgpsmenu = new JMenu(tr("LiveGPS"));
    83         menu.add(lgpsmenu, KeyEvent.VK_G, "livegps");
    84         menu.add(lgpsmenu, 5);
     82        lgpsmenu = menu.addMenu(marktr("LiveGPS"), KeyEvent.VK_G, menu.defaultMenuPos);
    8583
    8684        JosmAction captureAction = new CaptureAction();
  • applications/editors/josm/plugins/navigator/src/at/dallermassl/josm/plugin/navigator/NavigatorPlugin.java

    r13497 r14120  
    44package at.dallermassl.josm.plugin.navigator;
    55
     6import static org.openstreetmap.josm.tools.I18n.marktr;
    67import static org.openstreetmap.josm.tools.I18n.tr;
    78
     
    1112
    1213import javax.swing.JMenu;
    13 import javax.swing.JMenuBar;
    1414import javax.swing.JMenuItem;
    1515
    1616import org.openstreetmap.josm.Main;
     17import org.openstreetmap.josm.MainMenu;
    1718import org.openstreetmap.josm.gui.IconToggleButton;
    1819import org.openstreetmap.josm.gui.MapFrame;
     
    4142        navigatorLayer.setNavigatorNodeModel(navigatorModel);
    4243
    43         JMenuBar menu = Main.main.menu;
    44         JMenu navigatorMenu = new JMenu(tr("Navigation"));
     44        MainMenu menu = Main.main.menu;
     45        JMenu navigatorMenu = menu.addMenu(marktr("Navigation"), KeyEvent.VK_N, menu.defaultMenuPos);
    4546        JMenuItem navigatorMenuItem = new JMenuItem(new NavigatorAction(this));
    4647        navigatorMenu.add(navigatorMenuItem);
  • applications/editors/josm/plugins/openvisible/src/at/dallermassl/josm/plugin/openvisible/OpenVisiblePlugin.java

    r13497 r14120  
    33 */
    44package at.dallermassl.josm.plugin.openvisible;
    5 
    6 import javax.swing.JMenu;
    7 import javax.swing.JMenuItem;
    85
    96import org.openstreetmap.josm.Main;
  • applications/editors/josm/plugins/osmarender/src/OsmarenderPlugin.java

    r13497 r14120  
    1313import javax.swing.AbstractAction;
    1414import javax.swing.JLabel;
    15 import javax.swing.JMenu;
    16 import javax.swing.JMenuBar;
    1715import javax.swing.JMenuItem;
    1816import javax.swing.JOptionPane;
  • applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorPlugin.java

    r13497 r14120  
    1313import javax.swing.JFrame;
    1414import javax.swing.JMenu;
    15 import javax.swing.JMenuItem;
    1615import javax.swing.JOptionPane;
    1716import javax.swing.KeyStroke;
  • applications/editors/josm/plugins/tcxplugin/src/org/openstreetmap/josm/plugins/TcxPlugin.java

    r13497 r14120  
    22 * josm.tcx.plugin
    33 * (c) Copyright by M.IT 2002-2008
    4  * www.emaitie.de 
     4 * www.emaitie.de
    55 */
    66
     
    1515
    1616import javax.swing.JFileChooser;
    17 import javax.swing.JMenu;
    18 import javax.swing.JMenuItem;
    1917
    2018import org.openstreetmap.josm.Main;
     
    4139            KeyEvent.VK_T, Shortcut.GROUP_MENU));
    4240        }
    43        
     41
    4442        private void addTcxFileFilter()
    4543        {
     
    4947//              => check if filters contains a tcx entry, if not create a new array with tcx in it
    5048//              assign it to filters
    51            
    52     // TODO later we can remove the filter from the file filter list, so the extension does not appear 
     49
     50    // TODO later we can remove the filter from the file filter list, so the extension does not appear
    5351    // when the user wants to open a normal file.
    5452        }
    55        
     53
    5654
    5755        public void actionPerformed(ActionEvent e)
  • applications/editors/josm/plugins/utilsplugin/src/UtilsPlugin/UtilsPlugin.java

    r13723 r14120  
    66import java.awt.event.ActionEvent;
    77import javax.swing.AbstractAction;
    8 import javax.swing.JMenu;
    9 import javax.swing.JMenuBar;
    108import javax.swing.JMenuItem;
    119import javax.swing.JOptionPane;
    12 
    1310import javax.swing.JPanel;
    1411import javax.swing.BoxLayout;
  • applications/editors/josm/plugins/wmsplugin/build.xml

    r14015 r14120  
    2929                <attribute name="Plugin-Description" value="Display georeferenced images as background in JOSM (WMS servers, Yahoo, ...)."/>
    3030                <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/WMSPlugin"/>
    31                 <attribute name="Plugin-Mainversion" value="1465"/>
     31                <attribute name="Plugin-Mainversion" value="1498"/>
    3232                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    3333                <attribute name="de_Plugin-Link" value="http://wiki.openstreetmap.org/wiki/DE:JOSM/Plugins/WMSPlugin"/>
  • applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSPlugin.java

    r13648 r14120  
    11package wmsplugin;
    22
     3import static org.openstreetmap.josm.tools.I18n.marktr;
    34import static org.openstreetmap.josm.tools.I18n.tr;
    4 
    55
    66import java.awt.event.ActionEvent;
     
    1616import javax.swing.AbstractButton;
    1717import javax.swing.JMenu;
    18 import javax.swing.JMenuBar;
    1918import javax.swing.JMenuItem;
    2019
     
    130129        MainMenu menu = Main.main.menu;
    131130
    132         if (wmsJMenu == null) {
    133             wmsJMenu = new JMenu(tr("WMS"));
    134             menu.add(wmsJMenu, KeyEvent.VK_W, "wms");
    135             menu.add(wmsJMenu, 5);
    136         } else {
     131        if (wmsJMenu == null)
     132            wmsJMenu = menu.addMenu(marktr("WMS"), KeyEvent.VK_W, menu.defaultMenuPos);
     133        else
    137134            wmsJMenu.removeAll();
    138         }
    139135
    140136        // for each configured WMSInfo, add a menu entry.
Note: See TracChangeset for help on using the changeset viewer.