- Timestamp:
- 2006-12-31T16:36:27+01:00 (18 years ago)
- Location:
- src/org/openstreetmap/josm
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/data/osm/visitor/SimplePaintVisitor.java
r167 r181 85 85 } 86 86 87 for (Segment ls : w.segments) 87 int orderNumber = 0; 88 for (Segment ls : w.segments) { 89 orderNumber++; 88 90 if (!ls.selected) // selected already in good color 89 91 drawSegment(ls, w.selected ? getPreferencesColor("selected", Color.WHITE) : wayColor); 92 if (Main.pref.getBoolean("draw.segment.order_number")) 93 drawOrderNumber(ls, orderNumber); 94 } 90 95 } 96 97 /** 98 * Draw an number of the order of the segment within the parents way 99 */ 100 private void drawOrderNumber(Segment ls, int orderNumber) { 101 int strlen = (""+orderNumber).length(); 102 Point p1 = nc.getPoint(ls.from.eastNorth); 103 Point p2 = nc.getPoint(ls.to.eastNorth); 104 int x = (p1.x+p2.x)/2 - 4*strlen; 105 int y = (p1.y+p2.y)/2 + 4; 106 Color c = g.getColor(); 107 g.setColor(Color.black); 108 g.fillRect(x-1,y-12,8*strlen+1,14); 109 g.setColor(c); 110 g.drawString(""+orderNumber,x,y); 111 } 91 112 92 113 /** -
src/org/openstreetmap/josm/gui/MainMenu.java
r175 r181 23 23 import org.openstreetmap.josm.actions.SaveAction; 24 24 import org.openstreetmap.josm.actions.SaveAsAction; 25 import org.openstreetmap.josm.actions.SelectAllAction; 25 26 import org.openstreetmap.josm.actions.UndoAction; 27 import org.openstreetmap.josm.actions.UnselectAllAction; 26 28 import org.openstreetmap.josm.actions.UploadAction; 27 29 … … 38 40 public final UndoAction undo = new UndoAction(); 39 41 public final RedoAction redo = new RedoAction(); 42 public final Action selectAll = new SelectAllAction(); 43 public final Action unselectAll = new UnselectAllAction(); 40 44 public final NewAction newAction = new NewAction(); 41 45 public final OpenAction open = new OpenAction(); … … 77 81 editMenu.add(redo); 78 82 editMenu.addSeparator(); 83 editMenu.add(selectAll); 84 editMenu.add(unselectAll); 85 editMenu.addSeparator(); 79 86 editMenu.add(reverseSegment); 80 87 editMenu.add(alignInCircle); -
src/org/openstreetmap/josm/gui/MapStatus.java
r172 r181 5 5 import java.awt.AWTEvent; 6 6 import java.awt.Cursor; 7 import java.awt.EventQueue; 7 8 import java.awt.Font; 8 9 import java.awt.GridBagLayout; … … 14 15 import java.awt.event.MouseEvent; 15 16 import java.awt.event.MouseMotionListener; 17 import java.lang.reflect.InvocationTargetException; 16 18 import java.util.Collection; 17 19 import java.util.ConcurrentModificationException; … … 133 135 // Popup Information 134 136 if ((ms.modifiers & MouseEvent.BUTTON2_DOWN_MASK) != 0 && osms != null) { 135 if (popup != null) 136 popup.hide(); 137 if (popup != null) { 138 try { 139 EventQueue.invokeAndWait(new Runnable() { 140 public void run() { 141 popup.hide(); 142 } 143 }); 144 } catch (InterruptedException e) { 145 } catch (InvocationTargetException e) { 146 throw new RuntimeException(e); 147 } 148 } 137 149 138 150 JPanel c = new JPanel(new GridBagLayout()); … … 169 181 Point p = mv.getLocationOnScreen(); 170 182 popup = PopupFactory.getSharedInstance().getPopup(mv, c, p.x+ms.mousePos.x+16, p.y+ms.mousePos.y+16); 171 popup.show(); 183 final Popup staticPopup = popup; 184 EventQueue.invokeLater(new Runnable(){ 185 public void run() { 186 staticPopup.show(); 187 } 188 }); 172 189 } else if (popup != null) { 173 popup.hide();190 final Popup staticPopup = popup; 174 191 popup = null; 192 EventQueue.invokeLater(new Runnable(){ 193 public void run() { 194 staticPopup.hide(); 195 } 196 }); 175 197 } 176 198 } catch (ConcurrentModificationException x) { -
src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
r158 r181 34 34 import org.openstreetmap.josm.gui.MapView.LayerChangeListener; 35 35 import org.openstreetmap.josm.gui.layer.Layer; 36 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 37 import org.openstreetmap.josm.tools.DontShowAgainInfo; 36 38 import org.openstreetmap.josm.tools.ImageProvider; 37 39 import org.openstreetmap.josm.tools.ImageProvider.OverlayPosition; … … 65 67 public void actionPerformed(ActionEvent e) { 66 68 int sel = instance.getSelectedIndex(); 67 if (layer != null)68 Main.main.removeLayer(layer);69 else70 Main.main.removeLayer((Layer)instance.getSelectedValue());69 Layer l = layer != null ? layer : (Layer)instance.getSelectedValue(); 70 if (l instanceof OsmDataLayer && !DontShowAgainInfo.show("delete_layer", tr("Do you really want to delete the whole layer?"))) 71 return; 72 Main.main.removeLayer(l); 71 73 if (sel >= instance.getModel().getSize()) 72 74 sel = instance.getModel().getSize()-1; -
src/org/openstreetmap/josm/gui/preferences/DrawingPreference.java
r168 r181 17 17 private JCheckBox largeGpsPoints = new JCheckBox(tr("Draw large GPS points.")); 18 18 private JCheckBox directionHint = new JCheckBox(tr("Draw Direction Arrows")); 19 private JCheckBox segmentOrderNumber = new JCheckBox(tr("Draw segment order numbers")); 19 20 20 21 public void addGui(PreferenceDialog gui) { … … 46 47 directionHint.setSelected(Main.pref.getBoolean("draw.segment.direction")); 47 48 gui.display.add(directionHint, GBC.eop().insets(20,0,0,0)); 49 50 // segment order number 51 segmentOrderNumber.setToolTipText(tr("Draw the order numbers of all segments within their way.")); 52 segmentOrderNumber.setSelected(Main.pref.getBoolean("draw.segment.order_number")); 53 gui.display.add(segmentOrderNumber, GBC.eop().insets(20,0,0,0)); 48 54 } 49 55 … … 53 59 Main.pref.put("draw.rawgps.large", largeGpsPoints.isSelected()); 54 60 Main.pref.put("draw.segment.direction", directionHint.isSelected()); 61 Main.pref.put("draw.segment.order_number", segmentOrderNumber.isSelected()); 55 62 } 56 63 } -
src/org/openstreetmap/josm/gui/preferences/PluginPreference.java
r168 r181 27 27 public class PluginPreference implements PreferenceSetting { 28 28 29 private Map<PluginInformation, Boolean> pluginMap = new HashMap<PluginInformation, Boolean>();29 private Map<PluginInformation, Boolean> pluginMap; 30 30 31 31 public void addGui(final PreferenceDialog gui) { 32 pluginMap = new HashMap<PluginInformation, Boolean>(); 32 33 Box pluginPanel = Box.createVerticalBox(); 33 34 Collection<PluginInformation> availablePlugins = new LinkedList<PluginInformation>(); -
src/org/openstreetmap/josm/tools/DontShowAgainInfo.java
r180 r181 7 7 8 8 import javax.swing.JCheckBox; 9 import javax.swing.JLabel; 9 10 import javax.swing.JOptionPane; 10 11 import javax.swing.JPanel; … … 13 14 14 15 public class DontShowAgainInfo { 16 17 public static boolean show(String prefKey, String msg) { 18 return show(prefKey, new JLabel(msg)); 19 } 15 20 16 21 public static boolean show(String prefKey, Container msg) {
Note:
See TracChangeset
for help on using the changeset viewer.