Skip to content

Remove applet functionality #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions openmap.properties
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,8 @@ openmap.UseInternalFrames=false
openmap.components=informationDelegator projFactory mouseDelegator projectionstack addlayer glc menulist toolBar navpanel zoompanel scalepanel projectionstacktool mouseModePanel deleteButton omdtl overviewMapHandler layersPanel selectMouseMode navMouseMode distanceMouseMode panMouseMode omdrawingtool omlineloader omcircleloader omrectloader ompointloader omsplineloader ompolyloader omscalingrasterloader omdistloader layerHandler projkeys repaintPolicy srl

# ###
# Applet components, also alternative component configuration
# with OMControlPanel on the left side of the applet. To enable this
# list, simply uncomment it.
# Alternative component configuration with OMControlPanel on the left
# side. To enable this list, simply uncomment it.
# ###
#openmap.components=informationDelegator projFactory mouseDelegator projectionstack addlayer glc menulist toolBar mouseModePanel selectMouseMode navMouseMode distanceMouseMode omdtl deleteButton omdrawingtool omlineloader omcircleloader omrectloader ompointloader omsplineloader omdecsplineloader ompolyloader omscalingrasterloader omdistloader controlpanel layerHandler projkeys repaintPolicy srl

Expand Down
12 changes: 0 additions & 12 deletions share/omapplet.html

This file was deleted.

40 changes: 0 additions & 40 deletions share/openmap.jnlp

This file was deleted.

1 change: 0 additions & 1 deletion src/corba/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@
-->

