Changeset 29778 in osm for applications/editors/josm/plugins/merge-overlap/src/mergeoverlap
- Timestamp:
- 2013-07-25T21:57:38+02:00 (12 years ago)
- Location:
- applications/editors/josm/plugins/merge-overlap/src/mergeoverlap
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/merge-overlap/src/mergeoverlap/MergeOverlapAction.java
r27852 r29778 70 70 * Action Event 71 71 */ 72 @Override 72 73 public void actionPerformed(ActionEvent e) { 73 74 … … 261 262 } 262 263 264 @Override 263 265 public String toString() { 264 266 return "NodePos: " + pos + ", " + opositPos + ", " + node; -
applications/editors/josm/plugins/merge-overlap/src/mergeoverlap/MergeOverlapPlugin.java
r26705 r29778 3 3 import static org.openstreetmap.josm.tools.I18n.tr; 4 4 5 import javax.swing.JMenu;6 import javax.swing.JMenuItem;7 8 5 import org.openstreetmap.josm.Main; 6 import org.openstreetmap.josm.gui.MainMenu; 9 7 import org.openstreetmap.josm.plugins.Plugin; 10 8 import org.openstreetmap.josm.plugins.PluginInformation; … … 17 15 protected String name; 18 16 19 17 public MergeOverlapPlugin(PluginInformation info) { 20 18 super(info); 21 name = tr("Merge overlap", null); 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", null))) { 27 toolsMenu = menu; 28 } 29 } 30 31 if (toolsMenu == null) { 32 toolsMenu = new JMenu(name); 33 toolsMenu.add(new JMenuItem(new MergeOverlapAction())); 34 Main.main.menu.add(toolsMenu, 2); 35 } else { 36 toolsMenu.addSeparator(); 37 toolsMenu.add(new JMenuItem(new MergeOverlapAction())); 38 } 19 name = tr("Merge overlap"); 20 MainMenu.add(Main.main.menu.moreToolsMenu, new MergeOverlapAction()); 39 21 } 40 22 } -
applications/editors/josm/plugins/merge-overlap/src/mergeoverlap/MyCombinePrimitiveResolverDialog.java
r29644 r29778 324 324 JPanel pnl = new JPanel(); 325 325 pnl.setLayout(new BorderLayout()); 326 pnl.add(new JLabel(tr("No conflicts to resolve" , null)));326 pnl.add(new JLabel(tr("No conflicts to resolve"))); 327 327 return pnl; 328 328 } … … 386 386 387 387 public CancelAction() { 388 putValue(Action.SHORT_DESCRIPTION, tr("Cancel conflict resolution" , null));389 putValue(Action.NAME, tr("Cancel" , null));388 putValue(Action.SHORT_DESCRIPTION, tr("Cancel conflict resolution")); 389 putValue(Action.NAME, tr("Cancel")); 390 390 putValue(Action.SMALL_ICON, ImageProvider.get("", "cancel")); 391 391 setEnabled(true); 392 392 } 393 393 394 @Override 394 395 public void actionPerformed(ActionEvent arg0) { 395 396 setCancelled(true); … … 401 402 402 403 public ApplyAction() { 403 putValue(Action.SHORT_DESCRIPTION, tr("Apply resolved conflicts" , null));404 putValue(Action.NAME, tr("Apply" , null));404 putValue(Action.SHORT_DESCRIPTION, tr("Apply resolved conflicts")); 405 putValue(Action.NAME, tr("Apply")); 405 406 putValue(Action.SMALL_ICON, ImageProvider.get("ok")); 406 407 updateEnabledState(); 407 408 } 408 409 410 @Override 409 411 public void actionPerformed(ActionEvent arg0) { 410 412 setVisible(false); … … 417 419 } 418 420 421 @Override 419 422 public void propertyChange(PropertyChangeEvent evt) { 420 423 if (evt.getPropertyName().equals(MyTagConflictResolverModel.NUM_CONFLICTS_PROP)) { … … 447 450 } 448 451 452 @Override 449 453 public void ancestorResized(HierarchyEvent e) { 450 454 setDividerLocation((int) (dividerLocation * getHeight())); 451 455 } 452 456 457 @Override 453 458 public void ancestorMoved(HierarchyEvent e) { 454 459 // do nothing 455 460 } 456 461 462 @Override 457 463 public void propertyChange(PropertyChangeEvent evt) { 458 464 if (evt.getPropertyName().equals(JSplitPane.DIVIDER_LOCATION_PROPERTY)) { … … 800 806 JPanel pnl = new JPanel(); 801 807 pnl.setLayout(new FlowLayout(FlowLayout.LEFT)); 802 pnl.add(new JLabel(tr("Role:" , null)));808 pnl.add(new JLabel(tr("Role:"))); 803 809 pnl.add(tfRole = new AutoCompletingTextField(10)); 804 tfRole.setToolTipText(tr("Enter a role for all relation memberships" , null));810 tfRole.setToolTipText(tr("Enter a role for all relation memberships")); 805 811 pnl.add(new JButton(new ApplyRoleAction())); 806 812 tfRole.addActionListener(new ApplyRoleAction()); … … 819 825 JPanel pnl = new JPanel(); 820 826 pnl.setLayout(new FlowLayout(FlowLayout.LEFT)); 821 cbTagRelations = new JCheckBox(tr("Tag modified relations with " , null));827 cbTagRelations = new JCheckBox(tr("Tag modified relations with ")); 822 828 cbTagRelations.addChangeListener(new ToggleTagRelationsAction()); 823 829 cbTagRelations.setToolTipText( 824 830 tr("<html>Select to enable entering a tag which will be applied<br>" 825 + "to all modified relations.</html>" , null));831 + "to all modified relations.</html>")); 826 832 pnl.add(cbTagRelations); 827 833 pnl.add(new JLabel(trc("tag", "Key:"))); 828 834 pnl.add(tfKey = new AutoCompletingTextField(10)); 829 tfKey.setToolTipText(tr("<html>Enter a tag key, i.e. <strong><tt>fixme</tt></strong></html>" , null));830 pnl.add(new JLabel(tr("Value:" , null)));835 tfKey.setToolTipText(tr("<html>Enter a tag key, i.e. <strong><tt>fixme</tt></strong></html>")); 836 pnl.add(new JLabel(tr("Value:"))); 831 837 pnl.add(tfValue = new AutoCompletingTextField(10)); 832 tfValue.setToolTipText(tr("<html>Enter a tag value, i.e. <strong><tt>check members</tt></strong></html>" , null));838 tfValue.setToolTipText(tr("<html>Enter a tag value, i.e. <strong><tt>check members</tt></strong></html>")); 833 839 cbTagRelations.setSelected(false); 834 840 tfKey.setEnabled(false); … … 848 854 + "the other ways that are members of the same relation: the combined way will " 849 855 + "take the place of the original way in the relation." 850 + "</html>" , null));856 + "</html>")); 851 857 invalidate(); 852 858 } … … 859 865 + "the other nodes that are members of the same relation: the target node will " 860 866 + "take the place of the original node in the relation." 861 + "</html>" , null));867 + "</html>")); 862 868 invalidate(); 863 869 } … … 865 871 class ApplyRoleAction extends AbstractAction { 866 872 public ApplyRoleAction() { 867 putValue(NAME, tr("Apply" , null));873 putValue(NAME, tr("Apply")); 868 874 putValue(SMALL_ICON, ImageProvider.get("ok")); 869 putValue(SHORT_DESCRIPTION, tr("Apply this role to all members", null)); 870 } 871 875 putValue(SHORT_DESCRIPTION, tr("Apply this role to all members")); 876 } 877 878 @Override 872 879 public void actionPerformed(ActionEvent e) { 873 880 model.applyRole(tfRole.getText()); … … 876 883 877 884 class ToggleTagRelationsAction implements ChangeListener { 885 @Override 878 886 public void stateChanged(ChangeEvent e) { 879 887 ButtonModel buttonModel = ((AbstractButton) e.getSource()).getModel(); … … 957 965 */ 958 966 class SelectNextColumnCellAction extends AbstractAction { 967 @Override 959 968 public void actionPerformed(ActionEvent e) { 960 969 run(); … … 987 996 class SelectPreviousColumnCellAction extends AbstractAction { 988 997 998 @Override 989 999 public void actionPerformed(ActionEvent e) { 990 1000 run(); … … 1010 1020 } 1011 1021 1022 @Override 1012 1023 public void gotoNextDecision() { 1013 1024 selectNextColumnCellAction.run(); 1014 1025 } 1015 1026 1027 @Override 1016 1028 public void gotoPreviousDecision() { 1017 1029 selectPreviousColumnCellAction.run(); … … 1067 1079 displayedKeys, 1068 1080 new Comparator<String>() { 1081 @Override 1069 1082 public int compare(String key1, String key2) { 1070 1083 if (decisions.get(key1).isDecided() && ! decisions.get(key2).isDecided()) … … 1270 1283 gc.weightx = 1.0; 1271 1284 gc.anchor = GridBagConstraints.LINE_START; 1272 pnl.add(new JLabel(tr("<html>Please select the values to keep for the following tags.</html>" , null)), gc);1285 pnl.add(new JLabel(tr("<html>Please select the values to keep for the following tags.</html>")), gc); 1273 1286 1274 1287 gc.gridy = 1; 1275 1288 gc.fill = GridBagConstraints.HORIZONTAL; 1276 1289 gc.weighty = 0.0; 1277 pnl.add(cbShowTagsWithConflictsOnly = new JCheckBox(tr("Show tags with conflicts only" , null)), gc);1278 pnl.add(cbShowTagsWithMultiValuesOnly = new JCheckBox(tr("Show tags with multiple values only" , null)), gc);1290 pnl.add(cbShowTagsWithConflictsOnly = new JCheckBox(tr("Show tags with conflicts only")), gc); 1291 pnl.add(cbShowTagsWithMultiValuesOnly = new JCheckBox(tr("Show tags with multiple values only")), gc); 1279 1292 cbShowTagsWithConflictsOnly.addChangeListener( 1280 1293 new ChangeListener() { 1294 @Override 1281 1295 public void stateChanged(ChangeEvent e) { 1282 1296 model.setShowTagsWithConflictsOnly(cbShowTagsWithConflictsOnly.isSelected()); … … 1290 1304 cbShowTagsWithMultiValuesOnly.addChangeListener( 1291 1305 new ChangeListener() { 1306 @Override 1292 1307 public void stateChanged(ChangeEvent e) { 1293 1308 model.setShowTagsWithMultiValuesOnly(cbShowTagsWithMultiValuesOnly.isSelected()); … … 1373 1388 */ 1374 1389 class SelectNextColumnCellAction extends AbstractAction { 1390 @Override 1375 1391 public void actionPerformed(ActionEvent e) { 1376 1392 run(); … … 1403 1419 class SelectPreviousColumnCellAction extends AbstractAction { 1404 1420 1421 @Override 1405 1422 public void actionPerformed(ActionEvent e) { 1406 1423 run(); … … 1426 1443 } 1427 1444 1445 @Override 1428 1446 public void gotoNextDecision() { 1429 1447 selectNextColumnCellAction.run(); 1430 1448 } 1431 1449 1450 @Override 1432 1451 public void gotoPreviousDecision() { 1433 1452 selectPreviousColumnCellAction.run();
Note:
See TracChangeset
for help on using the changeset viewer.