Changeset 6074 in josm for trunk/src/org
- Timestamp:
- 2013-07-19T02:08:27+02:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/tagging
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r6070 r6074 1 // License: GPL. Copyright 2007 by Immanuel Scholz and others1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.gui.tagging; 3 3 … … 56 56 import org.xml.sax.SAXException; 57 57 58 59 58 /** 60 59 * This class read encapsulate one tagging preset. A class method can … … 63 62 * 64 63 * It is also able to construct dialogs out of preset definitions. 64 * @since 294 65 65 */ 66 66 public class TaggingPreset extends AbstractAction implements MapView.LayerChangeListener { … … 74 74 public String name_context; 75 75 public String locale_name; 76 public final static String OPTIONAL_TOOLTIP_TEXT = "Optional tooltip text";76 public final static String OPTIONAL_TOOLTIP_TEXT = "Optional tooltip text"; 77 77 78 78 /** -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItem.java
r6072 r6074 1 // License: GPL. Copyright 2007 by Immanuel Scholz and others1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.gui.tagging; 3 3 … … 14 14 15 15 /** 16 * This calss reperesentse single part of a preset - one field or text label that17 * is shown to user16 * Class that represents single part of a preset - one field or text label that is shown to user 17 * @since 6068 18 18 */ 19 19 public abstract class TaggingPresetItem { … … 47 47 return null; 48 48 } 49 50 49 } -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java
r6068 r6074 57 57 import static org.openstreetmap.josm.tools.I18n.trc; 58 58 59 60 59 /** 61 * Class that con stains all subtypes of TaggingPresetItem,62 * static supplementary data, types and methods60 * Class that contains all subtypes of TaggingPresetItem, static supplementary data, types and methods 61 * @since 6068 63 62 */ 64 63 public final class TaggingPresetItems { -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetMenu.java
r6068 r6074 1 // License: GPL. Copyright 2007 by Immanuel Scholz and others1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.gui.tagging; 3 3 … … 22 22 public class TaggingPresetMenu extends TaggingPreset { 23 23 public JMenu menu = null; // set by TaggingPresetPreferences 24 24 25 @Override 25 26 public void setDisplayName() { … … 31 32 putValue("toolbar", "tagginggroup_" + getRawName()); 32 33 } 34 33 35 @Override 34 36 public void setIcon(String iconName) { … … 60 62 public void actionPerformed(ActionEvent e) { 61 63 Object s = e.getSource(); 62 if(menu != null && s instanceof Component) 63 { 64 Component co = (Component)s; 65 64 if (menu != null && s instanceof Component) { 66 65 JPopupMenu pm = new JPopupMenu(getName()); 67 66 for (Component c : menu.getMenuComponents()) { … … 72 71 } 73 72 } 73 74 74 /** 75 75 * Sorts the menu items using the translated item text … … 99 99 for (JMenuItem menuItem : sortarray) { 100 100 int oldPos; 101 if (lastSeparator == 0){101 if (lastSeparator == 0){ 102 102 oldPos=pos; 103 } else {103 } else { 104 104 oldPos = pos+lastSeparator+1; 105 105 } … … 110 110 lastSeparator = 0; 111 111 } 112 } else if (item instanceof JSeparator){112 } else if (item instanceof JSeparator){ 113 113 Collections.sort(sortarray, comp); 114 114 int pos = 0; -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetReader.java
r6068 r6074 1 // License: GPL. For details, see LICENSE file. 1 2 package org.openstreetmap.josm.gui.tagging; 2 3 … … 23 24 import static org.openstreetmap.josm.tools.I18n.tr; 24 25 25 26 /** 27 * The tagging presets reader. 28 * @since 6068 29 */ 26 30 public final class TaggingPresetReader { 27 31 32 /** 33 * Constructs a new {@code TaggingPresetReader}. 34 */ 28 35 public TaggingPresetReader() { 29 36 } … … 40 47 return sources; 41 48 } 42 43 49 44 50 public static List<TaggingPreset> readAll(Reader in, boolean validate) throws SAXException { … … 70 76 parser.start(in); 71 77 } 72 while (parser.hasNext()) {78 while (parser.hasNext()) { 73 79 Object o = parser.next(); 74 80 if (o instanceof TaggingPresetMenu) { 75 81 TaggingPresetMenu tp = (TaggingPresetMenu) o; 76 if (tp == lastmenu) {82 if (tp == lastmenu) { 77 83 lastmenu = tp.group; 78 } else 79 { 84 } else { 80 85 tp.group = lastmenu; 81 86 tp.setDisplayName(); 82 87 lastmenu = tp; 83 88 all.add(tp); 84 85 89 } 86 90 lastrole = null; -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetSearchAction.java
r5170 r6074 11 11 import org.openstreetmap.josm.tools.Shortcut; 12 12 13 /** 14 * The tagging presets search action (F3). 15 * @since 3388 16 */ 13 17 public class TaggingPresetSearchAction extends JosmAction { 14 18 19 /** 20 * Constructs a new {@code TaggingPresetSearchAction}. 21 */ 15 22 public TaggingPresetSearchAction() { 16 23 super(tr("Search preset"), "dialogs/search", tr("Show preset search dialog"), … … 26 33 return; 27 34 28 TaggingPresetSearchDialog dialog = TaggingPresetSearchDialog.getInstance(); 29 dialog.showDialog(); 35 TaggingPresetSearchDialog.getInstance().showDialog(); 30 36 } 31 32 37 } -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetSearchDialog.java
r6068 r6074 11 11 import org.openstreetmap.josm.gui.ExtendedDialog; 12 12 13 13 /** 14 * The tagging presets search dialog (F3). 15 * @since 3388 16 */ 14 17 public class TaggingPresetSearchDialog extends ExtendedDialog { 15 18 … … 17 20 18 21 private static TaggingPresetSearchDialog instance; 22 23 /** 24 * Returns the unique instance of {@code TaggingPresetSearchDialog}. 25 * @return the unique instance of {@code TaggingPresetSearchDialog}. 26 */ 19 27 public static TaggingPresetSearchDialog getInstance() { 20 28 if (instance == null) { … … 23 31 return instance; 24 32 } 33 25 34 private TaggingPresetSearchDialog() { 26 35 super(Main.parent, tr("Presets"), new String[] {tr("Select"), tr("Cancel")}); -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetSelector.java
r6072 r6074 1 /* 2 * To change this template, choose Tools | Templates 3 * and open the template in the editor. 4 */ 1 // License: GPL. For details, see LICENSE file. 5 2 package org.openstreetmap.josm.gui.tagging; 6 3 -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetSeparator.java
r6068 r6074 1 // License: GPL. Copyright 2007 by Immanuel Scholz and others1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.gui.tagging; 3 3 -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetType.java
r6070 r6074 7 7 /** 8 8 * Enumeration of OSM primitive types associated with names and icons 9 * @since 6068 9 10 */ 10 11 public enum TaggingPresetType {
Note:
See TracChangeset
for help on using the changeset viewer.