jfxrt

16:22:18.184 INFO  jd.cli.Main - Decompiling jfxrt.jar
package com.sun.browser.plugin;

import com.sun.webpane.platform.graphics.WCGraphicsContext;
import java.io.IOError;
import java.net.URL;
import java.util.logging.Logger;

public class DefaultPlugin
  implements Plugin
{
  private static final Logger log = Logger.getLogger("com.sun.browser.plugin.DefaultPlugin");
  private int x = 0;
  private int y = 0;
  private int w = 0;
  private int h = 0;
  
  public void init(String paramString) {}
  
  public DefaultPlugin()
  {
    init("Default Plugin");
  }
  
  DefaultPlugin(URL paramURL, String paramString, String[] paramArrayOfString1, String[] paramArrayOfString2)
  {
    init("Default Plugin for: " + (null == paramURL ? "(null)" : paramURL.toExternalForm()));
  }
  
  public void paint(WCGraphicsContext paramWCGraphicsContext, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    paramWCGraphicsContext.fillRect(x, y, w, h, Integer.valueOf(296419327));
  }
  
  public void activate(Object paramObject, PluginListener paramPluginListener) {}
  
  public void destroy() {}
  
  public void setVisible(boolean paramBoolean) {}
  
  public void setEnabled(boolean paramBoolean) {}
  
  public void setBounds(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    x = paramInt1;
    y = paramInt2;
    w = paramInt3;
    h = paramInt4;
  }
  
  public Object invoke(String paramString1, String paramString2, Object[] paramArrayOfObject)
    throws IOError
  {
    return null;
  }
  
  public boolean handleMouseEvent(String paramString, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3, boolean paramBoolean4, boolean paramBoolean5, long paramLong)
  {
    return false;
  }
  
  public void requestFocus() {}
  
  public void setNativeContainerBounds(int paramInt1, int paramInt2, int paramInt3, int paramInt4) {}
}

