/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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 General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* A frame to show the applet tag in.
*/
/**
* Create the tag frame.
*/
txt.setEditable(false);
add("South", p);
p.add(b);
class ActionEventListener implements ActionListener {
dispose();
}
}
b.addActionListener(new ActionEventListener());
pack();
move(x, y);
setVisible(true);
dispose();
}
};
}
}
/**
* Lets us construct one using unix-style one shot behaviors
*/
{
}
return new MenuBar();
}
public boolean isStandalone() {
return true;
}
}
/**
* The applet viewer makes it possible to run a Java applet without using a browser.
* For details on the syntax that <B>appletviewer</B> supports, see
* <a href="../../../docs/tooldocs/appletviewertags.html">AppletViewer Tags</a>.
* (The document named appletviewertags.html in the JDK's docs/tooldocs directory,
* once the JDK docs have been installed.)
*/
/**
* Some constants...
*/
/**
* The panel in which the applet is being displayed.
*/
/**
* The status line.
*/
/**
* output status messages to this stream
*/
/**
* For cloning
*/
}
}
/**
* Create the applet viewer
*/
this.statusMsgStream = statusMsgStream;
addMenuItem(m, "menuitem.restart");
addMenuItem(m, "menuitem.reload");
addMenuItem(m, "menuitem.stop");
addMenuItem(m, "menuitem.save");
addMenuItem(m, "menuitem.start");
addMenuItem(m, "menuitem.clone");
addMenuItem(m, "menuitem.tag");
addMenuItem(m, "menuitem.info");
addMenuItem(m, "menuitem.encoding");
addMenuItem(m, "menuitem.print");
addMenuItem(m, "menuitem.props");
addMenuItem(m, "menuitem.close");
if (factory.isStandalone()) {
addMenuItem(m, "menuitem.quit");
}
setMenuBar(mb);
pack();
move(x, y);
setVisible(true);
appletClose();
}
appletStop();
}
appletStart();
}
};
class AppletEventListener implements AppletListener
{
{
}
{
case AppletPanel.APPLET_RESIZE: {
resize(preferredSize());
validate();
}
break;
}
case AppletPanel.APPLET_LOADING_COMPLETED: {
// Fixed #4754451: Applet can have methods running on main
// thread event queue.
//
// The cause of this bug is that the frame of the applet
// is created in main thread group. Thus, when certain
// dispatched through the wrong event dispatch thread.
//
// To fix this, we rearrange the AppContext with the frame,
// so the proper event queue will be looked up.
//
// Swing also maintains a Frame list for the AppContext,
// so we will have to rearrange it as well.
//
if (a != null)
else
break;
}
}
}
};
// Start the applet
}
// XXX 99/9/10 probably should be "private"
}
/**
* Send the initial set of events to the appletviewer event queue.
* On start-up the current behaviour is to load the applet and call
* Applet.init() and Applet.start().
*/
private void initEventQueue() {
// appletviewer.send.event is an undocumented and unsupported system
// property which is used exclusively for testing purposes.
// Add the standard events onto the event queue.
} else {
// We're testing AppletViewer. Force the specified set of events
// onto the event queue, wait for the events to be processed, and
// exit.
// The list of events that will be executed is provided as a
// ","-separated list. No error-checking will be done on the list.
else
// non-fatal error if we get an unrecognized event
}
while (!panel.emptyEventQueue()) ;
}
}
/**
* Split a string based on the presence of a specified separator. Returns
* an array of arbitrary length. The end of each element in the array is
* indicated by the separator of the end of the string. If there is a
* separator immediately before the end of the string, the final element
* will be empty. None of the strings will contain the separator. Useful
*
* @param sep The separator.
* @param s The string to split.
* @return An array of strings. Each string in the array is determined
* by the location of the provided sep in the original string,
* s. Whitespace not stripped.
*/
int tokenStart = 0;
int tokenEnd = 0;
}
// Add the final element.
return retVal;
}
/*
* Methods for java.applet.AppletContext
*/
/**
* Get an audio clip.
*/
synchronized (audioClips) {
}
return clip;
}
}
/**
* Get an image.
*/
return getCachedImage(url);
}
// System.getSecurityManager().checkConnection(url.getHost(), url.getPort());
}
/**
* Get an image ref.
*/
synchronized (imageRefs) {
}
return ref;
}
}
/**
* Flush the image cache.
*/
static void flushImageCache() {
}
/**
* Get an applet by name.
*/
}
return p.applet;
}
}
}
return null;
}
/**
* Return an enumeration of all the accessible
* applets on this page.
*/
v.addElement(p.applet);
}
}
}
return v.elements();
}
/**
* Ignore.
*/
}
/**
* Ignore.
*/
}
/**
* Show status.
*/
}
// We do nothing.
}
// We do nothing.
return null;
}
// We do nothing.
return null;
}
/**
* System parameters.
*/
static {
}
/**
* Print the HTML tag.
*/
if (v != null) {
}
if (v == null) {
v = "applet.class";
}
if (v == null) {
v = "150";
}
if (v == null) {
v = "100";
}
if (v != null) {
}
// A very slow sorting algorithm
len = 0;
int i = 0;
for (; i < len ; i++) {
break;
}
}
len++;
}
for (int i = 0 ; i < len ; i++) {
}
}
}
/**
* Make sure the atrributes are uptodate.
*/
public void updateAtts() {
}
/**
* Restart the applet.
*/
void appletRestart() {
}
/**
* Reload the applet.
*/
void appletReload() {
/**
* Fixed #4501142: Classlaoder sharing policy doesn't
* take "archive" into account. This will be overridden
* by Java Plug-in. [stanleyh]
*/
/*
* Make sure we don't have two threads running through the event queue
* at the same time.
*/
try {
} catch (InterruptedException e) {
return; // abort the reload
}
}
/**
* Save the applet to a well known file (for now) as a serialized object
*/
void appletSave() {
// XXX: this privileged block should be made smaller
// by initializing a private static variable with "user.dir"
// Applet needs to be stopped for serialization to succeed.
// Since panel.sendEvent only queues the event, there is a
// chance that the event will not be processed before
// serialization begins. However, by sending the event before
// FileDialog is created, enough time is given such that this
// situation is unlikely to ever occur.
// needed for a bug under Solaris...
// Restart applet if Save is cancelled.
return null; // cancelled
}
try {
} catch (IOException ex) {
} finally {
}
return null;
}
});
}
/**
* Clone the viewer and the applet.
*/
void appletClone() {
updateAtts();
}
/**
* Show the applet tag.
*/
void appletTag() {
updateAtts();
}
/**
* Show the applet info.
*/
void appletInfo() {
}
str += "\n\n";
}
} else {
}
}
/**
* Show character encoding type
*/
void appletCharacterEncoding() {
}
/**
* Edit the applet.
*/
void appletEdit() {
}
/**
* Print the applet.
*/
void appletPrint() {
pj.setPrintable(this);
try {
} catch (PrinterException e) {
}
} else {
}
} else {
}
}
if (pageIndex > 0) {
return Printable.NO_SUCH_PAGE;
} else {
return Printable.PAGE_EXISTS;
}
}
/**
* Properties.
*/
public static synchronized void networkProperties() {
props = new AppletProps();
}
props.setVisible(true);
}
/**
* Start the applet.
*/
void appletStart() {
}
/**
* Stop the applet.
*/
void appletStop() {
}
/**
* Shutdown a viewer.
* Stop, Destroy, Dispose and Quit a viewer
*/
}
/**
* Close this viewer.
* Stop, Destroy, Dispose and Quit an AppletView, then
* reclaim resources and exit the program if this is
* the last applet.
*/
void appletClose() {
// The caller thread is event dispatch thread, so
// spawn a new thread to avoid blocking the event queue
// when calling appletShutdown.
//
final AppletPanel p = panel;
{
public void run()
{
appletShutdown(p);
dispose();
if (countApplets() == 0) {
}
}
}).start();
}
/**
* Exit the program.
* Exit from the program (if not stand alone) - do no clean-up
*/
private void appletSystemExit() {
if (factory.isStandalone())
}
/**
* Quit all viewers.
* Shutdown all viewers properly then
* exit from the program (if not stand alone)
*/
protected void appletQuit()
{
// The caller thread is event dispatch thread, so
// spawn a new thread to avoid blocking the event queue
// when calling appletShutdown.
//
{
public void run()
{
appletShutdown(p);
}
}
}).start();
}
/**
* Handle events.
*/
return;
}
appletReload();
return;
}
appletClone();
return;
}
appletStop();
return;
}
appletSave();
return;
}
appletStart();
return;
}
appletTag();
return;
}
appletInfo();
return;
}
return;
}
appletEdit();
return;
}
appletPrint();
return;
}
return;
}
appletClose();
return;
}
appletQuit();
return;
}
//statusMsgStream.println("evt = " + evt);
}
/**
* How many applets are running?
*/
public static int countApplets() {
return appletPanels.size();
}
/**
* The current character.
*/
static int c;
/**
* Scan spaces.
*/
while ((c >= 0) &&
((c == ' ') || (c == '\t') || (c == '\n') || (c == '\r'))) {
}
}
/**
* Scan identifier
*/
while (true) {
if (((c >= 'a') && (c <= 'z')) ||
((c >= 'A') && (c <= 'Z')) ||
((c >= '0') && (c <= '9')) || (c == '_')) {
} else {
}
}
}
/**
* Scan tag
*/
while (c >= 0 && c != '>') {
if (c == '=') {
int quote = -1;
if ((c == '\'') || (c == '\"')) {
quote = c;
}
while ((c > 0) &&
(c != '\n') && (c != '\r') && (c != '>'))
}
if (c == quote) {
}
}
//statusMsgStream.println("PUT " + att + " = '" + val + "'");
}
while (true) {
if ((c == '>') || (c < 0) ||
((c >= 'a') && (c <= 'z')) ||
((c >= 'A') && (c <= 'Z')) ||
((c >= '0') && (c <= '9')) || (c == '_'))
break;
}
//skipSpace(in);
}
return atts;
}
/* values used for placement of AppletViewer's frames */
private static int x = 0;
private static int y = 0;
try {
} catch (IOException x) { }
}
encoding = r.getEncoding();
return new BufferedReader(r);
}
/**
* Scan an html file for <applet> tags
*/
}
}
// <OBJECT> <EMBED> tag flags
boolean isAppletTag = false;
boolean isObjectTag = false;
boolean isEmbedTag = false;
// warning messages
/* The original URL may have been redirected - this
*/
int ydisp = 1;
while(true) {
if (c == -1)
break;
if (c == '<') {
if (c == '/') {
// We can't test for a code tag until </OBJECT>
// because it is a parameter, not an attribute.
if(isObjectTag) {
}
}
// XXX 5/18 In general this code just simply
// shouldn't be part of parsing. It's presence
// causes things to be a little too much of a
// hack.
x += XDELTA;
y += YDELTA;
// make sure we don't go too far!
x = 0;
ydisp++;
}
}
isAppletTag = false;
isObjectTag = false;
isEmbedTag = false;
}
}
else {
} else {
} else {
}
}
}
isAppletTag = true;
}
}
isObjectTag = true;
// The <OBJECT> attribute codebase isn't what
// we want. If its defined, remove it.
}
}
}
isEmbedTag = true;
}
}
}
}
}
}
}
}
}
}
}
/**
* Old main entry point.
*
* @deprecated
*/
// re-route everything to the new main entry point
}
{
try {
else
}
}
}
}