/*
  * Called from native code when we have been dragged onto another screen.
  */
 void draggedToNewScreen() {
   SunToolkit.executeOnEventHandlerThread(
       (Component) target,
       new Runnable() {
         public void run() {
           displayChanged();
         }
       });
 }
Beispiel #2
0
 public void setXEmbedDropTarget() {
   // Register a drop site on the top level.
   Runnable r =
       new Runnable() {
         public void run() {
           target.setDropTarget(new XEmbedDropTarget());
         }
       };
   SunToolkit.executeOnEventHandlerThread(target, r);
 }
Beispiel #3
0
 public void removeXEmbedDropTarget() {
   // Unregister a drop site on the top level.
   Runnable r =
       new Runnable() {
         public void run() {
           if (target.getDropTarget() instanceof XEmbedDropTarget) {
             target.setDropTarget(null);
           }
         }
       };
   SunToolkit.executeOnEventHandlerThread(target, r);
 }
Beispiel #4
0
  /** Returns true if the GraphicsDevice has been changed, false otherwise. */
  public boolean updateGraphicsDevice() {
    GraphicsDevice newGraphicsDevice = platformWindow.getGraphicsDevice();
    synchronized (getStateLock()) {
      if (graphicsDevice == newGraphicsDevice) {
        return false;
      }
      graphicsDevice = newGraphicsDevice;
    }

    final GraphicsConfiguration newGC = newGraphicsDevice.getDefaultConfiguration();

    if (!setGraphicsConfig(newGC)) return false;

    SunToolkit.executeOnEventHandlerThread(
        getTarget(),
        new Runnable() {
          public void run() {
            AWTAccessor.getComponentAccessor().setGraphicsConfiguration(getTarget(), newGC);
          }
        });
    return true;
  }