/* Location:
 * Qualified Name:     com.sun.browser.plugin.DefaultPlugin
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.browser.plugin;

import com.sun.webpane.platform.graphics.WCGraphicsContext;
import java.io.IOException;

public abstract interface Plugin
{
  public static final int EVENT_BEFOREACTIVATE = -4;
  public static final int EVENT_FOCUSCHANGE = -1;
  
  public abstract void requestFocus();
  
  public abstract void setNativeContainerBounds(int paramInt1, int paramInt2, int paramInt3, int paramInt4);
  
  public abstract void activate(Object paramObject, PluginListener paramPluginListener);
  
  public abstract void destroy();
  
  public abstract void setVisible(boolean paramBoolean);
  
  public abstract void setEnabled(boolean paramBoolean);
  
  public abstract void setBounds(int paramInt1, int paramInt2, int paramInt3, int paramInt4);
  
  public abstract Object invoke(String paramString1, String paramString2, Object[] paramArrayOfObject)
    throws IOException;
  
  public abstract void paint(WCGraphicsContext paramWCGraphicsContext, int paramInt1, int paramInt2, int paramInt3, int paramInt4);
  
  public abstract boolean handleMouseEvent(String paramString, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3, boolean paramBoolean4, boolean paramBoolean5, long paramLong);
}

/* Location:
 * Qualified Name:     com.sun.browser.plugin.Plugin
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.browser.plugin;

import java.net.URL;

public abstract interface PluginHandler
{
  public abstract String getName();
  
  public abstract String getFileName();
  
  public abstract String getDescription();
  
  public abstract String[] supportedMIMETypes();
  
  public abstract boolean isSupportedMIMEType(String paramString);
  
  public abstract boolean isSupportedPlatform();
  
  public abstract Plugin createPlugin(URL paramURL, String paramString, String[] paramArrayOfString1, String[] paramArrayOfString2);
}

/* Location:
 * Qualified Name:     com.sun.browser.plugin.PluginHandler
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.browser.plugin;

public abstract interface PluginListener
{
  public abstract void fwkRedraw(int paramInt1, int paramInt2, int paramInt3, int paramInt4, boolean paramBoolean);
  
  public abstract String fwkEvent(int paramInt, String paramString1, String paramString2);
}

/* Location:
 * Qualified Name:     com.sun.browser.plugin.PluginListener
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.browser.plugin;

import java.net.URL;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.ServiceLoader;
import java.util.TreeMap;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;

public class PluginManager
{
  private static final Logger log = Logger.getLogger("com.sun.browser.plugin.PluginManager");
  static ServiceLoader<PluginHandler> pHandlers = ServiceLoader.load(PluginHandler.class);
  static TreeMap<String, PluginHandler> hndMap = new TreeMap();
  static PluginHandler[] hndArray;
  static HashSet<String> disabledPluginHandlers = new HashSet();
  
  static void updatePluginHandlers()
  {
    log.fine("Update plugin handlers");
    hndMap.clear();
    Iterator localIterator = pHandlers.iterator();
    while (localIterator.hasNext())
    {
      localObject = (PluginHandler)localIterator.next();
      if ((((PluginHandler)localObject).isSupportedPlatform()) && (!isDisabledPlugin((PluginHandler)localObject)))
      {
        String[] arrayOfString1 = ((PluginHandler)localObject).supportedMIMETypes();
        for (String str : arrayOfString1)
        {
          hndMap.put(str, localObject);
          log.fine(str);
        }
      }
    }
    Object localObject = hndMap.values();
    hndArray = (PluginHandler[])((Collection)localObject).toArray(new PluginHandler[((Collection)localObject).size()]);
  }
  
  public static Plugin createPlugin(URL paramURL, String paramString, String[] paramArrayOfString1, String[] paramArrayOfString2)
  {
    try
    {
      PluginHandler localPluginHandler = (PluginHandler)hndMap.get(paramString);
      if (localPluginHandler == null) {
        return new DefaultPlugin(paramURL, paramString, paramArrayOfString1, paramArrayOfString2);
      }
      Plugin localPlugin = localPluginHandler.createPlugin(paramURL, paramString, paramArrayOfString1, paramArrayOfString2);
      if (localPlugin == null) {
        return new DefaultPlugin(paramURL, paramString, paramArrayOfString1, paramArrayOfString2);
      }
      return localPlugin;
    }
    catch (Throwable localThrowable)
    {
      log.log(Level.FINE, "Cannot create plugin", localThrowable);
    }
    return new DefaultPlugin(paramURL, paramString, paramArrayOfString1, paramArrayOfString2);
  }
  
  public static List<PluginHandler> getAvailablePlugins()
  {
    Vector localVector = new Vector();
    Iterator localIterator = pHandlers.iterator();
    while (localIterator.hasNext())
    {
      PluginHandler localPluginHandler = (PluginHandler)localIterator.next();
      if (localPluginHandler.isSupportedPlatform()) {
        localVector.add(localPluginHandler);
      }
    }
    return localVector;
  }
  
  public static PluginHandler getEnabledPlugin(int paramInt)
  {
    if ((paramInt < 0) || (paramInt >= hndArray.length)) {
      return null;
    }
    return hndArray[paramInt];
  }
  
  public static int getEnabledPluginCount()
  {
    return hndArray.length;
  }
  
  public static void disablePlugin(PluginHandler paramPluginHandler)
  {
    disabledPluginHandlers.add(paramPluginHandler.getClass().getCanonicalName());
    updatePluginHandlers();
  }
  
  public static void enablePlugin(PluginHandler paramPluginHandler)
  {
    disabledPluginHandlers.remove(paramPluginHandler.getClass().getCanonicalName());
    updatePluginHandlers();
  }
  
  public static boolean isDisabledPlugin(PluginHandler paramPluginHandler)
  {
    return disabledPluginHandlers.contains(paramPluginHandler.getClass().getCanonicalName());
  }
  
  public static boolean supportsMIMEType(String paramString)
  {
    return hndMap.containsKey(paramString);
  }
  
  public static String getPluginNameForMIMEType(String paramString)
  {
    PluginHandler localPluginHandler = (PluginHandler)hndMap.get(paramString);
    if (localPluginHandler != null) {
      return localPluginHandler.getName();
    }
    return "";
  }
  
  static
  {
    if ("false".equalsIgnoreCase(System.getProperty("com.sun.browser.plugin")))
    {
      Iterator localIterator = getAvailablePlugins().iterator();
      while (localIterator.hasNext())
      {
        PluginHandler localPluginHandler = (PluginHandler)localIterator.next();
        disabledPluginHandlers.add(localPluginHandler.getClass().getCanonicalName());
      }
    }
    updatePluginHandlers();
  }
}

/* Location:
 * Qualified Name:     com.sun.browser.plugin.PluginManager
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.uitoolkit.impl.fx;

import javafx.stage.Stage;

public abstract interface AppletStageManager
{
  public abstract Stage getAppletStage();
  
  public abstract Stage getPreloaderStage();
  
  public abstract Stage getErrorStage();
  
  public abstract void setSize(int paramInt1, int paramInt2);
}

/* Location:
 * Qualified Name:     com.sun.deploy.uitoolkit.impl.fx.AppletStageManager
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.uitoolkit.impl.fx;

import java.security.PrivilegedExceptionAction;

final class DeployPerfLogger$1
  implements PrivilegedExceptionAction<Boolean>
{
  public Boolean run()
  {
    return Boolean.valueOf("true".equals(System.getProperty("jnlp.fx.perf")));
  }
}

/* Location:
 * Qualified Name:     com.sun.deploy.uitoolkit.impl.fx.DeployPerfLogger.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.uitoolkit.impl.fx;

import com.sun.deploy.trace.Trace;

class DeployPerfLogger$PerfLoggerThread
  extends Thread
{
  private boolean isActive = true;
  
  synchronized boolean isActive()
  {
    return isActive;
  }
  
  public DeployPerfLogger$PerfLoggerThread()
  {
    super("Deploy Perf Logger");
    setDaemon(true);
    if (DeployPerfLogger.PERF_LOG_ENABLED)
    {
      Trace.println("Starting perf tracing thread");
      start();
    }
  }
  
  public void run()
  {
    try
    {
      int i = 1;
      long l = System.currentTimeMillis();
      while (i != 0)
      {
        if (DeployPerfLogger.access$000() != null)
        {
          try
          {
            DeployPerfLogger.access$100();
            DeployPerfLogger.access$202(false);
          }
          catch (Exception localException)
          {
            if (DeployPerfLogger.access$200())
            {
              i = 0;
              Trace.ignoredException(localException);
            }
            else
            {
              DeployPerfLogger.access$202(true);
            }
            synchronized (DeployPerfLogger.class)
            {
              DeployPerfLogger.access$302(null);
            }
          }
        }
        else if (System.currentTimeMillis() - l > 5000L)
        {
          Trace.println("Stop perf tracing as could not get JS object");
          i = 0;
        }
        synchronized (DeployPerfLogger.access$400())
        {
          try
          {
            DeployPerfLogger.access$400().wait(10000L);
          }
          catch (InterruptedException localInterruptedException)
          {
            i = 0;
          }
        }
      }
    }
    catch (Throwable i)
    {
      Trace.ignored((Throwable)???);
    }
    finally
    {
      synchronized (this)
      {
        isActive = false;
      }
    }
  }
}

/* Location:
 * Qualified Name:     com.sun.deploy.uitoolkit.impl.fx.DeployPerfLogger.PerfLoggerThread
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.uitoolkit.impl.fx;

class DeployPerfLogger$Record
{
  long tm;
  String label;
  
  public DeployPerfLogger$Record(long paramLong, String paramString)
  {
    tm = paramLong;
    label = paramString;
  }
}

/* Location:
 * Qualified Name:     com.sun.deploy.uitoolkit.impl.fx.DeployPerfLogger.Record
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.uitoolkit.impl.fx;

import com.sun.applet2.Applet2Context;
import com.sun.applet2.Applet2Host;
import com.sun.deploy.trace.Trace;
import java.security.AccessController;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.LinkedList;
import java.util.List;
import netscape.javascript.JSObject;
import sun.plugin2.applet2.Plugin2Host;

public class DeployPerfLogger
{
  private static Applet2Context ctx;
  private static boolean gotError = false;
  private static final List<Record> queue = new LinkedList();
  public static boolean PERF_LOG_ENABLED = false;
  private static JSObject js = null;
  private static PerfLoggerThread logger = null;
  public static long lastReported = 0L;
  private static long firstReported = 0L;
  
  private static synchronized JSObject getJSObject()
  {
    if (js != null) {
      return js;
    }
    if (ctx != null)
    {
      Applet2Host localApplet2Host = ctx.getHost();
      if ((localApplet2Host instanceof Plugin2Host)) {
        try
        {
          js = ((Plugin2Host)localApplet2Host).getOneWayJSObject();
        }
        catch (Exception localException)
        {
          ctx = null;
        }
      }
    }
    return js;
  }
  
  public static void setContext(Applet2Context paramApplet2Context)
  {
    if (!PERF_LOG_ENABLED) {
      return;
    }
    ctx = paramApplet2Context;
  }
  
  private static void flushQueue()
  {
    int i = 1;
    JSObject localJSObject = getJSObject();
    if (localJSObject == null) {
      return;
    }
    while (i != 0)
    {
      Record localRecord;
      synchronized (queue)
      {
        if (!queue.isEmpty()) {
          localRecord = (Record)queue.remove(0);
        } else {
          localRecord = null;
        }
      }
      if (localRecord != null) {
        report(localJSObject, localRecord);
      } else {
        i = 0;
      }
    }
  }
  
  private static void report(JSObject paramJSObject, Record paramRecord)
  {
    long l1 = System.nanoTime();
    long l2 = (tm - l1) / 1000000L;
    String str = label;
    if (lastReported == 0L) {
      firstReported = l1;
    }
    if (lastReported != 0L) {
      str = "[" + (l1 - firstReported + 500000L) / 1000000L + " ms" + "(delta=" + (l1 - lastReported + 500000L) / 1000000L + ")] " + str;
    }
    Trace.println("PERFLOG: report [" + str + "]");
    paramJSObject.eval("if (typeof perfLog == 'function') {    perfLog(" + l2 + ", '" + str + "');}");
    lastReported = l1;
  }
  
  public static void timestamp(String paramString)
  {
    long l = System.nanoTime();
    if ((PERF_LOG_ENABLED) && (logger != null) && (logger.isActive())) {
      synchronized (queue)
      {
        queue.add(new Record(l, paramString));
        queue.notifyAll();
      }
    }
  }
  
  static
  {
    PERF_LOG_ENABLED = false;
    try
    {
      PERF_LOG_ENABLED = ((Boolean)AccessController.doPrivileged(new PrivilegedExceptionAction()
      {
        public Boolean run()
        {
          return Boolean.valueOf("true".equals(System.getProperty("jnlp.fx.perf")));
        }
      })).booleanValue();
      if (PERF_LOG_ENABLED) {
        logger = new PerfLoggerThread();
      }
    }
    catch (PrivilegedActionException localPrivilegedActionException)
    {
      Trace.ignored(localPrivilegedActionException);
    }
  }
  
  static class PerfLoggerThread
    extends Thread
  {
    private boolean isActive = true;
    
    synchronized boolean isActive()
    {
      return isActive;
    }
    
    public PerfLoggerThread()
    {
      super();
      setDaemon(true);
      if (DeployPerfLogger.PERF_LOG_ENABLED)
      {
        Trace.println("Starting perf tracing thread");
        start();
      }
    }
    
    public void run()
    {
      try
      {
        int i = 1;
        long l = System.currentTimeMillis();
        while (i != 0)
        {
          if (DeployPerfLogger.access$000() != null)
          {
            try
            {
              DeployPerfLogger.access$100();
              DeployPerfLogger.access$202(false);
            }
            catch (Exception localException)
            {
              if (DeployPerfLogger.gotError)
              {
                i = 0;
                Trace.ignoredException(localException);
              }
              else
              {
                DeployPerfLogger.access$202(true);
              }
              synchronized (DeployPerfLogger.class)
              {
                DeployPerfLogger.access$302(null);
              }
            }
          }
          else if (System.currentTimeMillis() - l > 5000L)
          {
            Trace.println("Stop perf tracing as could not get JS object");
            i = 0;
          }
          synchronized (DeployPerfLogger.queue)
          {
            try
            {
              DeployPerfLogger.queue.wait(10000L);
            }
            catch (InterruptedException localInterruptedException)
            {
              i = 0;
            }
          }
        }
      }
      catch (Throwable i)
      {
        Trace.ignored((Throwable)???);
      }
      finally
      {
        synchronized (this)
        {
          isActive = false;
        }
      }
    }
  }
  
  static class Record
  {
    long tm;
    String label;
    
    public Record(long paramLong, String paramString)
    {
      tm = paramLong;
      label = paramString;
    }
  }
}

/* Location:
 * Qualified Name:     com.sun.deploy.uitoolkit.impl.fx.DeployPerfLogger
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.uitoolkit.impl.fx;

import com.sun.javafx.applet.FXApplet2;
import com.sun.javafx.application.PlatformImpl;
import com.sun.javafx.application.PlatformImpl.FinishListener;

class FXApplet2Adapter$1
  implements PlatformImpl.FinishListener
{
  FXApplet2Adapter$1(FXApplet2Adapter paramFXApplet2Adapter) {}
  
  private void destroyIfNeeded()
  {
    if (FXApplet2Adapter.access$000(this$0) == null) {
      try
      {
        if (this$0.applet2 != null) {
          this$0.applet2.stop();
        }
        if (this$0.preLoader != null) {
          this$0.preLoader.stop();
        }
        if (this$0.applet2 != null) {
          this$0.applet2.destroy();
        }
        this$0.applet2 = null;
      }
      catch (Exception localException)
      {
        localException.printStackTrace();
      }
      finally
      {
        PlatformImpl.removeListener(FXApplet2Adapter.access$100(this$0));
        FXApplet2Adapter.access$200();
      }
    }
  }
  
  public void idle(boolean paramBoolean)
  {
    if ((paramBoolean) && (this$0.isExitOnIdle())) {
      destroyIfNeeded();
    }
  }
  
  public void exitCalled()
  {
    destroyIfNeeded();
  }
}

/* Location:
 * Qualified Name:     com.sun.deploy.uitoolkit.impl.fx.FXApplet2Adapter.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.uitoolkit.impl.fx;

import com.sun.deploy.uitoolkit.impl.fx.ui.ErrorPane;
import javafx.scene.Scene;
import javafx.stage.Stage;

class FXApplet2Adapter$2
  implements Runnable
{
  FXApplet2Adapter$2(FXApplet2Adapter paramFXApplet2Adapter, Throwable paramThrowable, boolean paramBoolean) {}
  
  public void run()
  {
    Stage localStage = FXApplet2Adapter.access$000(this$0) != null ? FXApplet2Adapter.access$000(this$0).getErrorStage() : new Stage();
    ErrorPane localErrorPane = new ErrorPane(FXApplet2Adapter.access$300(this$0), val$reason, val$doReload);
    localStage.setScene(new Scene(localErrorPane));
    localStage.show();
    localStage.toFront();
  }
}

/* Location:
 * Qualified Name:     com.sun.deploy.uitoolkit.impl.fx.FXApplet2Adapter.2
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.uitoolkit.impl.fx;

import com.sun.applet2.Applet2;
import com.sun.applet2.Applet2Context;
import com.sun.applet2.preloader.Preloader;
import com.sun.deploy.uitoolkit.Applet2Adapter;
import com.sun.deploy.uitoolkit.Window;
import com.sun.deploy.uitoolkit.impl.fx.ui.ErrorPane;
import com.sun.javafx.applet.ExperimentalExtensions;
import com.sun.javafx.applet.FXApplet2;
import com.sun.javafx.applet.HostServicesImpl;
import com.sun.javafx.application.PlatformImpl;
import com.sun.javafx.application.PlatformImpl.FinishListener;
import javafx.application.Platform;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class FXApplet2Adapter
  extends Applet2Adapter
{
  FXApplet2 applet2 = null;
  FXPreloader preLoader = null;
  private PlatformImpl.FinishListener finishListener;
  private boolean exitOnIdle = false;
  private static boolean platformDestroyed = false;
  private static FXApplet2Adapter adapter = null;
  private FXWindow window = null;
  
  FXApplet2Adapter(Applet2Context paramApplet2Context)
  {
    super(paramApplet2Context);
    DeployPerfLogger.setContext(paramApplet2Context);
    synchronized (FXApplet2Adapter.class)
    {
      adapter = this;
    }
    ExperimentalExtensions.init(paramApplet2Context);
    HostServicesImpl.init(paramApplet2Context);
    installFinishListener();
  }
  
  void abortApplet()
  {
    if (applet2 != null) {
      applet2.abortLaunch();
    }
  }
  
  synchronized void setExitOnIdle(boolean paramBoolean)
  {
    exitOnIdle = paramBoolean;
  }
  
  synchronized boolean isExitOnIdle()
  {
    return exitOnIdle;
  }
  
  static synchronized boolean isPlatformDestroyed()
  {
    return platformDestroyed;
  }
  
  private static synchronized void platformExit()
  {
    platformDestroyed = true;
    PlatformImpl.tkExit();
  }
  
  private void installFinishListener()
  {
    finishListener = new PlatformImpl.FinishListener()
    {
      private void destroyIfNeeded()
      {
        if (window == null) {
          try
          {
            if (applet2 != null) {
              applet2.stop();
            }
            if (preLoader != null) {
              preLoader.stop();
            }
            if (applet2 != null) {
              applet2.destroy();
            }
            applet2 = null;
          }
          catch (Exception localException)
          {
            localException.printStackTrace();
          }
          finally
          {
            PlatformImpl.removeListener(finishListener);
            FXApplet2Adapter.access$200();
          }
        }
      }
      
      public void idle(boolean paramAnonymousBoolean)
      {
        if ((paramAnonymousBoolean) && (isExitOnIdle())) {
          destroyIfNeeded();
        }
      }
      
      public void exitCalled()
      {
        destroyIfNeeded();
      }
    };
    PlatformImpl.addListener(finishListener);
  }
  
  public static FXApplet2Adapter getFXApplet2Adapter(Applet2Context paramApplet2Context)
  {
    DeployPerfLogger.timestamp("Created FXApplet2Adapter");
    return new FXApplet2Adapter(paramApplet2Context);
  }
  
  static synchronized Applet2Adapter get()
  {
    return adapter;
  }
  
  public void setParentContainer(Window paramWindow)
  {
    if ((paramWindow instanceof FXWindow)) {
      window = ((FXWindow)paramWindow);
    }
  }
  
  public void instantiateApplet(Class paramClass)
    throws InstantiationException, IllegalAccessException
  {
    DeployPerfLogger.timestamp("Before create applet");
    applet2 = new FXApplet2(paramClass, window);
    DeployPerfLogger.timestamp("After create applet");
  }
  
  public void instantiateSerialApplet(ClassLoader paramClassLoader, String paramString)
  {
    throw new RuntimeException("Serial applets are not supported with FX toolkit");
  }
  
  public Object getLiveConnectObject()
  {
    return applet2 == null ? null : applet2.getApplication();
  }
  
  public Applet2 getApplet2()
  {
    return applet2;
  }
  
  public Preloader instantiatePreloader(Class paramClass)
  {
    DeployPerfLogger.timestamp("Before create preloader");
    try
    {
      if (paramClass != null) {
        preLoader = new FXPreloader(paramClass, getApplet2Context(), window);
      } else {
        preLoader = new FXPreloader(getApplet2Context(), window);
      }
      preLoader.start();
    }
    catch (Exception localException)
    {
      preLoader = null;
      throw new RuntimeException(localException);
    }
    DeployPerfLogger.timestamp("After create preloader");
    return preLoader;
  }
  
  public Preloader getPreloader()
  {
    return preLoader;
  }
  
  public void init()
  {
    if (applet2 != null) {
      applet2.init(getApplet2Context());
    }
  }
  
  public void start()
  {
    if (applet2 != null) {
      applet2.start();
    }
    setExitOnIdle(true);
  }
  
  public void stop()
  {
    if (applet2 != null) {
      applet2.stop();
    }
  }
  
  public void destroy()
  {
    if (applet2 != null) {
      applet2.destroy();
    }
  }
  
  public void abort() {}
  
  public void resize(int paramInt1, int paramInt2) {}
  
  public void doShowApplet() {}
  
  public void doShowPreloader() {}
  
  public void doShowError(String paramString, final Throwable paramThrowable, final boolean paramBoolean)
  {
    FXPreloader.hideSplash();
    Platform.runLater(new Runnable()
    {
      public void run()
      {
        Stage localStage = window != null ? window.getErrorStage() : new Stage();
        ErrorPane localErrorPane = new ErrorPane(getApplet2Context(), paramThrowable, paramBoolean);
        localStage.setScene(new Scene(localErrorPane));
        localStage.show();
        localStage.toFront();
      }
    });
  }
  
  public void doClearAppletArea() {}
  
  public boolean isInstantiated()
  {
    return applet2 != null;
  }
}

/* Location:
 * Qualified Name:     com.sun.deploy.uitoolkit.impl.fx.FXApplet2Adapter
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.uitoolkit.impl.fx;

import com.sun.deploy.trace.Trace;
import java.lang.reflect.Field;
import java.security.PrivilegedAction;

class FXPluginToolkit$1
  implements PrivilegedAction
{
  FXPluginToolkit$1(FXPluginToolkit paramFXPluginToolkit) {}
  
  public Object run()
  {
    try
    {
      ClassLoader localClassLoader = Thread.currentThread().getContextClassLoader();
      Class localClass = Class.forName("com.sun.deploy.uitoolkit.ToolkitStore", false, localClassLoader);
      Field localField = localClass.getDeclaredField("isPlugin");
      localField.setAccessible(true);
      return Boolean.valueOf(localField.getBoolean(localClass));
    }
    catch (Throwable localThrowable)
    {
      Trace.ignored(localThrowable, true);
    }
    return Boolean.FALSE;
  }
}

/* Location:
 * Qualified Name:     com.sun.deploy.uitoolkit.impl.fx.FXPluginToolkit.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.uitoolkit.impl.fx;

class FXPluginToolkit$2
  implements Runnable
{
  FXPluginToolkit$2(FXPluginToolkit paramFXPluginToolkit) {}
  
  public void run() {}
}

/* Location:
 * Qualified Name:     com.sun.deploy.uitoolkit.impl.fx.FXPluginToolkit.2
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.uitoolkit.impl.fx;

import com.sun.deploy.uitoolkit.DragContext;
import com.sun.deploy.uitoolkit.DragHelper;
import com.sun.deploy.uitoolkit.DragListener;
import com.sun.deploy.uitoolkit.Window;

final class FXPluginToolkit$3
  implements DragHelper
{
  public void register(DragContext paramDragContext, DragListener paramDragListener) {}
  
  public void makeDisconnected(DragContext paramDragContext, Window paramWindow) {}
  
  public void restore(DragContext paramDragContext) {}
  
  public void unregister(DragContext paramDragContext) {}
}

/* Location:
 * Qualified Name:     com.sun.deploy.uitoolkit.impl.fx.FXPluginToolkit.3
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.uitoolkit.impl.fx;

class FXPluginToolkit$4
  implements Runnable
{
  FXPluginToolkit$4(FXPluginToolkit paramFXPluginToolkit, ClassLoader paramClassLoader) {}
  
  public void run()
  {
    Thread.currentThread().setContextClassLoader(val$cl);
  }
}

/* Location:
 * Qualified Name:     com.sun.deploy.uitoolkit.impl.fx.FXPluginToolkit.4
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.uitoolkit.impl.fx;

import java.io.PrintStream;
import java.util.concurrent.Callable;

class FXPluginToolkit$Caller<T>
  implements Runnable
{
  private T returnValue = null;
  Exception exception = null;
  private Callable<T> returnable;
  private Boolean returned = Boolean.FALSE;
  private final Object lock = new Object();
  
  FXPluginToolkit$Caller(Callable<T> paramCallable)
  {
    returnable = paramCallable;
  }
  
  public void run()
  {
    try
    {
      returnValue = returnable.call();
    }
    catch (Throwable ???)
    {
      if ((??? instanceof Exception)) {
        exception = ((Exception)???);
      } else {
        exception = new RuntimeException("Problem in callAndWait()", (Throwable)???);
      }
    }
    finally
    {
      synchronized (lock)
      {
        returned = Boolean.valueOf(true);
        lock.notifyAll();
      }
    }
  }
  
  T waitForReturn()
    throws Exception
  {
    synchronized (lock)
    {
      while ((!returned.booleanValue()) && (!FXApplet2Adapter.isPlatformDestroyed())) {
        try
        {
          lock.wait(500L);
        }
        catch (InterruptedException localInterruptedException)
        {
          System.out.println("Interrupted wait" + localInterruptedException.getStackTrace());
        }
      }
    }
    if (exception != null) {
      throw exception;
    }
    return (T)returnValue;
  }
}

/* Location:
 * Qualified Name:     com.sun.deploy.uitoolkit.impl.fx.FXPluginToolkit.Caller
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.uitoolkit.impl.fx;

import com.sun.javafx.tk.Toolkit;

class FXPluginToolkit$FxWaiter$1
  implements Runnable
{
  FXPluginToolkit$FxWaiter$1(FXPluginToolkit.FxWaiter paramFxWaiter, Object paramObject) {}
  
  public void run()
  {
    FXPluginToolkit.FxWaiter.access$000(this$0).exitNestedEventLoop(val$taskKey, null);
  }
}

/* Location:
 * Qualified Name:     com.sun.deploy.uitoolkit.impl.fx.FXPluginToolkit.FxWaiter.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.uitoolkit.impl.fx;

import com.sun.deploy.util.Waiter;
import com.sun.deploy.util.Waiter.WaiterTask;
import com.sun.javafx.tk.Toolkit;

final class FXPluginToolkit$FxWaiter
  extends Waiter
{
  private final Toolkit tk = Toolkit.getToolkit();
  
  FXPluginToolkit$FxWaiter()
  {
    Class localClass = FXPluginToolkit.TaskThread.class;
  }
  
  public Object wait(Waiter.WaiterTask paramWaiterTask)
    throws Exception
  {
    if (!tk.isFxUserThread()) {
      return paramWaiterTask.run();
    }
    final Object localObject = new Object();
    Runnable local1 = new Runnable()
    {
      public void run()
      {
        tk.exitNestedEventLoop(localObject, null);
      }
    };
    FXPluginToolkit.TaskThread localTaskThread = new FXPluginToolkit.TaskThread(paramWaiterTask, local1);
    localTaskThread.start();
    tk.enterNestedEventLoop(localObject);
    return localTaskThread.getResult();
  }
}

/* Location:
 * Qualified Name:     com.sun.deploy.uitoolkit.impl.fx.FXPluginToolkit.FxWaiter
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.uitoolkit.impl.fx;

import com.sun.deploy.util.Waiter.WaiterTask;
import javafx.application.Platform;

class FXPluginToolkit$TaskThread
  extends Thread
{
  final Waiter.WaiterTask task;
  final Runnable cleanup;
  Object rv;
  
  FXPluginToolkit$TaskThread(Waiter.WaiterTask paramWaiterTask, Runnable paramRunnable)
  {
    task = paramWaiterTask;
    cleanup = paramRunnable;
  }
  
  public Object getResult()
    throws Exception
  {
    if ((rv instanceof Exception)) {
      throw ((Exception)rv);
    }
    return rv;
  }
  
  public void run()
  {
    try
    {
      rv = task.run();
    }
    catch (Exception localException)
    {
      rv = localException;
    }
    finally
    {
      Platform.runLater(cleanup);
    }
  }
}

/* Location:
 * Qualified Name:     com.sun.deploy.uitoolkit.impl.fx.FXPluginToolkit.TaskThread
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.uitoolkit.impl.fx;

import com.sun.applet2.Applet2Context;
import com.sun.applet2.preloader.Preloader;
import com.sun.deploy.appcontext.AppContext;
import com.sun.deploy.trace.Trace;
import com.sun.deploy.uitoolkit.Applet2Adapter;
import com.sun.deploy.uitoolkit.DragContext;
import com.sun.deploy.uitoolkit.DragHelper;
import com.sun.deploy.uitoolkit.DragListener;
import com.sun.deploy.uitoolkit.PluginUIToolkit;
import com.sun.deploy.uitoolkit.PluginWindowFactory;
import com.sun.deploy.uitoolkit.UIToolkit;
import com.sun.deploy.uitoolkit.Window;
import com.sun.deploy.uitoolkit.impl.fx.ui.FXAppContext;
import com.sun.deploy.uitoolkit.impl.fx.ui.FXUIFactory;
import com.sun.deploy.uitoolkit.ui.UIFactory;
import com.sun.deploy.util.Waiter;
import com.sun.deploy.util.Waiter.WaiterTask;
import com.sun.javafx.application.PlatformImpl;
import com.sun.javafx.tk.Toolkit;
import com.sun.javafx.tk.desktop.DesktopToolkit;
import java.io.PrintStream;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.concurrent.Callable;
import javafx.application.Platform;
import sun.plugin2.applet.Plugin2Manager;
import sun.plugin2.message.Pipe;

public class FXPluginToolkit
  extends PluginUIToolkit
{
  static PluginWindowFactory windowFactory = null;
  private final Object initializedLock = new Object();
  private boolean initialized = false;
  public static final DragHelper noOpDragHelper = new DragHelper()
  {
    public void register(DragContext paramAnonymousDragContext, DragListener paramAnonymousDragListener) {}
    
    public void makeDisconnected(DragContext paramAnonymousDragContext, Window paramAnonymousWindow) {}
    
    public void restore(DragContext paramAnonymousDragContext) {}
    
    public void unregister(DragContext paramAnonymousDragContext) {}
  };
  static FXUIFactory fxUIFactory = new FXUIFactory();
  
  public PluginWindowFactory getWindowFactory()
  {
    if (windowFactory == null)
    {
      doInitIfNeeded();
      windowFactory = new FXWindowFactory();
    }
    return windowFactory;
  }
  
  public Preloader getDefaultPreloader()
  {
    doInitIfNeeded();
    return FXPreloader.getDefaultPreloader();
  }
  
  public Applet2Adapter getApplet2Adapter(Applet2Context paramApplet2Context)
  {
    doInitIfNeeded();
    DeployPerfLogger.timestamp("FXToolkit.getAppletAdapter()");
    return FXApplet2Adapter.getFXApplet2Adapter(paramApplet2Context);
  }
  
  public void init()
  {
    Waiter.set(new FxWaiter());
  }
  
  private void doInitIfNeeded()
  {
    synchronized (initializedLock)
    {
      if (!initialized)
      {
        Boolean localBoolean = (Boolean)AccessController.doPrivileged(new PrivilegedAction()
        {
          public Object run()
          {
            try
            {
              ClassLoader localClassLoader = Thread.currentThread().getContextClassLoader();
              Class localClass = Class.forName("com.sun.deploy.uitoolkit.ToolkitStore", false, localClassLoader);
              Field localField = localClass.getDeclaredField("isPlugin");
              localField.setAccessible(true);
              return Boolean.valueOf(localField.getBoolean(localClass));
            }
            catch (Throwable localThrowable)
            {
              Trace.ignored(localThrowable, true);
            }
            return Boolean.FALSE;
          }
        });
        boolean bool = localBoolean.booleanValue();
        DeployPerfLogger.timestamp("(start) FXToolkit.init()");
        DesktopToolkit.setPluginMode(bool);
        PlatformImpl.setTaskbarApplication(!bool);
        PlatformImpl.startup(new Runnable()
        {
          public void run() {}
        });
        initialized = true;
        DeployPerfLogger.timestamp("(done) FXToolkit.init()");
      }
    }
  }
  
  public boolean printApplet(Plugin2Manager paramPlugin2Manager, int paramInt1, Pipe paramPipe, long paramLong, boolean paramBoolean, int paramInt2, int paramInt3, int paramInt4, int paramInt5)
  {
    doInitIfNeeded();
    return false;
  }
  
  public DragHelper getDragHelper()
  {
    doInitIfNeeded();
    return noOpDragHelper;
  }
  
  public void dispose()
    throws Exception
  {}
  
  public boolean isHeadless()
  {
    return false;
  }
  
  public void setContextClassLoader(final ClassLoader paramClassLoader)
  {
    if (paramClassLoader == null) {
      return;
    }
    Platform.runLater(new Runnable()
    {
      public void run()
      {
        Thread.currentThread().setContextClassLoader(paramClassLoader);
      }
    });
  }
  
  public void warmup()
  {
    DeployPerfLogger.timestamp("(start) FXToolkit.warmup()");
    doInitIfNeeded();
    DeployPerfLogger.timestamp("(done) FXToolkit.warmup()");
  }
  
  public AppContext getAppContext()
  {
    return FXAppContext.getInstance();
  }
  
  public AppContext createAppContext()
  {
    return FXAppContext.getInstance();
  }
  
  public SecurityManager getSecurityManager()
  {
    SecurityManager localSecurityManager = null;
    try
    {
      Class localClass = Class.forName("sun.plugin2.applet.FXAppletSecurityManager", false, Thread.currentThread().getContextClassLoader());
      Constructor localConstructor = localClass.getDeclaredConstructor(new Class[0]);
      localSecurityManager = (SecurityManager)localConstructor.newInstance(new Object[0]);
    }
    catch (Exception localException)
    {
      Trace.ignoredException(localException);
    }
    return localSecurityManager;
  }
  
  public UIToolkit changeMode(int paramInt)
  {
    return this;
  }
  
  public UIFactory getUIFactory()
  {
    doInitIfNeeded();
    return fxUIFactory;
  }
  
  public static <T> T callAndWait(Callable<T> paramCallable)
    throws Exception
  {
    Caller localCaller = new Caller(paramCallable);
    if (Platform.isFxApplicationThread())
    {
      localCaller.run();
    }
    else
    {
      Platform.runLater(localCaller);
      if (FXApplet2Adapter.isPlatformDestroyed()) {
        return null;
      }
    }
    return (T)localCaller.waitForReturn();
  }
  
  private static class Caller<T>
    implements Runnable
  {
    private T returnValue = null;
    Exception exception = null;
    private Callable<T> returnable;
    private Boolean returned = Boolean.FALSE;
    private final Object lock = new Object();
    
    Caller(Callable<T> paramCallable)
    {
      returnable = paramCallable;
    }
    
    public void run()
    {
      try
      {
        returnValue = returnable.call();
      }
      catch (Throwable ???)
      {
        if ((??? instanceof Exception)) {
          exception = ((Exception)???);
        } else {
          exception = new RuntimeException("Problem in callAndWait()", (Throwable)???);
        }
      }
      finally
      {
        synchronized (lock)
        {
          returned = Boolean.valueOf(true);
          lock.notifyAll();
        }
      }
    }
    
    T waitForReturn()
      throws Exception
    {
      synchronized (lock)
      {
        while ((!returned.booleanValue()) && (!FXApplet2Adapter.isPlatformDestroyed())) {
          try
          {
            lock.wa
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd