当前位置: 首页>>代码示例>>Java>>正文


Java AppletContext类代码示例

本文整理汇总了Java中java.applet.AppletContext的典型用法代码示例。如果您正苦于以下问题:Java AppletContext类的具体用法?Java AppletContext怎么用?Java AppletContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AppletContext类属于java.applet包,在下文中一共展示了AppletContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: gotoTargetPage

import java.applet.AppletContext; //导入依赖的package包/类
private void gotoTargetPage() {
	String targetPageParam = getParameter(TARGET_PAGE_PARAM);
	if (null != targetPageParam) {
		AppletContext appletContext = getAppletContext();
		URL documentBase = getDocumentBase();
		try {
			URL targetUrl = new URL(documentBase, targetPageParam);
			addDetailMessage("Navigating to: " + targetUrl);
			appletContext.showDocument(targetUrl, "_self");
		} catch (MalformedURLException e) {
			addDetailMessage("URL error: " + e.getMessage());
		}
	} else {
		// Java WebStart
		System.exit(0);
	}
}
 
开发者ID:e-Contract,项目名称:eid-applet,代码行数:18,代码来源:Applet.java

示例2: gotoCancelPage

import java.applet.AppletContext; //导入依赖的package包/类
private boolean gotoCancelPage() {
	String cancelPageParam = getParameter(CANCEL_PAGE_PARAM);
	if (null == cancelPageParam) {
		return false;
	}
	AppletContext appletContext = getAppletContext();
	URL documentBase = getDocumentBase();
	try {
		URL targetUrl = new URL(documentBase, cancelPageParam);
		addDetailMessage("Navigating to: " + targetUrl);
		appletContext.showDocument(targetUrl, "_self");
	} catch (MalformedURLException e) {
		addDetailMessage("URL error: " + e.getMessage());
	}
	return true;
}
 
开发者ID:e-Contract,项目名称:eid-applet,代码行数:17,代码来源:Applet.java

示例3: close

import java.applet.AppletContext; //导入依赖的package包/类
/**
 * Closes the applet. This method can be implemented by invoking
 * <code>getAppletContext().showDocument(...)</code>.
 */
protected void close() {
    AppletContext appletContext;
    try {
        appletContext = getAppletContext();
    } catch (Throwable e) {
        appletContext = null;
    }

    if (appletContext == null) {
        System.exit(0);
    } else {
        try {
            appletContext.showDocument(new URL(getDocumentBase(), getParameter("PageURL")));
        } catch (MalformedURLException ex) {
            ex.printStackTrace();
        }

    }
}
 
开发者ID:umple,项目名称:umple,代码行数:24,代码来源:SVGApplet.java

示例4: openPage

import java.applet.AppletContext; //导入依赖的package包/类
private void openPage()	{
	
	try {
		if(Settings.getInstance().isApplet()) {
			// Running on applet, so open in a new window
			//System.out.println("open in new window");
			AppletContext a = Settings.getInstance().getApplet().
					getAppletContext();
			a.showDocument(new URL(targetURL),  "_blank");
		} else {
			// Running on desktop
			URI uri = new URI(targetURL);
			Desktop.getDesktop().browse(uri);
		}				
	} catch (Exception e) {
		e.printStackTrace();
	}			
}
 
开发者ID:cmark89,项目名称:thalia,代码行数:19,代码来源:LinkableLabel.java

示例5: getParams

import java.applet.AppletContext; //导入依赖的package包/类
private HashMap<String, String> getParams() {
    log.info("Fetching parameters for the XMLEnricher...");
    HashMap<String, String> params = new HashMap<String, String>();
    Configurator conf = Configurator.getInstance();
    AppletContext appletContext = conf.APPLET_CONTEXT;
    if (appletContext != null) {
        Enumeration<Applet> applets = appletContext.getApplets();
        if (applets != null) {
            while (applets.hasMoreElements()) {
                Applet applet = applets.nextElement();
                for (String specKey : paramsToFetch) {
                    String value = null;
                    int it = 0;
                    while ((value = applet.getParameter(specKey + it)) != null) {
                        params.put(specKey+it, value);
                        log.info("Parameter found - value: " + value + " - key: " + specKey+it);
                        it++;
                    }
                }
            }
        }
    }
    log.info("Fetching parameters for the XMLEnricher done!");
    return params;
}
 
