Ignore:
Timestamp:
2010-12-03T16:19:59+01:00 (15 years ago)
Author:
postfix
Message:

first steps to use the layers of josm

Location:
applications/editors/josm/plugins/smed/src/smed
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/smed/src/smed/Smed.java

    r23479 r24559  
    155155            smedTab.closeDialog();
    156156        }
     157       
     158        if(Main.map != null) {
     159                // von SmedTabbedPane nach hier verlagert, damit sicher ist Main.map != null
     160                SmedPluggable p = SmedTabbedPane.getCurPlugin();
     161               
     162                if(p != null) p.hasFocus();             
     163        }
    157164    }
    158165
  • applications/editors/josm/plugins/smed/src/smed/tabs/SmedTabbedPane.java

    r23445 r24559  
    3434        private SmedPluginManager manager = null;
    3535        private int activeIndex = -1;
     36        static private SmedPluggable curPlugin = null;
    3637       
    3738    public SmedTabbedPane() {
     
    6465                                tabbedPane.setMnemonicAt(i, KeyEvent.VK_1 + i);
    6566                                if(i == 0) {
    66                                         p.hasFocus();
     67                                        curPlugin = p;
    6768                                        activeIndex = 0;
    6869                                }
     
    9495                                                activeIndex = pane.getSelectedIndex();
    9596                                                for(SmedPluggable p : plugins) {
    96                                                         if(p.getIndex() == activeIndex) p.hasFocus();
     97                                                        if(p.getIndex() == activeIndex) {
     98                                                                p.hasFocus();
     99                                                                curPlugin = p;
     100                                                        }
    97101                                                }
    98102                                        }
     
    108112    public static List<SmedPluggable> getPlugins() { return plugins; }
    109113    public static JTabbedPane getTabbedPane() { return tabbedPane; }
     114    public static SmedPluggable getCurPlugin() { return curPlugin; }
    110115}
Note: See TracChangeset for help on using the changeset viewer.