<echo message=" CORBA RPF FrameProvider package..." />
<exec executable="pwd" />
<exec executable="${idl2java.compiler}" failifexecutionfails="false">
<arg line='-td ${corba.src} -fall -pkgPrefix CRpfFrameProvider com.bbn.openmap.layer.rpf.corba ${corba.src}/com/bbn/openmap/layer/rpf/corba/CorbaRpfFrameProvider.idl' />
</exec>
Expand Down
11 changes: 1 addition & 10 deletions src/corba/com/bbn/openmap/util/corba/CORBASupport.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,11 @@
public class CORBASupport {

/**
* Return a static reference to the ORB. Figures out which environment
* (applet or application) the jre is in, and initialize the orb accordingly.
* Return a static reference to the initialized ORB.
*/
public ORB initORB(String[] args) {

Debug.message("corba", "CORBAManager.getORB(): initializing ORB");
if (Environment.isApplet()) {
// initialize the Environment with the properties passed
// in.
if (Debug.debugging("corba")) {
System.out.println("CORBAManager: initializing applet");
}
return ORB.init(Environment.getApplet(), Environment.getProperties());
}

if (Debug.debugging("corba")) {
System.out.println("CORBAManager: initializing application");
Expand Down
3 changes: 1 addition & 2 deletions src/j3d/com/bbn/openmap/plugin/pilot/Pilot.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ public double getHeight() {
protected transient java.awt.Container palette = null;

/**
* Make the palette visible. Will automatically determine if we're
* running in an applet environment and will use a JInternalFrame
* Make the palette visible. Will use a JInternalFrame
* over a JFrame if necessary.
*/
public void showPalette() {
Expand Down
154 changes: 11 additions & 143 deletions src/openmap/com/bbn/openmap/Environment.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

package com.bbn.openmap;

import java.applet.Applet;
import java.awt.Color;
import java.io.File;
import java.util.Calendar;
Expand All @@ -32,7 +31,6 @@
import java.util.StringTokenizer;
import java.util.Vector;

import javax.swing.JApplet;
import javax.swing.JLayeredPane;
import javax.swing.JRootPane;

Expand All @@ -49,9 +47,7 @@
* The environment is comprised of at least three property lists:
* <ul>
* <li>System properties form the basis of the environment. For applications,
* This can be the System.getProperties(), or something else. In the case of
* applets, this is a list of the ten system properties that applets are allowed
* to access plus any applet parameters.
* This can be the System.getProperties(), or something else.
* <p>
* <li>Runtime properties are checked next. These are properties that exist only
* while the process is running. They are calculated during Environment
Expand All @@ -66,10 +62,9 @@
* the property is found. System properties are searched first, then runtime
* properties, and then hardcoded properties.
* <p>
* This search pattern allows system properties and properties specified as
* applet parameters or command line properties (using -DProperty=value Java
* flag) to override more hardcoded properties specified elsewhere, say in a
* user preferences file.
* This search pattern allows system properties or command line properties
* (using -DProperty=value Java flag) to override more hardcoded properties
* specified elsewhere, say in a user preferences file.
*
* @see java.util.Properties <pre>
*
Expand Down Expand Up @@ -114,7 +109,6 @@ public class Environment extends Properties {
protected Properties hardcodedProps;
protected Properties runtimeProps;
protected JLayeredPane desktop = null;
protected static Applet applet;
private static int counter = 0;
private static transient Vector extraPaths = new Vector();
// user preferences file (used for later references)
Expand Down Expand Up @@ -186,30 +180,6 @@ protected final static void initHardCodedProperties(Properties p) {
}// no BuildDate
}

/**
* Initializes the environment of an applet.
*
* @param applet An applet
* @see java.applet.Applet
*/
public static void init(Applet applet) {
if (applet == null) {
init(System.getProperties());
} else {
if (env != null) {
// overwrite properties
Debug.output("Reinitializing Applet Environment!");
setApplet(applet);
env.setAppletProperties(applet, env);
return;
}
new Environment(applet);
}
if (Debug.debugging("env")) {
env.list(System.out);
}
}

/**
* Initializes the environment of an application.
*
Expand All @@ -235,18 +205,6 @@ public static void init() {
init(System.getProperties());
}

/**
* Creates an Environment based on applet properties.
*
* @param applet an Applet
*/
protected Environment(Applet applet) {
env = this;
setApplet(applet);
setAppletProperties(applet, this);
commonInit();
}

/**
* Creates an Environment with the specified system properties.
*
Expand Down Expand Up @@ -297,45 +255,6 @@ protected void commonInit() {
initRuntimeProperties(runtimeProps);
}

/**
* Populates the system properties for an applet. Currently this property
* list contains the ten system properties available to applets and any
* applet parameters specified in Applet.getParameterInfo().
*
* @param applet the applet
* @see java.applet.Applet#getParameterInfo
*/
protected void setAppletProperties(Applet applet, Properties props) {
/*
* These are the ten properties available to applets.
*/
final String[] appletProps = { "java.version", "java.vendor",
"java.vendor.url", "java.class.version", "os.name", "os.arch",
"os.version", "file.separator", "path.separator",
"line.separator" };

int i;

for (i = 0; i < appletProps.length; i++) {
String prop = appletProps[i];
props.put(prop, System.getProperty(prop));
}

String[][] pinfo = applet.getParameterInfo();
if (pinfo == null)
return;
for (i = 0; i < pinfo.length; i++) {
try {
String key = pinfo[i][0];
String value = applet.getParameter(key);
Debug.message("env", "Applet Parameter " + key + " has value "
+ value);
props.put(key, value);
} catch (NullPointerException e) {
}
}
}

/**
* Initializes the runtime properties list. Runtime properties are those
* properties that exist only while the program is running. They are not
Expand All @@ -345,10 +264,6 @@ protected void setAppletProperties(Applet applet, Properties props) {
* @param p The runtime properties list
*/
protected static void initRuntimeProperties(Properties p) {
if (isApplet()) {
p.put("user.name", "appletUser");// for convenience
}

java.net.InetAddress addr = null;
try {
addr = java.net.InetAddress.getLocalHost();
Expand Down Expand Up @@ -382,13 +297,6 @@ protected static void initRuntimeProperties(Properties p) {
// polygon wraparound bug.
String osname = Environment.get("os.name");

if (osname == null) {
isXWindows = false;
doingXWindowsWorkaround = false;
Debug.message("env", "Environment: is applet, Web Start.");
return;
}

if (osname.equalsIgnoreCase("solaris")
|| osname.equalsIgnoreCase("SunOS")) {
isXWindows = true;
Expand Down Expand Up @@ -428,33 +336,6 @@ protected static void initRuntimeProperties(Properties p) {
}
}

/**
* Indicates whether the current process is an applet.
*
* @return <code>true</code> if process is an applet; <code>false</code>
* otherwise.
*/
public static boolean isApplet() {
return (applet != null);
}

protected static void setApplet(Applet applet) {
Environment.applet = applet;
if (applet instanceof JApplet) {
Environment.useInternalFrames(((JApplet) applet).getRootPane());
}
}

/**
* Indicates whether the current process is an application.
*
* @return <code>true</code> if process is an application;
* <code>false</code> otherwise.
*/
public static boolean isApplication() {
return (applet == null);
}

/**
* Searches for the named property in the environment. If the key is not
* found, null is returned. All three property lists, runtime, user, and
Expand Down Expand Up @@ -656,15 +537,6 @@ public static double getDouble(String key, double defaultValue) {
}
}

/**
* Gets the applet associated with this process.
*
* @return the applet, or null if process is an application
*/
public static Applet getApplet() {
return applet;
}

/**
* Adds a key/value pair to the Environment's system properties list.
*
Expand Down Expand Up @@ -746,18 +618,14 @@ public static String generateUniqueString() {
*/
public final static Vector<String> getClasspathDirs() {
Vector v = new Vector();
try {
String classPath = System.getProperty("java.class.path");
StringTokenizer st = new StringTokenizer(classPath, File.pathSeparator);

while (st.hasMoreTokens()) {
String path = st.nextToken();
if ((new File(path)).isDirectory()) {
v.addElement(path);
}
String classPath = System.getProperty("java.class.path");
StringTokenizer st = new StringTokenizer(classPath, File.pathSeparator);

while (st.hasMoreTokens()) {
String path = st.nextToken();
if ((new File(path)).isDirectory()) {
v.addElement(path);
}
} catch (java.security.AccessControlException ace) {
// Running as an applet?!?
}

v.addAll(extraPaths);
Expand Down
3 changes: 1 addition & 2 deletions src/openmap/com/bbn/openmap/Layer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1449,8 +1449,7 @@ protected WindowSupport createWindowSupport() {
}

/**
* Make the palette visible. Will automatically determine if we're running
* in an applet environment and will use a JInternalFrame over a JFrame if
* Make the palette visible. Will use a JInternalFrame over a JFrame if
* necessary.
*/
public void showPalette() {
Expand Down
Loading