Changeset 373 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2007-10-13T00:12:31+02:00 (19 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
-
MapFrame.java (modified) (1 diff)
-
MapStatus.java (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapFrame.java
r365 r373 54 54 * The status line below the map 55 55 */ 56 p rivateMapStatus statusLine;56 public MapStatus statusLine; 57 57 58 58 public ConflictDialog conflictDialog; -
trunk/src/org/openstreetmap/josm/gui/MapStatus.java
r343 r373 6 6 import java.awt.AWTEvent; 7 7 import java.awt.Cursor; 8 import java.awt.Dimension; 8 9 import java.awt.EventQueue; 9 10 import java.awt.Font; … … 17 18 import java.awt.event.MouseMotionListener; 18 19 import java.lang.reflect.InvocationTargetException; 20 import java.text.DecimalFormat; 21 import java.text.NumberFormat; 19 22 import java.util.Collection; 20 23 import java.util.ConcurrentModificationException; … … 58 61 * The position of the mouse cursor. 59 62 */ 60 JTextField positionText = new JTextField("-000.00000000000000 -000.00000000000000".length()); 63 DecimalFormat latlon = new DecimalFormat("###0.0000000"); 64 JTextField positionText = new JTextField(25); 65 61 66 /** 62 67 * The field holding the name of the object under the mouse. … … 64 69 JTextField nameText = new JTextField(30); 65 70 71 /** 72 * The field holding information about what the user can do. 73 */ 74 JTextField helpText = new JTextField(); 75 66 76 /** 67 77 * The collector class that waits for notification and then update … … 114 124 // the data. 115 125 try { 116 Collection<OsmPrimitive> osms = mv.getAllNearest(ms.mousePos); 117 118 if (osms == null && osmStatus == null && ms.modifiers == oldModifiers) 119 continue; 120 if (osms != null && osms.equals(osmStatus) && ms.modifiers == oldModifiers) 121 continue; 122 126 // Popup Information 127 if ((ms.modifiers & MouseEvent.BUTTON2_DOWN_MASK) != 0 ) { 128 Collection<OsmPrimitive> osms = mv.getAllNearest(ms.mousePos); 129 130 if (osms == null) 131 continue; 132 if (osms != null && osms.equals(osmStatus) && ms.modifiers == oldModifiers) 133 continue; 134 /* 123 135 osmStatus = osms; 124 136 oldModifiers = ms.modifiers; … … 133 145 } else 134 146 nameText.setText(""); 135 136 // Popup Information137 if ((ms.modifiers & MouseEvent.BUTTON2_DOWN_MASK) != 0 && osms != null) { 147 */ 148 149 138 150 if (popup != null) { 139 151 try { … … 235 247 if ((e.getModifiersEx() & MouseEvent.CTRL_DOWN_MASK) == 0) { 236 248 LatLon p = mv.getLatLon(e.getX(),e.getY()); 237 positionText.setText(p.lat() +" "+p.lon());249 positionText.setText(latlon.format(p.lat())+" "+latlon.format(p.lon())); 238 250 } 239 251 } … … 242 254 positionText.setEditable(false); 243 255 nameText.setEditable(false); 244 setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); 256 helpText.setEditable(false); 257 setLayout(new GridBagLayout()); 245 258 setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); 246 add(new JLabel(tr("Lat/Lon")+" ")); 247 add(positionText); 248 add(new JLabel(" "+tr("Object")+" ")); 249 add(nameText); 250 259 add(new JLabel(tr("Lat/Lon")+" "), GBC.std()); 260 add(positionText, GBC.std()); 261 //add(new JLabel(" "+tr("Object")+" ")); 262 //add(nameText); 263 add(helpText, GBC.eol().fill(GBC.HORIZONTAL)); 264 positionText.setMinimumSize(new Dimension(positionText.getMinimumSize().height, 200)); 265 251 266 // The background thread 252 267 final Collector collector = new Collector(mapFrame); … … 270 285 return "Statusline"; 271 286 } 287 288 public void setHelpText(String t) { 289 helpText.setText(t); 290 } 272 291 }
Note:
See TracChangeset
for help on using the changeset viewer.