开发者ID:ruhr-universitaet-bochum,项目名称:jpdfsigner,代码行数:26,代码来源:PDFXMLEnricher.java

示例6: setStatus

import java.applet.AppletContext; //导入依赖的package包/类
private void setStatus(String s)
{
    if (!isApplet()) 
    {
    	clientGUI.setStatus(s);
    	return;
    }
    try
    {
        AppletContext context = getAppletContext();
        context.showDocument(new URL("javascript:showStatus('"+s+"');"));
    }
    catch (Exception e)
    {
        e.printStackTrace();
    }
}
 
开发者ID:coova,项目名称:jradius,代码行数:18,代码来源:JRadiusWiFiClient.java

示例7: getAppletStub

import java.applet.AppletContext; //导入依赖的package包/类
private static AppletStub getAppletStub(final AppletContext context, final URL codeBase, final URL docBase) {

        return new AppletStub() {
            public boolean isActive() {
                return true;
            }

            public URL getDocumentBase() {
                return docBase;
            }

            public URL getCodeBase() {
                return codeBase;
            }

            public String getParameter(String name) {
                // Applet beans have no params.
                return null;
            }

            public AppletContext getAppletContext() {
                return context;
            }

            public void appletResize(int width, int height) {
                // Do nothing.
            }
        };
    }
 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:30,代码来源:Beans.java

示例8: BeansAppletStub

