- Timestamp:
- 2006-07-25T23:56:55+02:00 (18 years ago)
- Location:
- src/org/openstreetmap/josm
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/Main.java
r124 r128 12 12 import java.net.URISyntaxException; 13 13 import java.util.Collection; 14 import java.util.LinkedList;15 14 import java.util.Map; 16 15 import java.util.StringTokenizer; … … 37 36 import org.openstreetmap.josm.actions.PreferencesAction; 38 37 import org.openstreetmap.josm.actions.RedoAction; 38 import org.openstreetmap.josm.actions.ReverseSegmentAction; 39 39 import org.openstreetmap.josm.actions.SaveAction; 40 40 import org.openstreetmap.josm.actions.UndoAction; 41 41 import org.openstreetmap.josm.actions.UploadAction; 42 42 import org.openstreetmap.josm.actions.mapmode.MapMode; 43 import org.openstreetmap.josm.command.ChangeCommand;44 import org.openstreetmap.josm.command.Command;45 import org.openstreetmap.josm.command.SequenceCommand;46 43 import org.openstreetmap.josm.data.Bounds; 47 44 import org.openstreetmap.josm.data.Preferences; 48 45 import org.openstreetmap.josm.data.osm.DataSet; 49 import org.openstreetmap.josm.data.osm.Node;50 import org.openstreetmap.josm.data.osm.OsmPrimitive;51 import org.openstreetmap.josm.data.osm.Segment;52 46 import org.openstreetmap.josm.data.projection.Epsg4326; 53 47 import org.openstreetmap.josm.data.projection.Projection; … … 165 159 annotationTesterAction.putValue(Action.NAME, tr("Annotation Preset Tester")); 166 160 annotationTesterAction.putValue(Action.SMALL_ICON, ImageProvider.get("annotation-tester")); 167 final Action reverseSegmentAction = new AbstractAction(){ 168 public void actionPerformed(ActionEvent e) { 169 Collection<OsmPrimitive> sel = Main.ds.getSelected(); 170 boolean hasSegments = false; 171 for (OsmPrimitive osm : sel) { 172 if (osm instanceof Segment) { 173 hasSegments = true; 174 break; 175 } 176 } 177 if (!hasSegments) { 178 JOptionPane.showMessageDialog(Main.parent, tr("Please select at least one segment.")); 179 return; 180 } 181 Collection<Command> c = new LinkedList<Command>(); 182 for (OsmPrimitive osm : sel) { 183 if (!(osm instanceof Segment)) 184 continue; 185 Segment s = (Segment)osm; 186 Segment snew = new Segment(s); 187 Node n = snew.from; 188 snew.from = snew.to; 189 snew.to = n; 190 c.add(new ChangeCommand(s, snew)); 191 } 192 editLayer().add(new SequenceCommand(tr("Reverse Segments"), c)); 193 map.repaint(); 194 } 195 }; 196 reverseSegmentAction.putValue(Action.NAME, tr("Reverse Segments")); 197 reverseSegmentAction.putValue(Action.SMALL_ICON, ImageProvider.get("segmentflip")); 198 161 final Action reverseSegmentAction = new ReverseSegmentAction(); 199 162 final Action uploadAction = new UploadAction(); 200 163 final Action saveAction = new SaveAction(); -
src/org/openstreetmap/josm/gui/MapFrame.java
r104 r128 28 28 import org.openstreetmap.josm.gui.dialogs.CommandStackDialog; 29 29 import org.openstreetmap.josm.gui.dialogs.ConflictDialog; 30 import org.openstreetmap.josm.gui.dialogs.HistoryDialog; 30 31 import org.openstreetmap.josm.gui.dialogs.LayerList; 31 32 import org.openstreetmap.josm.gui.dialogs.PropertiesDialog; … … 119 120 addIconToggle(toggleDialogs, new LayerList(this)); 120 121 addIconToggle(toggleDialogs, new PropertiesDialog(this)); 121 addIconToggle(toggleDialogs, new SelectionListDialog(this)); 122 addIconToggle(toggleDialogs, new HistoryDialog()); 123 addIconToggle(toggleDialogs, new SelectionListDialog()); 122 124 addIconToggle(toggleDialogs, conflictDialog = new ConflictDialog()); 123 125 addIconToggle(toggleDialogs, new CommandStackDialog(this)); -
src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r119 r128 36 36 import org.openstreetmap.josm.data.SelectionChangedListener; 37 37 import org.openstreetmap.josm.data.osm.OsmPrimitive; 38 import org.openstreetmap.josm.gui.MapFrame;39 38 import org.openstreetmap.josm.gui.OsmPrimitivRenderer; 40 39 import org.openstreetmap.josm.gui.PleaseWaitRunnable; … … 111 110 private JList displaylist = new JList(list); 112 111 113 /** 114 * Create a SelectionList dialog. 115 * @param mapView The mapView to get the dataset from. 116 */ 117 public SelectionListDialog(MapFrame mapFrame) { 112 public SelectionListDialog() { 118 113 super(tr("Current Selection"), "selectionlist", tr("Open a selection list window."), KeyEvent.VK_E, 150); 119 114 displaylist.setCellRenderer(new OsmPrimitivRenderer());
Note:
See TracChangeset
for help on using the changeset viewer.