Changeset 23443 in osm for applications/editors/josm/plugins/smed
- Timestamp:
- 2010-10-02T16:39:43+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/smed
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/OSeaM.java
r23426 r23443 13 13 private OSeaMAction osm = null; 14 14 public SmedPluginManager manager = null; 15 private int index = -1; 15 16 16 17 @Override … … 57 58 } 58 59 60 @Override 61 public boolean hasFocus() { 62 osm.hasFocus = true; 63 osm.setQueued(); 64 System.out.println("OSeaM has Focus"); 65 return true; 66 } 67 68 @Override 69 public boolean lostFocus() { 70 osm.setDequeued(); 71 return true; 72 } 73 74 @Override 75 public int getIndex() { return index; } 76 77 @Override 78 public void setIndex(int index) { this.index = index; } 79 59 80 60 81 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/dialogs/OSeaMAction.java
r23419 r23443 64 64 private String Os = ""; // @jve:decl-index=0: //$NON-NLS-1$ 65 65 private String UserHome = ""; // @jve:decl-index=0: //$NON-NLS-1$ 66 public boolean hasFocus = false; 66 67 67 68 // SelectionChangedListner der in die Eventqueue von josm eingehängt wird … … 228 229 // siehe org.openstreetmap.josm.plugins.osb -> OsbLayer.java 229 230 // Einhängen des Listeners in die Eventqueue von josm 231 if(hasFocus) DataSet.addSelectionListener(SmpListener); 232 233 } 234 235 public void setQueued() { 236 System.out.println("OSeaM is queued"); 230 237 DataSet.addSelectionListener(SmpListener); 231 232 } 233 238 } 239 240 public void setDequeued() { 241 System.out.println("OSeaM is dequeued"); 242 DataSet.removeSelectionListener(SmpListener); 243 } 244 234 245 private void PicRebuild() { 235 246 … … 1404 1415 return sM01StatusBar; 1405 1416 } 1417 1406 1418 } -
applications/editors/josm/plugins/smed/plugs/smed_about/src/smed_about/SmedAbout.java
r23419 r23443 14 14 15 15 private boolean visible = true; 16 private int index = -1; 16 17 17 18 private JPanel jPanel = null; // @jve:decl-index=0:visual-constraint="43,24" … … 89 90 return null; 90 91 } 92 93 @Override 94 public boolean hasFocus() { 95 // TODO Auto-generated method stub 96 return false; 97 } 98 99 @Override 100 public boolean lostFocus() { 101 // TODO Auto-generated method stub 102 return false; 103 } 104 105 @Override 106 public int getIndex() { return index; } 107 108 @Override 109 public void setIndex(int index) { this.index = index; } 91 110 } -
applications/editors/josm/plugins/smed/plugs/smed_ex/src/smed_ex/SmedEx.java
r23426 r23443 19 19 private boolean visible = true; 20 20 public SmedPluginManager manager = null; 21 private int index = -1; 21 22 22 23 private JPanel jPanel = null; // @jve:decl-index=0:visual-constraint="78,30" … … 105 106 return null; 106 107 } 108 109 @Override 110 public boolean hasFocus() { 111 // TODO Auto-generated method stub 112 return false; 113 } 114 115 @Override 116 public boolean lostFocus() { 117 // TODO Auto-generated method stub 118 return false; 119 } 120 121 @Override 122 public int getIndex() { return index; } 123 124 @Override 125 public void setIndex(int index) { this.index = index; } 107 126 } -
applications/editors/josm/plugins/smed/src/smed/plug/ifc/SmedPluggable.java
r23426 r23443 9 9 boolean start(); 10 10 boolean stop(); 11 boolean hasFocus(); 12 boolean lostFocus(); 13 int getIndex(); 14 void setIndex(int index); 11 15 String getName(); 12 16 String getFileName(); -
applications/editors/josm/plugins/smed/src/smed/tabs/SmedTabbedPane.java
r23437 r23443 32 32 static private List<SmedPluggable> plugins = null; 33 33 static private JTabbedPane tabbedPane = null; 34 @SuppressWarnings("unused") 35 private int activeIndex = -1; 34 36 35 37 public SmedTabbedPane() { … … 42 44 43 45 if(plugins != null) { 46 47 if(tabbedPane == null) tabbedPane = new JTabbedPane(); 48 44 49 ImageIcon icon = null; 45 if(tabbedPane == null) {46 tabbedPane = new JTabbedPane();47 tabbedPane.addChangeListener(new ChangeListener() {48 49 @Override50 public void stateChanged(ChangeEvent event) {51 System.out.println("hello world");52 }53 });54 }55 50 56 51 JComponent panel; … … 68 63 tabbedPane.addTab(p.getName(),icon, panel, p.getInfo()); 69 64 tabbedPane.setMnemonicAt(i, KeyEvent.VK_1 + i); 65 if(i == 0) { 66 p.hasFocus(); 67 activeIndex = 0; 68 } 69 p.setIndex(i); 70 70 71 71 i++; … … 80 80 //The following line enables to use scrolling tabs. 81 81 tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); 82 83 // add ChangeListener 84 tabbedPane.addChangeListener(new ChangeListener() { 85 86 @Override 87 public void stateChanged(ChangeEvent event) { 88 System.out.println("hello world"); 89 System.out.println("activeIndex:\t" + activeIndex); 90 JTabbedPane pane = (JTabbedPane) event.getSource(); 91 92 for(SmedPluggable p : plugins) { 93 if(p.getIndex() == activeIndex) p.lostFocus(); 94 } 95 96 System.out.println(pane.getSelectedIndex()); 97 activeIndex = pane.getSelectedIndex(); 98 for(SmedPluggable p : plugins) { 99 if(p.getIndex() == activeIndex) p.hasFocus(); 100 } 101 } 102 }); 103 82 104 } 83 105 } catch (IOException e) { … … 89 111 public static List<SmedPluggable> getPlugins() { return plugins; } 90 112 public static JTabbedPane getTabbedPane() { return tabbedPane; } 91 92 /*93 @Override94 public void stateChanged(ChangeEvent event) {95 System.out.println("hello world");96 97 }98 */99 113 }
Note:
See TracChangeset
for help on using the changeset viewer.