Changeset 4918 in josm
- Timestamp:
- 2012-02-11T18:56:53+01:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/RedoAction.java
r4908 r4918 49 49 putValue(NAME, tr("Redo ...")); 50 50 setTooltip(tr("Redo {0}", 51 Main.main.undoRedo.redoCommands.getFirst().getDescr pitionText()));51 Main.main.undoRedo.redoCommands.getFirst().getDescriptionText())); 52 52 } 53 53 } -
trunk/src/org/openstreetmap/josm/actions/UndoAction.java
r4908 r4918 49 49 putValue(NAME, tr("Undo ...")); 50 50 setTooltip(tr("Undo {0}", 51 Main.main.undoRedo.commands.getFirst().getDescr pitionText()));51 Main.main.undoRedo.commands.getFirst().getDescriptionText())); 52 52 } 53 53 } -
trunk/src/org/openstreetmap/josm/command/AddCommand.java
r3262 r4918 8 8 import java.util.Collections; 9 9 10 import javax.swing. JLabel;10 import javax.swing.Icon; 11 11 12 12 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 60 60 } 61 61 62 @Override public JLabel getDescription() { 62 @Override 63 public String getDescriptionText() { 63 64 String msg; 64 65 switch(OsmPrimitiveType.from(osm)) { … … 68 69 default: /* should not happen */msg = ""; break; 69 70 } 71 return tr(msg, osm.getDisplayName(DefaultNameFormatter.getInstance())); 72 } 70 73 71 return new JLabel( 72 tr(msg, osm.getDisplayName(DefaultNameFormatter.getInstance())), 73 ImageProvider.get(OsmPrimitiveType.from(osm)), 74 JLabel.HORIZONTAL); 74 @Override 75 public Icon getDescriptionIcon() { 76 return ImageProvider.get(OsmPrimitiveType.from(osm)); 75 77 } 76 78 -
trunk/src/org/openstreetmap/josm/command/AddPrimitivesCommand.java
r3703 r4918 8 8 import java.util.HashSet; 9 9 import java.util.List; 10 import javax.swing.Icon; 10 11 11 12 import javax.swing.JLabel; … … 101 102 } 102 103 103 @Override public JLabel getDescription() { 104 @Override 105 public String getDescriptionText() { 104 106 int size = data != null ? data.size() : createdPrimitives.size(); 105 return new JLabel(trn("Added {0} object", "Added {0} objects", size, size), null, 106 JLabel.HORIZONTAL 107 ); 107 return trn("Added {0} object", "Added {0} objects", size, size); 108 } 109 110 @Override 111 public Icon getDescriptionIcon() { 112 return null; 108 113 } 109 114 -
trunk/src/org/openstreetmap/josm/command/ChangeCommand.java
r3262 r4918 6 6 7 7 import java.util.Collection; 8 9 import javax.swing.JLabel; 8 import javax.swing.Icon; 10 9 11 10 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 50 49 } 51 50 52 @Override public JLabel getDescription() { 51 @Override 52 public String getDescriptionText() { 53 53 String msg = ""; 54 54 switch(OsmPrimitiveType.from(osm)) { … … 57 57 case RELATION: msg = marktr("Change relation {0}"); break; 58 58 } 59 return new JLabel(tr(msg, 60 osm.getDisplayName(DefaultNameFormatter.getInstance())), 61 ImageProvider.get(OsmPrimitiveType.from(osm)), 62 JLabel.HORIZONTAL); 59 return tr(msg, osm.getDisplayName(DefaultNameFormatter.getInstance())); 60 } 61 62 @Override 63 public Icon getDescriptionIcon() { 64 return ImageProvider.get(OsmPrimitiveType.from(osm)); 63 65 } 64 66 } -
trunk/src/org/openstreetmap/josm/command/ChangeNodesCommand.java
r3262 r4918 6 6 import java.util.Collection; 7 7 import java.util.List; 8 9 import javax.swing.JLabel; 8 import javax.swing.Icon; 10 9 11 10 import org.openstreetmap.josm.data.osm.Node; … … 46 45 } 47 46 48 @Override public JLabel getDescription() { 49 String msg = tr("Changed nodes of {0}", way.getDisplayName(DefaultNameFormatter.getInstance())); 50 return new JLabel(msg, 51 ImageProvider.get(OsmPrimitiveType.WAY), 52 JLabel.HORIZONTAL); 47 @Override 48 public String getDescriptionText() { 49 return tr("Changed nodes of {0}", way.getDisplayName(DefaultNameFormatter.getInstance())); 50 } 51 52 @Override 53 public Icon getDescriptionIcon() { 54 return ImageProvider.get(OsmPrimitiveType.WAY); 53 55 } 54 56 } -
trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java
r4773 r4918 14 14 import java.util.List; 15 15 import java.util.Map; 16 17 import javax.swing.JLabel; 16 import javax.swing.Icon; 18 17 19 18 import org.openstreetmap.josm.Main; … … 145 144 } 146 145 147 @Override public JLabel getDescription() { 146 @Override 147 public String getDescriptionText() { 148 148 String text; 149 149 if (objects.size() == 1 && tags.size() == 1) { … … 187 187 text = tr("Set {0} properties for {1} objects", tags.size(), objects.size()); 188 188 } 189 return new JLabel(text, ImageProvider.get("data", "key"), JLabel.HORIZONTAL); 189 return text; 190 } 191 192 @Override 193 public Icon getDescriptionIcon() { 194 return ImageProvider.get("data", "key"); 190 195 } 191 196 … … 196 201 for (final OsmPrimitive osm : objects) { 197 202 children.add(new PseudoCommand() { 198 @Override public JLabel getDescription() { 199 return new JLabel( 200 osm.getDisplayName(DefaultNameFormatter.getInstance()), 201 ImageProvider.get(OsmPrimitiveType.from(osm)), 202 JLabel.HORIZONTAL); 203 204 } 203 @Override public String getDescriptionText() { 204 return osm.getDisplayName(DefaultNameFormatter.getInstance()); 205 } 206 207 @Override public Icon getDescriptionIcon() { 208 return ImageProvider.get(OsmPrimitiveType.from(osm)); 209 } 210 205 211 @Override public Collection<? extends OsmPrimitive> getParticipatingPrimitives() { 206 212 return Collections.singleton(osm); -
trunk/src/org/openstreetmap/josm/command/ChangePropertyKeyCommand.java
r4806 r4918 10 10 import java.util.LinkedList; 11 11 import java.util.List; 12 import javax.swing.Icon; 12 13 13 import javax.swing.JLabel;14 15 import org.openstreetmap.josm.command.Command;16 import org.openstreetmap.josm.command.PseudoCommand;17 14 import org.openstreetmap.josm.data.osm.OsmPrimitive; 18 15 import org.openstreetmap.josm.data.validation.util.NameVisitor; … … 71 68 72 69 @Override 73 public JLabel getDescription() {70 public String getDescriptionText() { 74 71 String text = tr( "Replace \"{0}\" by \"{1}\" for", key, newKey); 75 72 if (objects.size() == 1) { … … 80 77 text += " "+objects.size()+" "+trn("object","objects",objects.size()); 81 78 } 82 return new JLabel(text, ImageProvider.get("data", "key"), JLabel.HORIZONTAL); 79 return text; 80 } 81 82 @Override 83 public Icon getDescriptionIcon() { 84 return ImageProvider.get("data", "key"); 83 85 } 84 86 … … 94 96 children.add(new PseudoCommand() { 95 97 @Override 96 public JLabel getDescription() { 97 return v.toLabel(); 98 public String getDescriptionText() { 99 return v.name; 100 } 101 @Override 102 public Icon getDescriptionIcon() { 103 return v.icon; 98 104 } 99 105 @Override -
trunk/src/org/openstreetmap/josm/command/ChangeRelationMemberRoleCommand.java
r4191 r4918 6 6 import java.util.Collection; 7 7 8 import javax.swing.JLabel; 9 10 import org.openstreetmap.josm.Main; 8 import javax.swing.Icon; 11 9 import org.openstreetmap.josm.data.osm.OsmPrimitive; 12 10 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; … … 64 62 } 65 63 66 @Override public JLabel getDescription() { 67 return new JLabel( 68 tr("Change relation member role for {0} {1}", 69 OsmPrimitiveType.from(relation), 70 relation.getDisplayName(DefaultNameFormatter.getInstance()) 71 ), 72 ImageProvider.get(OsmPrimitiveType.from(relation)), 73 JLabel.HORIZONTAL 74 ); 64 @Override 65 public String getDescriptionText() { 66 return tr("Change relation member role for {0} {1}", 67 OsmPrimitiveType.from(relation), 68 relation.getDisplayName(DefaultNameFormatter.getInstance())); 69 } 70 71 @Override 72 public Icon getDescriptionIcon() { 73 return ImageProvider.get(OsmPrimitiveType.from(relation)); 75 74 } 76 75 } -
trunk/src/org/openstreetmap/josm/command/Command.java
r4908 r4918 160 160 @Override public Collection<? extends OsmPrimitive> getParticipatingPrimitives() { 161 161 return cloneMap.keySet(); 162 }163 164 public String getDescrpitionText() {165 Object o = getDescription();166 if (o instanceof JLabel) {167 return ((JLabel) o).getText();168 } else {169 return o.toString();170 }171 162 } 172 163 -
trunk/src/org/openstreetmap/josm/command/ConflictAddCommand.java
r3995 r4918 5 5 6 6 import java.util.Collection; 7 8 import javax.swing.JLabel; 7 import javax.swing.Icon; 9 8 import javax.swing.JOptionPane; 10 9 … … 63 62 } 64 63 65 @Override public JLabel getDescription() { 66 return new JLabel( 67 tr("Add conflict for ''{0}''", 68 conflict.getMy().getDisplayName(DefaultNameFormatter.getInstance()) 69 ), 70 ImageProvider.get(OsmPrimitiveType.from(conflict.getMy())), 71 JLabel.HORIZONTAL 72 ); 64 @Override 65 public String getDescriptionText() { 66 return tr("Add conflict for ''{0}''", 67 conflict.getMy().getDisplayName(DefaultNameFormatter.getInstance())); 68 } 69 70 @Override 71 public Icon getDescriptionIcon() { 72 return ImageProvider.get(OsmPrimitiveType.from(conflict.getMy())); 73 73 } 74 74 } -
trunk/src/org/openstreetmap/josm/command/CoordinateConflictResolveCommand.java
r3262 r4918 5 5 6 6 import java.util.Collection; 7 8 import javax.swing.JLabel; 7 import javax.swing.Icon; 9 8 10 9 import org.openstreetmap.josm.data.conflict.Conflict; … … 38 37 } 39 38 40 @Override public JLabel getDescription() { 41 return new JLabel( 42 tr("Resolve conflicts in coordinates in {0}",conflict.getMy().getId()), 43 ImageProvider.get("data", "object"), 44 JLabel.HORIZONTAL 45 ); 39 @Override 40 public String getDescriptionText() { 41 return tr("Resolve conflicts in coordinates in {0}", conflict.getMy().getId()); 42 } 43 44 @Override 45 public Icon getDescriptionIcon() { 46 return ImageProvider.get("data", "object"); 46 47 } 47 48 -
trunk/src/org/openstreetmap/josm/command/DeleteCommand.java
r4677 r4918 19 19 import java.util.Set; 20 20 import java.util.Map.Entry; 21 import javax.swing.Icon; 21 22 22 23 import javax.swing.JLabel; … … 149 150 } 150 151 151 @Override public JLabel getDescription() { 152 if (toDelete.size() == 1) { 152 private Set<OsmPrimitiveType> getTypesToDelete() { 153 Set<OsmPrimitiveType> typesToDelete = new HashSet<OsmPrimitiveType>(); 154 for (OsmPrimitive osm : toDelete) { 155 typesToDelete.add(OsmPrimitiveType.from(osm)); 156 } 157 return typesToDelete; 158 } 159 160 @Override 161 public String getDescriptionText() { 162 if (toDelete.size() == 1) { 153 163 OsmPrimitive primitive = toDelete.iterator().next(); 154 164 String msg = ""; … … 159 169 } 160 170 161 return new JLabel(tr(msg, primitive.getDisplayName(DefaultNameFormatter.getInstance())), 162 ImageProvider.get(OsmPrimitiveType.from(primitive)), JLabel.HORIZONTAL); 171 return tr(msg, primitive.getDisplayName(DefaultNameFormatter.getInstance())); 163 172 } else { 164 Set<OsmPrimitiveType> typesToDelete = new HashSet<OsmPrimitiveType>(); 165 for (OsmPrimitive osm : toDelete) { 166 typesToDelete.add(OsmPrimitiveType.from(osm)); 167 } 173 Set<OsmPrimitiveType> typesToDelete = getTypesToDelete(); 168 174 String msg = ""; 169 String apiname = "object";170 175 if (typesToDelete.size() > 1) { 171 176 msg = trn("Delete {0} object", "Delete {0} objects", toDelete.size(), toDelete.size()); 172 177 } else { 173 178 OsmPrimitiveType t = typesToDelete.iterator().next(); 174 apiname = t.getAPIName();175 179 switch(t) { 176 180 case NODE: msg = trn("Delete {0} node", "Delete {0} nodes", toDelete.size(), toDelete.size()); break; … … 179 183 } 180 184 } 181 return new JLabel(msg, ImageProvider.get("data", apiname), JLabel.HORIZONTAL); 185 return msg; 186 } 187 } 188 189 @Override 190 public Icon getDescriptionIcon() { 191 if (toDelete.size() == 1) { 192 return ImageProvider.get(OsmPrimitiveType.from(toDelete.iterator().next())); 193 } 194 Set<OsmPrimitiveType> typesToDelete = getTypesToDelete(); 195 if (typesToDelete.size() > 1) { 196 return ImageProvider.get("data", "object"); 197 } else { 198 return ImageProvider.get(typesToDelete.iterator().next()); 182 199 } 183 200 } … … 190 207 for (final OsmPrimitive osm : toDelete) { 191 208 children.add(new PseudoCommand() { 192 @Override public JLabel getDescription() { 193 return new JLabel( 194 tr("Deleted ''{0}''", 195 osm.getDisplayName(DefaultNameFormatter.getInstance())), 196 ImageProvider.get(OsmPrimitiveType.from(osm)), JLabel.HORIZONTAL); 209 210 @Override public String getDescriptionText() { 211 return tr("Deleted ''{0}''", osm.getDisplayName(DefaultNameFormatter.getInstance())); 197 212 } 213 214 @Override public Icon getDescriptionIcon() { 215 return ImageProvider.get(OsmPrimitiveType.from(osm)); 216 } 217 198 218 @Override public Collection<? extends OsmPrimitive> getParticipatingPrimitives() { 199 219 return Collections.singleton(osm); -
trunk/src/org/openstreetmap/josm/command/DeletedStateConflictResolveCommand.java
r3262 r4918 6 6 import java.util.Collection; 7 7 8 import javax.swing. JLabel;8 import javax.swing.Icon; 9 9 10 10 import org.openstreetmap.josm.data.conflict.Conflict; 11 import org.openstreetmap.josm.data.osm.Node; 11 12 import org.openstreetmap.josm.data.osm.OsmPrimitive; 12 13 import org.openstreetmap.josm.gui.conflict.pair.MergeDecisionType; … … 38 39 } 39 40 40 @Override public JLabel getDescription() { 41 return new JLabel( 42 tr("Resolve conflicts in deleted state in {0}",conflict.getMy().getId()), 43 ImageProvider.get("data", "object"), 44 JLabel.HORIZONTAL 45 ); 41 @Override 42 public String getDescriptionText() { 43 return tr("Resolve conflicts in deleted state in {0}", conflict.getMy().getId()); 44 } 45 46 @Override 47 public Icon getDescriptionIcon() { 48 return ImageProvider.get("data", "object"); 46 49 } 47 50 -
trunk/src/org/openstreetmap/josm/command/ModifiedConflictResolveCommand.java
r3262 r4918 6 6 7 7 import java.util.Collection; 8 import javax.swing.Icon; 8 9 9 10 import javax.swing.JLabel; … … 33 34 } 34 35 35 @Override public JLabel getDescription() { 36 @Override 37 public String getDescriptionText() { 36 38 String msg = ""; 37 39 switch(OsmPrimitiveType.from(conflict.getMy())) { … … 40 42 case RELATION: msg = marktr("Set the ''modified'' flag for relation {0}"); break; 41 43 } 42 return new JLabel( 43 tr(msg,conflict.getMy().getId()), 44 ImageProvider.get("data", "object"), 45 JLabel.HORIZONTAL 46 ); 44 return tr(msg,conflict.getMy().getId()); 45 } 46 47 @Override 48 public Icon getDescriptionIcon() { 49 return ImageProvider.get("data", "object"); 47 50 } 48 51 -
trunk/src/org/openstreetmap/josm/command/MoveCommand.java
r4894 r4918 9 9 import java.util.LinkedList; 10 10 import java.util.List; 11 import javax.swing.Icon; 11 12 12 13 import javax.swing.JLabel; … … 131 132 } 132 133 133 @Override public JLabel getDescription() { 134 return new JLabel(trn("Move {0} node", "Move {0} nodes", nodes.size(), nodes.size()), ImageProvider.get("data", "node"), JLabel.HORIZONTAL); 134 @Override 135 public String getDescriptionText() { 136 return trn("Move {0} node", "Move {0} nodes", nodes.size(), nodes.size()); 137 } 138 139 @Override 140 public Icon getDescriptionIcon() { 141 return ImageProvider.get("data", "node"); 135 142 } 136 143 -
trunk/src/org/openstreetmap/josm/command/PseudoCommand.java
r3479 r4918 3 3 4 4 import java.util.Collection; 5 import javax.swing.Icon; 6 import javax.swing.JLabel; 5 7 6 8 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 14 16 /** 15 17 * Provide a description that can be presented in a list or tree view. 18 * @deprecated This abstract method is deprecated. 19 * On 2012-03-01, this abstract method will be removed. 20 * At the same moment, the methods {@link #getDescrpitionText()} and {@link #getDescrpitionIcon()} 21 * will be made abstract. 22 * For a smooth transition, replace {@link #getDescription()} by implementations of 23 * {@link #getDescrpitionText()} and {@link #getDescrpitionIcon()} as early as possible. 24 * {@link #getDescription()} is no longer abstract and can therefore be removed. 16 25 */ 17 abstract public Object getDescription(); 26 @Deprecated 27 public Object getDescription() { 28 return null; 29 } 30 31 /** 32 * Provides a description text representing this command. 33 */ 34 public String getDescriptionText() { 35 Object o = getDescription(); 36 if (o instanceof JLabel) { 37 return ((JLabel) o).getText(); 38 } else { 39 return o.toString(); 40 } 41 } 42 43 /** 44 * Provides a descriptive icon of this command. 45 */ 46 public Icon getDescriptionIcon() { 47 Object o = getDescription(); 48 if (o instanceof JLabel) { 49 return ((JLabel) o).getIcon(); 50 } else { 51 return null; 52 } 53 } 18 54 19 55 /** -
trunk/src/org/openstreetmap/josm/command/PurgeCommand.java
r3486 r4918 13 13 import java.util.Set; 14 14 15 import javax.swing. JLabel;15 import javax.swing.Icon; 16 16 17 17 import org.openstreetmap.josm.data.osm.DataSet; … … 252 252 253 253 @Override 254 public Object getDescription() { 255 return new JLabel(trn("Purged {0} object", "Purged {0} objects", toPurge.size(), toPurge.size()), ImageProvider.get("data", "purge"), JLabel.HORIZONTAL); 254 public String getDescriptionText() { 255 return trn("Purged {0} object", "Purged {0} objects", toPurge.size(), toPurge.size()); 256 } 257 258 @Override 259 public Icon getDescriptionIcon() { 260 return ImageProvider.get("data", "purge"); 256 261 } 257 262 -
trunk/src/org/openstreetmap/josm/command/RelationMemberConflictResolverCommand.java
r4191 r4918 7 7 import java.util.List; 8 8 9 import javax.swing. JLabel;9 import javax.swing.Icon; 10 10 11 11 import org.openstreetmap.josm.Main; … … 46 46 } 47 47 48 @Override public JLabel getDescription() { 49 return new JLabel( 50 tr("Resolve conflicts in member list of relation {0}", my.getId()), 51 ImageProvider.get("data", "object"), 52 JLabel.HORIZONTAL 53 ); 48 @Override 49 public String getDescriptionText() { 50 return tr("Resolve conflicts in member list of relation {0}", my.getId()); 51 } 52 53 @Override 54 public Icon getDescriptionIcon() { 55 return ImageProvider.get("data", "object"); 54 56 } 55 57 -
trunk/src/org/openstreetmap/josm/command/RotateCommand.java
r3702 r4918 6 6 import java.util.Collection; 7 7 8 import javax.swing. JLabel;8 import javax.swing.Icon; 9 9 10 10 import org.openstreetmap.josm.data.coor.EastNorth; … … 99 99 100 100 @Override 101 public JLabel getDescription() { 102 return new JLabel(trn("Rotate {0} node", "Rotate {0} nodes", nodes.size(), nodes.size()), ImageProvider.get("data", "node"), JLabel.HORIZONTAL); 101 public String getDescriptionText() { 102 return trn("Rotate {0} node", "Rotate {0} nodes", nodes.size(), nodes.size()); 103 } 104 105 @Override 106 public Icon getDescriptionIcon() { 107 return ImageProvider.get("data", "node"); 103 108 } 104 109 } -
trunk/src/org/openstreetmap/josm/command/ScaleCommand.java
r3702 r4918 6 6 import java.util.Collection; 7 7 8 import javax.swing. JLabel;8 import javax.swing.Icon; 9 9 10 10 import org.openstreetmap.josm.data.coor.EastNorth; … … 81 81 82 82 @Override 83 public JLabel getDescription() {84 return new JLabel(trn("Scale {0} node", "Scale {0} nodes", nodes.size(), nodes.size()), ImageProvider.get("data", "node"), JLabel.HORIZONTAL);83 public String getDescriptionText() { 84 return trn("Scale {0} node", "Scale {0} nodes", nodes.size(), nodes.size()); 85 85 } 86 86 87 @Override 88 public Icon getDescriptionIcon() { 89 return ImageProvider.get("data", "node"); 90 } 87 91 } -
trunk/src/org/openstreetmap/josm/command/SequenceCommand.java
r4191 r4918 8 8 import java.util.HashSet; 9 9 import java.util.List; 10 import javax.swing.Icon; 10 11 11 12 import javax.swing.JLabel; … … 87 88 } 88 89 89 @Override public JLabel getDescription() { 90 return new JLabel(tr("Sequence")+": "+name, ImageProvider.get("data", "sequence"), JLabel.HORIZONTAL); 90 @Override 91 public String getDescriptionText() { 92 return tr("Sequence: {0}", name); 93 } 94 95 @Override 96 public Icon getDescriptionIcon() { 97 return ImageProvider.get("data", "sequence"); 91 98 } 92 99 -
trunk/src/org/openstreetmap/josm/command/TagConflictResolveCommand.java
r4191 r4918 7 7 import java.util.Collection; 8 8 import java.util.List; 9 import javax.swing.Icon; 9 10 10 import javax.swing.JLabel;11 11 12 12 import org.openstreetmap.josm.data.conflict.Conflict; … … 55 55 } 56 56 57 @Override public JLabel getDescription() { 57 @Override 58 public String getDescriptionText() { 58 59 String msg = ""; 59 60 switch(OsmPrimitiveType.from(conflict.getMy())) { … … 62 63 case RELATION: msg = marktr("Resolve {0} tag conflicts in relation {1}"); break; 63 64 } 64 return new JLabel( 65 tr(msg,getNumDecidedConflicts(), conflict.getMy().getId()), 66 ImageProvider.get("data", "object"), 67 JLabel.HORIZONTAL 68 ); 65 return tr(msg,getNumDecidedConflicts(), conflict.getMy().getId()); 66 } 67 68 @Override 69 public Icon getDescriptionIcon() { 70 return ImageProvider.get("data", "object"); 69 71 } 70 72 -
trunk/src/org/openstreetmap/josm/command/TransformNodesCommand.java
r3702 r4918 9 9 import java.util.Map; 10 10 11 import javax.swing. JLabel;11 import javax.swing.Icon; 12 12 13 13 import org.openstreetmap.josm.data.coor.EastNorth; … … 123 123 124 124 @Override 125 public JLabel getDescription() { 126 return new JLabel(trn("Transform {0} node", "Transform {0} nodes", nodes.size(), nodes.size()), ImageProvider.get("data", "node"), JLabel.HORIZONTAL); 125 public String getDescriptionText() { 126 return trn("Transform {0} node", "Transform {0} nodes", nodes.size(), nodes.size()); 127 } 128 129 @Override 130 public Icon getDescriptionIcon() { 131 return ImageProvider.get("data", "node"); 127 132 } 128 133 -
trunk/src/org/openstreetmap/josm/command/VersionConflictResolveCommand.java
r3362 r4918 6 6 7 7 import java.util.Collection; 8 9 import javax.swing.JLabel; 8 import javax.swing.Icon; 10 9 11 10 import org.openstreetmap.josm.data.conflict.Conflict; … … 33 32 } 34 33 35 @Override public JLabel getDescription() { 34 @Override 35 public String getDescriptionText() { 36 36 String msg = ""; 37 37 switch(OsmPrimitiveType.from(conflict.getMy())) { … … 40 40 case RELATION: msg = marktr("Resolve version conflict for relation {0}"); break; 41 41 } 42 return new JLabel( 43 tr(msg,conflict.getMy().getId()), 44 ImageProvider.get("data", "object"), 45 JLabel.HORIZONTAL 46 ); 42 return tr(msg, conflict.getMy().getId()); 43 } 44 45 @Override 46 public Icon getDescriptionIcon() { 47 return ImageProvider.get("data", "object"); 47 48 } 48 49 -
trunk/src/org/openstreetmap/josm/command/WayNodesConflictResolverCommand.java
r4191 r4918 7 7 import java.util.List; 8 8 9 import javax.swing. JLabel;9 import javax.swing.Icon; 10 10 11 11 import org.openstreetmap.josm.data.conflict.Conflict; … … 40 40 this.mergedNodeList = mergedNodeList; 41 41 } 42 @Override 43 public String getDescriptionText() { 44 return tr("Resolve conflicts in node list of way {0}", conflict.getMy().getId()); 45 } 42 46 43 @Override public JLabel getDescription() { 44 return new JLabel( 45 tr("Resolve conflicts in node list of way {0}", conflict.getMy().getId()), 46 ImageProvider.get("data", "object"), 47 JLabel.HORIZONTAL 48 ); 47 @Override 48 public Icon getDescriptionIcon() { 49 return ImageProvider.get("data", "object"); 49 50 } 50 51 -
trunk/src/org/openstreetmap/josm/gui/dialogs/CommandListMutableTreeNode.java
r3479 r4918 2 2 package org.openstreetmap.josm.gui.dialogs; 3 3 4 import javax.swing.JLabel; 4 5 import javax.swing.tree.DefaultMutableTreeNode; 5 6 … … 15 16 16 17 public CommandListMutableTreeNode(PseudoCommand cmd, int idx) { 17 super( cmd.getDescription());18 super(new JLabel(cmd.getDescriptionText(), cmd.getDescriptionIcon(), JLabel.HORIZONTAL)); 18 19 this.cmd = cmd; 19 20 this.idx = idx;
Note:
See TracChangeset
for help on using the changeset viewer.