Ignore:
Timestamp:
2013-07-25T21:57:38+02:00 (12 years ago)
Author:
akks
Message:

[josm_plugins]: see #josm6355 - Move most of the other plugins to suitable menus, add Netbeans projects

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  
    7070         *            Action Event
    7171         */
     72        @Override
    7273        public void actionPerformed(ActionEvent e) {
    7374
     
    261262                }
    262263
     264                @Override
    263265                public String toString() {
    264266                        return "NodePos: " + pos + ", " + opositPos + ", " + node;
  • applications/editors/josm/plugins/merge-overlap/src/mergeoverlap/MergeOverlapPlugin.java

    r26705 r29778  
    33import static org.openstreetmap.josm.tools.I18n.tr;
    44
    5 import javax.swing.JMenu;
    6 import javax.swing.JMenuItem;
    7 
    85import org.openstreetmap.josm.Main;
     6import org.openstreetmap.josm.gui.MainMenu;
    97import org.openstreetmap.josm.plugins.Plugin;
    108import org.openstreetmap.josm.plugins.PluginInformation;
     
    1715    protected String name;
    1816
    19         public MergeOverlapPlugin(PluginInformation info) {
     17    public MergeOverlapPlugin(PluginInformation info) {
    2018        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());
    3921    }
    4022}
  • applications/editors/josm/plugins/merge-overlap/src/mergeoverlap/MyCombinePrimitiveResolverDialog.java

    r29644 r29778  
    324324        JPanel pnl = new JPanel();
    325325        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")));
    327327        return pnl;
    328328    }
     
    386386
    387387        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"));
    390390            putValue(Action.SMALL_ICON, ImageProvider.get("", "cancel"));
    391391            setEnabled(true);
    392392        }
    393393
     394        @Override
    394395        public void actionPerformed(ActionEvent arg0) {
    395396            setCancelled(true);
     
    401402
    402403        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"));
    405406            putValue(Action.SMALL_ICON, ImageProvider.get("ok"));
    406407            updateEnabledState();
    407408        }
    408409
     410        @Override
    409411        public void actionPerformed(ActionEvent arg0) {
    410412            setVisible(false);
     
    417419        }
    418420
     421        @Override
    419422        public void propertyChange(PropertyChangeEvent evt) {
    420423            if (evt.getPropertyName().equals(MyTagConflictResolverModel.NUM_CONFLICTS_PROP)) {
     
    447450        }
    448451
     452        @Override
    449453        public void ancestorResized(HierarchyEvent e) {
    450454            setDividerLocation((int) (dividerLocation * getHeight()));
    451455        }
    452456
     457        @Override
    453458        public void ancestorMoved(HierarchyEvent e) {
    454459            // do nothing
    455460        }
    456461
     462        @Override
    457463        public void propertyChange(PropertyChangeEvent evt) {
    458464            if (evt.getPropertyName().equals(JSplitPane.DIVIDER_LOCATION_PROPERTY)) {
     
    800806            JPanel pnl = new JPanel();
    801807            pnl.setLayout(new FlowLayout(FlowLayout.LEFT));
    802             pnl.add(new JLabel(tr("Role:", null)));
     808            pnl.add(new JLabel(tr("Role:")));
    803809            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"));
    805811            pnl.add(new JButton(new ApplyRoleAction()));
    806812            tfRole.addActionListener(new ApplyRoleAction());
     
    819825            JPanel pnl = new JPanel();
    820826            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 "));
    822828            cbTagRelations.addChangeListener(new ToggleTagRelationsAction());
    823829            cbTagRelations.setToolTipText(
    824830                    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>"));
    826832            pnl.add(cbTagRelations);
    827833            pnl.add(new JLabel(trc("tag", "Key:")));
    828834            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:")));
    831837            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>"));
    833839            cbTagRelations.setSelected(false);
    834840            tfKey.setEnabled(false);
     
    848854                    + "the other ways that are members of the same relation: the combined way will "
    849855                    + "take the place of the original way in the relation."
    850                     + "</html>", null));
     856                    + "</html>"));
    851857            invalidate();
    852858        }
     
    859865                    + "the other nodes that are members of the same relation: the target node will "
    860866                    + "take the place of the original node in the relation."
    861                     + "</html>", null));
     867                    + "</html>"));
    862868            invalidate();
    863869        }
     
    865871        class ApplyRoleAction extends AbstractAction {
    866872            public ApplyRoleAction() {
    867                 putValue(NAME, tr("Apply", null));
     873                putValue(NAME, tr("Apply"));
    868874                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
    872879            public void actionPerformed(ActionEvent e) {
    873880                model.applyRole(tfRole.getText());
     
    876883
    877884        class ToggleTagRelationsAction implements ChangeListener {
     885            @Override
    878886            public void stateChanged(ChangeEvent e) {
    879887                ButtonModel buttonModel = ((AbstractButton) e.getSource()).getModel();
     
    957965         */
    958966        class SelectNextColumnCellAction extends AbstractAction {
     967            @Override
    959968            public void actionPerformed(ActionEvent e) {
    960969                run();
     
    987996        class SelectPreviousColumnCellAction extends AbstractAction {
    988997
     998            @Override
    989999            public void actionPerformed(ActionEvent e) {
    9901000                run();
     
    10101020        }
    10111021
     1022        @Override
    10121023        public void gotoNextDecision() {
    10131024            selectNextColumnCellAction.run();
    10141025        }
    10151026
     1027        @Override
    10161028        public void gotoPreviousDecision() {
    10171029            selectPreviousColumnCellAction.run();
     
    10671079                    displayedKeys,
    10681080                    new Comparator<String>() {
     1081                        @Override
    10691082                        public int compare(String key1, String key2) {
    10701083                            if (decisions.get(key1).isDecided() && ! decisions.get(key2).isDecided())
     
    12701283            gc.weightx = 1.0;
    12711284            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);
    12731286
    12741287            gc.gridy = 1;
    12751288            gc.fill = GridBagConstraints.HORIZONTAL;
    12761289            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);
    12791292            cbShowTagsWithConflictsOnly.addChangeListener(
    12801293                    new ChangeListener() {
     1294                        @Override
    12811295                        public void stateChanged(ChangeEvent e) {
    12821296                            model.setShowTagsWithConflictsOnly(cbShowTagsWithConflictsOnly.isSelected());
     
    12901304            cbShowTagsWithMultiValuesOnly.addChangeListener(
    12911305                    new ChangeListener() {
     1306                        @Override
    12921307                        public void stateChanged(ChangeEvent e) {
    12931308                            model.setShowTagsWithMultiValuesOnly(cbShowTagsWithMultiValuesOnly.isSelected());
     
    13731388         */
    13741389        class SelectNextColumnCellAction extends AbstractAction {
     1390            @Override
    13751391            public void actionPerformed(ActionEvent e) {
    13761392                run();
     
    14031419        class SelectPreviousColumnCellAction extends AbstractAction {
    14041420
     1421            @Override
    14051422            public void actionPerformed(ActionEvent e) {
    14061423                run();
     
    14261443        }
    14271444
     1445        @Override
    14281446        public void gotoNextDecision() {
    14291447            selectNextColumnCellAction.run();
    14301448        }
    14311449
     1450        @Override
    14321451        public void gotoPreviousDecision() {
    14331452            selectPreviousColumnCellAction.run();
Note: See TracChangeset for help on using the changeset viewer.