示例#1
0
 protected void closeNativeImpl() {
   if (0 != windowHandleClose && null != getScreen()) {
     DisplayDriver display = (DisplayDriver) getScreen().getDisplay();
     final AbstractGraphicsDevice edtDevice = display.getGraphicsDevice();
     edtDevice.lock();
     try {
       CloseWindow0(
           edtDevice.getHandle(),
           windowHandleClose,
           display.getJavaObjectAtom(),
           display.getWindowDeleteAtom());
     } catch (Throwable t) {
       if (DEBUG_IMPLEMENTATION) {
         Exception e =
             new Exception(
                 "Warning: closeNativeImpl failed - " + Thread.currentThread().getName(), t);
         e.printStackTrace();
       }
     } finally {
       edtDevice.unlock();
       windowHandleClose = 0;
     }
   }
   if (null != renderDevice) {
     renderDevice.close(); // closes X11 display
     renderDevice = null;
   }
 }
示例#2
0
 static int atoi(String a) {
   int i = 0;
   try {
     i = Integer.parseInt(a);
   } catch (Exception ex) {
     ex.printStackTrace();
   }
   return i;
 }
示例#3
0
  public static void main(String[] args) {
    int type = USE_NEWT;
    String tstName = "demos.es2.perftst.PerfVBOLoad"; // default

    for (int i = args.length - 1; i >= 0; i--) {
      if (args[i].equals("-awt")) {
        type |= USE_AWT;
      }
      if (args[i].equals("-test") && i + 1 < args.length) {
        tstName = args[i + 1];
      }
    }

    try {
      PerfModule pmod = (PerfModule) Class.forName(tstName).newInstance();
      new Perftst().run(type, pmod);
      System.exit(0);
    } catch (Exception e) {
      e.printStackTrace();
      System.exit(1);
    }
  }