import java.applet.AppletContext; //导入依赖的package包/类
BeansAppletStub(Applet target,
            AppletContext context, URL codeBase,
                            URL docBase) {
    this.target = target;
    this.context = context;
    this.codeBase = codeBase;
    this.docBase = docBase;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:Beans.java

示例9: initApplet

import java.applet.AppletContext; //导入依赖的package包/类
/**
 * Call this method to initialize an applet from your launcher class
 * <code>MyAppletLauncher.init()</code> method.
 *
 * @param sClass class name in form "MyClass" for default package
 * or "com.abc.MyClass" for class in some package
 *
 * @param appletParent parent applet from a launcher.
 *
 * @throws Throwable wrapper for many exceptions thrown while applet
 * instantiation and calling init() method.
 */
public void initApplet(String sClass, final JApplet appletParent) throws Throwable {
    Class<?> clazz = loadClass(sClass);
    logInfo(LogArea.CONFIG, "initApplet() --> %s.init(); Loader: %s", sClass, clazz.getClassLoader());
    applet = (JApplet)clazz.newInstance();
    applet.setStub(new AppletStub() {
        @Override
        public boolean isActive() {
            return appletParent.isActive();
        }
        @Override
        public URL getDocumentBase() {
            return appletParent.getDocumentBase();
        }
        @Override
        public URL getCodeBase() {
            return appletParent.getCodeBase();
        }
        @Override
        public String getParameter(String name) {
            return appletParent.getParameter(name);
        }
        @Override
        public AppletContext getAppletContext() {
            return appletParent.getAppletContext();
        }
        @Override
        public void appletResize(int width, int height) {
            appletParent.resize(width, height);
        }
    });
    applet.init();
    appletParent.setContentPane(applet.getContentPane());
}
 
开发者ID:Energyxxer,项目名称:Vanilla-Injection,代码行数:46,代码来源:JarClassLoader.java

示例10: gotoAuthorizationErrorPage

import java.applet.AppletContext; //导入依赖的package包/类
private void gotoAuthorizationErrorPage() {
	String authorizationErrorPage = getParameter(AUTHORIZATION_ERROR_PAGE_PARAM);
	if (null == authorizationErrorPage) {
		return;
	}
	AppletContext appletContext = getAppletContext();
	URL documentBase = getDocumentBase();
	try {
		URL targetUrl = new URL(documentBase, authorizationErrorPage);
		addDetailMessage("Navigating to: " + targetUrl);
		appletContext.showDocument(targetUrl, "_self");
	} catch (MalformedURLException e) {
		addDetailMessage("URL error: " + e.getMessage());
	}
}
 
开发者ID:e-Contract,项目名称:eid-applet,代码行数:16,代码来源:Applet.java

示例11: getAppletContext

import java.applet.AppletContext; //导入依赖的package包/类
@Override
public AppletContext getAppletContext() {
	if (false == this.securityConditionTrustedWebApp) {
		throw new SecurityException("web application not trusted");
	}
	return super.getAppletContext();
}
 
开发者ID:e-Contract,项目名称:eid-applet,代码行数:8,代码来源:Applet.java

示例12: initApplet

import java.applet.AppletContext; //导入依赖的package包/类
/**
 * Call this method to initialize an applet from your launcher class
 * <code>MyAppletLauncher.init()</code> method.
 *
 * @param sClass class name in form "MyClass" for default package or "com.abc.MyClass" for class
 *        in some package
 *
 * @param appletParent parent applet from a launcher.
 *
 * @throws Throwable wrapper for many exceptions thrown while applet instantiation and calling
 *         init() method.
 */
public void initApplet(String sClass, final JApplet appletParent) throws Throwable {
  Class<?> clazz = loadClass(sClass);
  logInfo(LogArea.CONFIG, "initApplet() --> %s.init(); Loader: %s", sClass,
      clazz.getClassLoader());
  applet = (JApplet) clazz.newInstance();
  applet.setStub(new AppletStub() {
    @Override
    public boolean isActive() {
      return appletParent.isActive();
    }

    @Override
    public URL getDocumentBase() {
      return appletParent.getDocumentBase();
    }

    @Override
    public URL getCodeBase() {
      return appletParent.getCodeBase();
    }

    @Override
    public String getParameter(String name) {
      return appletParent.getParameter(name);
    }

    @Override
    public AppletContext getAppletContext() {
      return appletParent.getAppletContext();
    }

    @Override
    public void appletResize(int width, int height) {
      appletParent.resize(width, height);
    }
  });
  applet.init();
  appletParent.setContentPane(applet.getContentPane());
}
 
开发者ID:Adrodoc55,项目名称:MPL,代码行数:52,代码来源:JarClassLoader.java

示例13: getAppletContext

import java.applet.AppletContext; //导入依赖的package包/类
@Override
public AppletContext getAppletContext() {
    if (getParent() instanceof AppletContext) {
        return super.getAppletContext();
    }
    return ((NetxPanel)this).getAppInst().getAppletEnvironment();
}
 
开发者ID:GITNE,项目名称:icedtea-web,代码行数:8,代码来源:AppletViewerPanelAccess.java

示例14: showDocument

import java.applet.AppletContext; //导入依赖的package包/类
public static boolean showDocument(AppletContext appcontext,
											  String sUrl)
{
	try {
		appcontext.showDocument(new URL(sUrl),"");
	} catch (Exception e) {
		return true;
	}

	return false;
}
 
开发者ID:kinneerc,项目名称:giv-planner,代码行数:12,代码来源:Test6.java

示例15: LinkBorder

import java.applet.AppletContext; //导入依赖的package包/类
public LinkBorder(Component component, AppletContext context, String text, Color c, int thickness)
{
    super(c, thickness);
    this.text = text;
    targetComponent = component;
    targetComponent.addMouseListener(this);
    targetComponent.addMouseMotionListener(this);
    appletContext = context;

    highlight = false;
    targetBounds = new Rectangle();
}
 
开发者ID:tristaoeast,项目名称:JPC,代码行数:13,代码来源:LinkBorder.java


注:本文中的java.applet.AppletContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。