aboutsummaryrefslogtreecommitdiffstats
path: root/netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java
diff options
context:
space:
mode:
authorJiri Vanek <[email protected]>2013-12-13 10:47:07 +0100
committerJiri Vanek <[email protected]>2013-12-13 10:47:07 +0100
commit25f307d98cb0ba4698318c6a1a4e738ee81f6e55 (patch)
treee869f4d7ea537ba2d4508f71edbafdccecd0f375 /netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java
parent6256aac59275df0edd0feb4950272aa33573be9f (diff)
itw itself warning cleanup: fixed rawtypes and unchecks, added braces and Override
After this clean up only "internal proprietary API and may be removed in a future release" warnings remain fro make check. Please keep itw in this way :) remaining issues: icedtea-web/netx/net/sourceforge/jnlp/cache/ResourceTracker.java:357: warning: [deprecation] toURL() in File has been deprecated icedtea-web/netx/net/sourceforge/jnlp/cache/CacheUtil.java:128: warning: [deprecation] toURL() in File has been deprecated icedtea-web/netx/net/sourceforge/jnlp/runtime/Boot.java:261: warning: [deprecation] toURL() in File has been deprecated There have been a lot of work around cach x file x url escaping, and as main difference between file.tourl and file.touri.tourl is escapin, I rather left it. icedtea-web/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java:804: warning: [deprecation] Ref in sun.misc has been deprecated icedtea-web/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java:121: warning: [deprecation] Ref in sun.misc has been deprecated What can be done? icedtea-web/netx/net/sourceforge/jnlp/browser/BrowserAwareProxySelector.java:205: warning: [fallthrough] possible fall-through into case icedtea-web/netx/net/sourceforge/jnlp/browser/BrowserAwareProxySelector.java:211: warning: [fallthrough] possible fall-through into case This have to be fixed
Diffstat (limited to 'netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java')
-rw-r--r--netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java42
1 files changed, 33 insertions, 9 deletions
diff --git a/netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java b/netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java
index 17e9d14..d838ac6 100644
--- a/netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java
+++ b/netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java
@@ -89,6 +89,7 @@ public class AppletEnvironment implements AppletContext, AppletStub {
// may not need this once security manager can close windows
// that do not have app code on the stack
WindowListener closer = new WindowAdapter() {
+ @Override
public void windowClosing(WindowEvent event) {
appletInstance.destroy();
JNLPRuntime.exit(0);
@@ -105,8 +106,9 @@ public class AppletEnvironment implements AppletContext, AppletStub {
* @throws IllegalStateException
*/
private void checkDestroyed() {
- if (destroyed)
+ if (destroyed) {
throw new IllegalStateException("Illegal applet stub/context access: applet destroyed.");
+ }
}
/**
@@ -147,18 +149,21 @@ public class AppletEnvironment implements AppletContext, AppletStub {
public void startApplet() {
checkDestroyed();
- if (appletStarted)
+ if (appletStarted) {
return;
+ }
appletStarted = true;
try {
AppletDesc appletDesc = file.getApplet();
- if (cont instanceof AppletStub)
+ if (cont instanceof AppletStub) {
applet.setStub((AppletStub) cont);
- else
+ }
+ else {
applet.setStub(this);
+ }
cont.setLayout(new BorderLayout());
cont.add("Center", applet);
@@ -176,6 +181,7 @@ public class AppletEnvironment implements AppletContext, AppletStub {
try {
SwingUtilities.invokeAndWait(new Runnable() {
+ @Override
public void run() {
// do first because some applets need to be displayed before
// starting (they use Component.getImage or something)
@@ -207,13 +213,15 @@ public class AppletEnvironment implements AppletContext, AppletStub {
* Returns the applet if the applet's name is specified,
* otherwise return null.
*/
+ @Override
public Applet getApplet(String name) {
checkDestroyed();
- if (name != null && name.equals(file.getApplet().getName()))
+ if (name != null && name.equals(file.getApplet().getName())) {
return applet;
- else
+ } else {
return null;
+ }
}
/**
@@ -231,6 +239,7 @@ public class AppletEnvironment implements AppletContext, AppletStub {
* Returns an enumeration that contains only the applet
* from the JNLP file.
*/
+ @Override
public Enumeration<Applet> getApplets() {
checkDestroyed();
@@ -240,6 +249,7 @@ public class AppletEnvironment implements AppletContext, AppletStub {
/**
* Returns an audio clip.
*/
+ @Override
public AudioClip getAudioClip(URL location) {
checkDestroyed();
@@ -254,6 +264,7 @@ public class AppletEnvironment implements AppletContext, AppletStub {
/**
* Return an image loaded from the specified location.
*/
+ @Override
public Image getImage(URL location) {
checkDestroyed();
@@ -266,6 +277,7 @@ public class AppletEnvironment implements AppletContext, AppletStub {
/**
* Not implemented yet.
*/
+ @Override
public void showDocument(java.net.URL uRL) {
checkDestroyed();
@@ -274,6 +286,7 @@ public class AppletEnvironment implements AppletContext, AppletStub {
/**
* Not implemented yet.
*/
+ @Override
public void showDocument(java.net.URL uRL, java.lang.String str) {
checkDestroyed();
@@ -282,6 +295,7 @@ public class AppletEnvironment implements AppletContext, AppletStub {
/**
* Not implemented yet.
*/
+ @Override
public void showStatus(java.lang.String str) {
checkDestroyed();
@@ -290,6 +304,7 @@ public class AppletEnvironment implements AppletContext, AppletStub {
/**
* Required for JRE1.4, but not implemented yet.
*/
+ @Override
public void setStream(String key, InputStream stream) {
checkDestroyed();
@@ -298,6 +313,7 @@ public class AppletEnvironment implements AppletContext, AppletStub {
/**
* Required for JRE1.4, but not implemented yet.
*/
+ @Override
public InputStream getStream(String key) {
checkDestroyed();
@@ -307,6 +323,7 @@ public class AppletEnvironment implements AppletContext, AppletStub {
/**
* Required for JRE1.4, but not implemented yet.
*/
+ @Override
public Iterator<String> getStreamKeys() {
checkDestroyed();
@@ -315,6 +332,7 @@ public class AppletEnvironment implements AppletContext, AppletStub {
// stub methods
+ @Override
public void appletResize(int width, int height) {
checkDestroyed();
@@ -327,18 +345,21 @@ public class AppletEnvironment implements AppletContext, AppletStub {
}
}
+ @Override
public AppletContext getAppletContext() {
checkDestroyed();
return this;
}
+ @Override
public URL getCodeBase() {
checkDestroyed();
return file.getCodeBase();
}
+ @Override
public URL getDocumentBase() {
checkDestroyed();
@@ -347,16 +368,19 @@ public class AppletEnvironment implements AppletContext, AppletStub {
// FIXME: Sun's applet code forces all parameters to lower case.
// Does Netx's JNLP code do the same, so we can remove the first lookup?
+ @Override
public String getParameter(String name) {
checkDestroyed();
- String s = (String) parameters.get(name);
- if (s != null)
+ String s = parameters.get(name);
+ if (s != null) {
return s;
+ }
- return (String) parameters.get(name.toLowerCase());
+ return parameters.get(name.toLowerCase());
}
+ @Override
public boolean isActive() {
checkDestroyed();