Changeset 17359 in osm


Ignore:
Timestamp:
2009-08-30T17:34:52+02:00 (15 years ago)
Author:
guggis
Message:

Update to ToggleDialog refactoring in JOSM 2005 - 2012

Location:
applications/editors/josm/plugins/usertools
Files:
2 edited

Legend:

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

    r14015 r17359  
    2222                <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
    2323                <attribute name="Plugin-Description" value="Tools to work with authors/users. Selects map data that belongs to selected user, opens browser showing selected author profile page."/>
    24                 <attribute name="Plugin-Mainversion" value="1465"/>
     24                <attribute name="Plugin-Mainversion" value="2012"/>
    2525                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    2626            </manifest>
  • applications/editors/josm/plugins/usertools/src/usertools/UserToolsPlugin.java

    r14125 r17359  
    7979            public void actionPerformed(ActionEvent ev) {
    8080                int dialogIndex = 100;
    81                 for (int i = 0; i < Main.map.toggleDialogs.getComponentCount(); i++) {
    82 
    83                     if (Main.map.toggleDialogs.getComponent(i).getClass()
    84                             .getSimpleName().equals("UserListDialog")) {
    85 
    86                         dialogIndex = i;
    87                     }
    88                 }
    89                 UserListDialog uld = (UserListDialog) Main.map.toggleDialogs.getComponent(dialogIndex);
    90 
     81                UserListDialog uld = Main.map.getToggleDialog(UserListDialog.class);
    9182                uld.setVisible(true);
    9283            }
     
    128119    public static String getSelectedUser(){
    129120        int dialogIndex = 100;
    130         for (int i = 0; i < Main.map.toggleDialogs.getComponentCount(); i++) {
    131 
    132             //  System.out.println(Main.map.toggleDialogs.getComponent(i)
    133             //      .getClass().getSimpleName());
    134 
    135             if (Main.map.toggleDialogs.getComponent(i).getClass()
    136                     .getSimpleName().equals("UserListDialog")) {
    137                 dialogIndex = i;
    138             }
    139         }
    140         UserListDialog uld = (UserListDialog) Main.map.toggleDialogs.getComponent(dialogIndex);
     121       
     122        UserListDialog uld = Main.map.getToggleDialog(UserListDialog.class);
    141123
    142124        //these are hard coded, probably better to search, like above
Note: See TracChangeset for help on using the changeset viewer.