Changeset 2969 in josm for trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
- Timestamp:
- 12.02.2010 20:01:55 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
r2931 r2969 236 236 Main.main.addLayer(layer); 237 237 layer.hook_up_mouse_events(); // Main.map.mapView should exist 238 // now. Can add mouse listener238 // now. Can add mouse listener 239 239 Main.map.mapView.addPropertyChangeListener(layer); 240 if (!addedToggleDialog) { 241 // TODO Workaround for bug in DialogsPanel 242 // When GeoImageLayer is added as a first layer, division by zero exception is thrown 243 // This is caused by DialogsPanel.reconstruct method which use height of other dialogs 244 // to calculate height of newly added ImageViewerDialog. But height of other dialogs is 245 // zero because it's calculated by layout manager later 246 SwingUtilities.invokeLater(new Runnable() { 247 public void run() { 248 Main.map.addToggleDialog(ImageViewerDialog.getInstance()); 249 } 250 }); 251 addedToggleDialog = true; 240 if (Main.map.getToggleDialog(ImageViewerDialog.class) == null) { 241 System.err.println("JO"); 242 ImageViewerDialog.newInstance();// = new ImageViewerDialog(); 243 Main.map.addToggleDialog(ImageViewerDialog.getInstance()); 252 244 } 253 245 … … 271 263 } 272 264 273 private static boolean addedToggleDialog = false;274 275 265 public static void create(Collection<File> files, GpxLayer gpxLayer) { 276 266 Loader loader = new Loader(files, gpxLayer); … … 291 281 return ImageProvider.get("dialogs/geoimage"); 292 282 } 293 283 294 284 public static interface LayerMenuAddition { 295 285 public Component getComponent(Layer layer); … … 306 296 JMenuItem correlateItem = new JMenuItem(tr("Correlate to GPX"), ImageProvider.get("dialogs/geoimage/gpx2img")); 307 297 correlateItem.addActionListener(new CorrelateGpxWithImages(this)); 308 298 309 299 List<Component> entries = new ArrayList<Component>(); 310 300 entries.add(new JMenuItem(LayerListDialog.getInstance().createShowHideLayerAction(this))); … … 323 313 324 314 return entries.toArray(new Component[0]); 325 315 326 316 } 327 317 … … 335 325 + " " + trn("{0} was found to be GPS tagged.", "{0} were found to be GPS tagged.", i, i); 336 326 } 337 327 338 328 @Override public Object getInfoComponent() { 339 329 return infoText(); … … 752 742 Main.map.mapView.repaint(); 753 743 } 754 744 755 745 public List<ImageEntry> getImages() { 756 746 List<ImageEntry> copy = new ArrayList<ImageEntry>();
Note: See TracChangeset
for help on using the changeset viewer.
