diff options
Diffstat (limited to 'netx/net/sourceforge/jnlp/AppletDesc.java')
-rw-r--r-- | netx/net/sourceforge/jnlp/AppletDesc.java | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/netx/net/sourceforge/jnlp/AppletDesc.java b/netx/net/sourceforge/jnlp/AppletDesc.java new file mode 100644 index 0000000..1563b87 --- /dev/null +++ b/netx/net/sourceforge/jnlp/AppletDesc.java @@ -0,0 +1,122 @@ +// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +package net.sourceforge.jnlp; + +import java.io.*; +import java.net.*; +import java.util.*; + +/** + * The applet-desc element. + * + * @author <a href="mailto:[email protected]">Jon A. Maxwell (JAM)</a> - initial author + * @version $Revision: 1.8 $ + */ +public class AppletDesc { + + /** the applet name */ + private String name; + + /** the main class name and package */ + private String mainClass; + + /** the document base */ + private URL documentBase; + + /** the width */ + private int width; + + /** the height */ + private int height; + + /** the parameters */ + private Map parameters; + + + /** + * Create an Applet descriptor. + * + * @param name the applet name + * @param mainClass the main class name and package + * @param documentBase the document base + * @param width the width + * @param height the height + * @param parameters the parameters + */ + public AppletDesc(String name, String mainClass, URL documentBase, int width, int height, Map parameters) { + this.name = name; + this.mainClass = mainClass; + this.documentBase = documentBase; + this.width = width; + this.height = height; + this.parameters = new HashMap(parameters); + } + + /** + * Returns the applet name + */ + public String getName() { + return name; + } + + /** + * Returns the main class name + */ + public String getMainClass() { + return mainClass; + } + + /** + * Returns the document base + */ + public URL getDocumentBase() { + return documentBase; + } + + /** + * Returns the width + */ + public int getWidth() { + return width; + } + + /** + * Returns the height + */ + public int getHeight() { + return height; + } + + /** + * Returns the applet parameters + */ + public Map getParameters() { + return new HashMap(parameters); + } + + /** + * Adds a parameter to the applet. If the parameter already + * exists then it is overwritten with the new value. Adding a + * parameter will have no effect on already-running applets + * launched from this JNLP file. + */ + public void addParameter(String name, String value) { + parameters.put(name, value); + } + +} |