~ubuntu-branches/ubuntu/utopic/sweethome3d/utopic

« back to all changes in this revision

Viewing changes to .pc/01noMacOSX/src/com/eteks/sweethome3d/SweetHome3D.java

  • Committer: Package Import Robot
  • Author(s): Gabriele Giacone
  • Date: 2013-11-05 13:02:16 UTC
  • mfrom: (1.1.14)
  • Revision ID: package-import@ubuntu.com-20131105130216-0e7dgqqvdq4pwm96
Tags: 4.2+dfsg-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
147
147
  private boolean                 pluginManagerInitialized;
148
148
  private boolean                 checkUpdatesNeeded;
149
149
  private AutoRecoveryManager     autoRecoveryManager;
150
 
  private final Map<Home, JFrame> homeFrames;
 
150
  private final Map<Home, HomeFrameController> homeFrameControllers;
151
151
 
152
152
  /**
153
153
   * Creates a home application instance. Recorders, user preferences, content
155
155
   * lazily instantiated to let subclasses override their creation.
156
156
   */
157
157
  protected SweetHome3D() {
158
 
    this.homeFrames = new HashMap<Home, JFrame>();
 
158
    this.homeFrameControllers = new HashMap<Home, HomeFrameController>();
159
159
  }
160
160
 
161
161
  /**
321
321
  }
322
322
 
323
323
  /**
324
 
   * Returns the frame that displays a given <code>home</code>.
 
324
   * Returns the frame that displays the given <code>home</code>.
325
325
   */
326
326
  JFrame getHomeFrame(Home home) {
327
 
    return this.homeFrames.get(home);
 
327
    return (JFrame)SwingUtilities.getRoot((JComponent)this.homeFrameControllers.get(home).getView());
 
328
  }
 
329
 
 
330
  /**
 
331
   * Returns the controller of the given <code>home</code>.
 
332
   */
 
333
  HomeFrameController getHomeFrameController(Home home) {
 
334
    return this.homeFrameControllers.get(home);
328
335
  }
329
336
 
330
337
  /**
405
412
                addNewHomeCloseListener(home, controller.getHomeController());
406
413
              }
407
414
 
408
 
              JFrame homeFrame = (JFrame)SwingUtilities.getRoot((JComponent) controller.getView());
409
 
              homeFrames.put(home, homeFrame);
 
415
              homeFrameControllers.put(home, controller);
410
416
            } catch (IllegalStateException ex) {
411
417
              // Check exception by class name to avoid a mandatory bind to Java 3D
412
418
              if ("javax.media.j3d.IllegalRenderingStateException".equals(ex.getClass().getName())) {
419
425
            }
420
426
            break;
421
427
          case DELETE:
422
 
            homeFrames.remove(ev.getItem());
 
428
            homeFrameControllers.remove(ev.getItem());
423
429
 
424
430
            // If application has no more home
425
431
            if (getHomes().isEmpty() && !OperatingSystem.isMacOSX()) {
495
501
      System.setProperty("apple.laf.useScreenMenuBar", "true");
496
502
      // Force the use of Quartz under Mac OS X for better Java 2D rendering performance
497
503
      System.setProperty("apple.awt.graphics.UseQuartz", "true");
498
 
      // Request to use system proxies to access to the Internet
499
 
      if (System.getProperty("java.net.useSystemProxies") == null) {
500
 
        System.setProperty("java.net.useSystemProxies", "true");
501
 
      }
 
504
    }
 
505
    // Request to use system proxies to access to the Internet
 
506
    if (System.getProperty("java.net.useSystemProxies") == null) {
 
507
      System.setProperty("java.net.useSystemProxies", "true");
502
508
    }
503
509
  }
504
510