示例#1
0
 @Override
 public final synchronized void setRealized(boolean realizedArg) {
   if (realized != realizedArg) {
     if (DEBUG) {
       System.err.println(
           getThreadName()
               + ": setRealized: "
               + getClass().getSimpleName()
               + " "
               + realized
               + " -> "
               + realizedArg);
     }
     realized = realizedArg;
     AbstractGraphicsDevice aDevice = surface.getGraphicsConfiguration().getScreen().getDevice();
     if (realizedArg) {
       if (surface instanceof ProxySurface) {
         ((ProxySurface) surface).createNotify();
       }
       if (NativeSurface.LOCK_SURFACE_NOT_READY >= lockSurface()) {
         throw new GLException(
             "GLDrawableImpl.setRealized(true): Surface not ready (lockSurface)");
       }
     } else {
       aDevice.lock();
     }
     try {
       if (realizedArg) {
         setRealizedImpl();
         updateHandle();
       } else {
         destroyHandle();
         setRealizedImpl();
       }
     } finally {
       if (realizedArg) {
         unlockSurface();
       } else {
         aDevice.unlock();
         if (surface instanceof ProxySurface) {
           ((ProxySurface) surface).destroyNotify();
         }
       }
     }
   } else if (DEBUG) {
     System.err.println(
         getThreadName()
             + ": setRealized: "
             + getClass().getName()
             + " "
             + this.realized
             + " == "
             + realizedArg);
   }
 }
示例#2
0
 public final synchronized void setRealized(boolean realizedArg) {
   if (realized != realizedArg) {
     if (DEBUG) {
       System.err.println(
           "setRealized: " + getClass().getName() + " " + realized + " -> " + realizedArg);
     }
     realized = realizedArg;
     AbstractGraphicsDevice aDevice = surface.getGraphicsConfiguration().getScreen().getDevice();
     if (realizedArg) {
       if (NativeSurface.LOCK_SURFACE_NOT_READY >= lockSurface()) {
         throw new GLException(
             "GLDrawableImpl.setRealized(true): already realized, but surface not ready (lockSurface)");
       }
     } else {
       aDevice.lock();
     }
     try {
       setRealizedImpl();
       if (realizedArg) {
         updateHandle();
       } else {
         destroyHandle();
       }
     } finally {
       if (realizedArg) {
         unlockSurface();
       } else {
         aDevice.unlock();
       }
     }
   } else if (DEBUG) {
     System.err.println(
         "setRealized: " + getClass().getName() + " " + this.realized + " == " + realizedArg);
   }
 }