Changeset 24559 in osm for applications/editors/josm/plugins/smed
- Timestamp:
- 2010-12-03T16:19:59+01:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/smed
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/harbour/src/harbour/Harbour.java
r24518 r24559 8 8 import javax.swing.ImageIcon; 9 9 import javax.swing.JComponent; 10 11 import org.openstreetmap.josm.Main; 12 import org.openstreetmap.josm.gui.MapView; 10 13 11 14 import smed.plug.ifc.SmedPluggable; … … 21 24 @Override 22 25 public boolean start() { 23 // TODO Auto-generated method stub24 26 return false; 25 27 } … … 33 35 @Override 34 36 public boolean hasFocus() { 35 // TODO Auto-generated method stub 36 return false; 37 Main.map.mapView.addPropertyChangeListener(harbour); 38 MapView.addLayerChangeListener(harbour); 39 return true; 37 40 } 38 41 39 42 @Override 40 43 public boolean lostFocus() { 41 // TODO Auto-generated method stub 42 return false; 44 Main.map.mapView.removePropertyChangeListener(harbour); 45 MapView.removeLayerChangeListener(harbour); 46 return true; 43 47 } 44 48 -
applications/editors/josm/plugins/smed/plugs/harbour/src/harbour/dialogs/HarbourAction.java
r24540 r24559 10 10 import javax.swing.JLabel; 11 11 import java.awt.Font; 12 import java.awt.event.ComponentEvent; 13 import java.awt.event.ComponentListener; 14 import java.beans.PropertyChangeEvent; 15 import java.beans.PropertyChangeListener; 16 12 17 import javax.swing.JComboBox; 13 18 import javax.swing.ImageIcon; 14 19 import javax.swing.JToggleButton; 15 20 16 public class HarbourAction { 17 18 private JPanel harbourPanel = null; // @jve:decl-index=0:visual-constraint="68,31" 21 import org.openstreetmap.josm.Main; 22 import org.openstreetmap.josm.gui.MapView.EditLayerChangeListener; 23 import org.openstreetmap.josm.gui.MapView.LayerChangeListener; 24 import org.openstreetmap.josm.gui.layer.Layer; 25 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 26 27 public class HarbourAction implements PropertyChangeListener, LayerChangeListener, EditLayerChangeListener, ComponentListener { 28 29 private JPanel harbourPanel = null; 19 30 private JButton comButton = null; 20 31 private JButton restButton = null; … … 47 58 private JButton queryjButton = null; 48 59 private JToggleButton chartButton = null; 60 private JPanel curPanel = null; 61 49 62 public HarbourAction() { 50 63 panelGeneral= new PanelGeneral(); 51 64 panelGeneral.setBounds(new Rectangle(2, 56, 330, 270)); 52 65 panelGeneral.setVisible(true); 66 curPanel = panelGeneral; 53 67 54 68 panelLimits = new PanelLimits(); … … 77 91 if (harbourPanel == null) { 78 92 regLabel = new JLabel(); 79 regLabel.setBounds(new Rectangle(9 0, 32, 45, 20));93 regLabel.setBounds(new Rectangle(93, 32, 54, 20)); 80 94 regLabel.setText("Region:"); 81 95 noLabel1 = new JLabel(); 82 noLabel1.setBounds(new Rectangle(20 0, 32, 26, 20));96 noLabel1.setBounds(new Rectangle(205, 32, 26, 20)); 83 97 noLabel1.setText("Nr.:"); 84 98 countryLabel = new JLabel(); 85 countryLabel.setBounds(new Rectangle(2, 32, 32, 20));99 countryLabel.setBounds(new Rectangle(2, 32, 40, 20)); 86 100 countryLabel.setText("Land:"); 87 101 typeLabel = new JLabel(); 88 typeLabel.setBounds(new Rectangle(289, 32, 3 0, 20));102 typeLabel.setBounds(new Rectangle(289, 32, 39, 20)); 89 103 typeLabel.setText("Type:"); 90 104 queryLabel = new JLabel(); 91 queryLabel.setBounds(new Rectangle(201, 334, 7 2, 15));105 queryLabel.setBounds(new Rectangle(201, 334, 78, 15)); 92 106 queryLabel.setFont(new Font("Dialog", Font.PLAIN, 12)); 93 107 queryLabel.setText("Suche nach:"); 94 108 setLabel = new JLabel(); 95 setLabel.setBounds(new Rectangle(2, 330, 6 0, 21));109 setLabel.setBounds(new Rectangle(2, 330, 67, 21)); 96 110 setLabel.setFont(new Font("Dialog", Font.PLAIN, 12)); 97 111 setLabel.setText("Datensatz:"); … … 157 171 panelGeneral.setVisible(true); 158 172 chartButton.setEnabled(false); 173 curPanel = panelGeneral; 159 174 } 160 175 }); … … 182 197 panelLimits.setVisible(true); 183 198 chartButton.setEnabled(false); 199 curPanel = panelLimits; 184 200 } 185 201 }); … … 207 223 panelServices.setVisible(true); 208 224 chartButton.setEnabled(false); 225 curPanel = panelServices; 209 226 } 210 227 }); … … 232 249 panelEnv.setVisible(true); 233 250 chartButton.setEnabled(true); 251 curPanel = panelEnv; 234 252 } 235 253 }); … … 257 275 panelRelations.setVisible(true); 258 276 chartButton.setEnabled(true); 277 curPanel = panelRelations; 259 278 } 260 279 }); … … 284 303 if (fastbackButton == null) { 285 304 fastbackButton = new JButton(); 286 fastbackButton.setBounds(new Rectangle( 62, 330, 20, 20));305 fastbackButton.setBounds(new Rectangle(72, 330, 20, 20)); 287 306 } 288 307 return fastbackButton; … … 297 316 if (backButton == null) { 298 317 backButton = new JButton(); 299 backButton.setBounds(new Rectangle( 81, 330, 20, 20));318 backButton.setBounds(new Rectangle(90, 330, 20, 20)); 300 319 } 301 320 return backButton; … … 310 329 if (setTextField == null) { 311 330 setTextField = new JTextField(); 312 setTextField.setBounds(new Rectangle(1 01, 329, 60, 23));331 setTextField.setBounds(new Rectangle(110, 329, 51, 23)); 313 332 setTextField.setText(""); 314 333 } … … 350 369 if (typComboBox == null) { 351 370 typComboBox = new JComboBox(); 352 typComboBox.setBounds(new Rectangle(32 3, 28, 72, 25));371 typComboBox.setBounds(new Rectangle(328, 28, 69, 25)); 353 372 } 354 373 return typComboBox; … … 363 382 if (countryComboBox == null) { 364 383 countryComboBox = new JComboBox(); 365 countryComboBox.setBounds(new Rectangle( 36, 29, 50, 25));384 countryComboBox.setBounds(new Rectangle(42, 29, 50, 25)); 366 385 } 367 386 return countryComboBox; … … 376 395 if (noTextField == null) { 377 396 noTextField = new JTextField(); 378 noTextField.setBounds(new Rectangle(2 25, 29, 60, 25));397 noTextField.setBounds(new Rectangle(230, 29, 60, 25)); 379 398 noTextField.setText(""); 380 399 } … … 390 409 if (regTextField == null) { 391 410 regTextField = new JTextField(); 392 regTextField.setBounds(new Rectangle(1 35, 29, 60, 25));411 regTextField.setBounds(new Rectangle(145, 29, 60, 25)); 393 412 } 394 413 return regTextField; … … 409 428 queryComboBox.addItem("Type"); 410 429 queryComboBox.addItem("Query"); 411 queryComboBox.setBounds(new Rectangle(27 2, 331, 86, 20));430 queryComboBox.setBounds(new Rectangle(279, 331, 86, 20)); 412 431 } 413 432 return queryComboBox; … … 422 441 if (queryjButton == null) { 423 442 queryjButton = new JButton(); 424 queryjButton.setBounds(new Rectangle(364, 33 0, 28, 20));443 queryjButton.setBounds(new Rectangle(364, 331, 28, 20)); 425 444 } 426 445 return queryjButton; … … 435 454 if (chartButton == null) { 436 455 chartButton = new JToggleButton(); 437 chartButton.setBounds(new Rectangle(36 5, 5, 28, 18));456 chartButton.setBounds(new Rectangle(367, 5, 28, 18)); 438 457 chartButton.setEnabled(false); 439 458 } … … 441 460 } 442 461 462 @Override 463 public void propertyChange(PropertyChangeEvent evt) { 464 if(curPanel == panelEnv) System.out.println("Start HarbourAction.propertyChange"); 465 } 466 467 @Override 468 public void componentHidden(ComponentEvent arg0) { 469 if(curPanel == panelEnv) System.out.println("Start HarbourAction.componentHidden"); 470 } 471 472 @Override 473 public void componentMoved(ComponentEvent arg0) { 474 if(curPanel == panelEnv) System.out.println("Start HarbourAction.componentMoved"); 475 } 476 477 @Override 478 public void componentResized(ComponentEvent arg0) { 479 if(curPanel == panelEnv) System.out.println("Start HarbourAction.componentResized"); 480 } 481 482 @Override 483 public void componentShown(ComponentEvent arg0) { 484 if(curPanel == panelEnv) System.out.println("Start HarbourAction.componentShown"); 485 } 486 487 @Override 488 public void activeLayerChange(Layer arg0, Layer arg1) { 489 if(curPanel == panelEnv) System.out.println("Start HarbourAction.activeLayerChange"); 490 } 491 492 @Override 493 public void layerAdded(Layer arg0) { 494 if(curPanel == panelEnv) System.out.println("Start HarbourAction.layerAdded"); 495 } 496 497 @Override 498 public void layerRemoved(Layer arg0) { 499 if(curPanel == panelServices) System.out.println("Start HarbourAction.layerRemoved"); 500 } 501 502 @Override 503 public void editLayerChanged(OsmDataLayer arg0, OsmDataLayer arg1) { 504 System.out.println("Start HarbourAction.editLayerChanged"); 505 } 506 443 507 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/OSeaM.java
r24556 r24559 33 33 @Override 34 34 public boolean hasFocus() { 35 // TODO Auto-generated method stub36 35 return false; 37 36 } -
applications/editors/josm/plugins/smed/src/smed/Smed.java
r23479 r24559 155 155 smedTab.closeDialog(); 156 156 } 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 } 157 164 } 158 165 -
applications/editors/josm/plugins/smed/src/smed/tabs/SmedTabbedPane.java
r23445 r24559 34 34 private SmedPluginManager manager = null; 35 35 private int activeIndex = -1; 36 static private SmedPluggable curPlugin = null; 36 37 37 38 public SmedTabbedPane() { … … 64 65 tabbedPane.setMnemonicAt(i, KeyEvent.VK_1 + i); 65 66 if(i == 0) { 66 p.hasFocus();67 curPlugin = p; 67 68 activeIndex = 0; 68 69 } … … 94 95 activeIndex = pane.getSelectedIndex(); 95 96 for(SmedPluggable p : plugins) { 96 if(p.getIndex() == activeIndex) p.hasFocus(); 97 if(p.getIndex() == activeIndex) { 98 p.hasFocus(); 99 curPlugin = p; 100 } 97 101 } 98 102 } … … 108 112 public static List<SmedPluggable> getPlugins() { return plugins; } 109 113 public static JTabbedPane getTabbedPane() { return tabbedPane; } 114 public static SmedPluggable getCurPlugin() { return curPlugin; } 110 115 }
Note:
See TracChangeset
for help on using the changeset viewer.