com.ibm.security12.sun.applet
Class AppletPanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--com.ibm.security12.sun.applet.AppletPanel

public abstract class AppletPanel
extends Panel
implements java.applet.AppletStub, Runnable

Applet panel class. The panel manages and manipulates the applet as it is being loaded. It forks a separate thread in a new thread group to call the applet's init(), start(), stop(), and destroy() methods.

Version:
1.74, 08/28/98
Author:
Arthur van Hoff
See Also:
Serialized Form

Field Summary
static int APPLET_DESTROY
           
static int APPLET_DISPOSE
           
static int APPLET_ERROR
           
static int APPLET_INIT
           
static int APPLET_LOAD
           
static int APPLET_LOADING
           
static int APPLET_LOADING_COMPLETED
           
static int APPLET_QUIT
           
static int APPLET_RESIZE
           
static int APPLET_START
           
static int APPLET_STOP
           
protected  boolean doInit
          Applet will allow initialization.
protected  int status
          The current status.
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
AppletPanel()
           
 
Method Summary
 void addAppletListener(sun.applet.AppletListener l)
           
 void appletResize(int width, int height)
          Is called when the applet wants to be resized.
protected  void clearLoadAbortRequest()
           
protected  java.applet.Applet createApplet(AppletClassLoader loader)
           
protected  AppletClassLoader createClassLoader(URL codebase)
          This method actually creates an AppletClassLoader.
 void dispatchAppletEvent(int id, Object argument)
          Dispatch event to the listeners..
static void flushClassLoader(URL codebase)
          Flush a class loader.
static void flushClassLoaders()
          Flush all class loaders.
 java.applet.Applet getApplet()
           
 Thread getAppletHandlerThread()
           
 int getAppletHeight()
           
 int getAppletWidth()
           
protected abstract  String getCode()
           
abstract  int getHeight()
           
protected abstract  String getJarFiles()
           
 Dimension getMinimumSize()
           
 Dimension getPreferredSize()
           
protected abstract  String getSerializedObject()
           
abstract  int getWidth()
           
 void init()
          Construct an applet viewer and start the applet.
 boolean isActive()
          Return true when the applet has been started.
protected  void loadJarFiles(AppletClassLoader loader)
           
 Dimension minimumSize()
          Deprecated. As of JDK version 1.1, replaced by getMinimumSize().
protected  boolean okToLoad()
           
 Dimension preferredSize()
          Deprecated. As of JDK version 1.1, replaced by getPreferredSize().
 void removeAppletListener(sun.applet.AppletListener l)
           
 void run()
          Execute applet events.
 void sendEvent(int id)
          Send an event.
 void setBounds(int x, int y, int width, int height)
           
protected  void setLoadAbortRequest()
           
protected  void showAppletException(Throwable t)
          Called by the AppletPanel to provide feedback when an exception has happened.
protected  void showAppletLog(String msg)
          Called by the AppletPanel to print to the log.
protected  void showAppletLog(String msg, Object arg)
           
protected  void showAppletStatus(String status)
          Status line.
protected  void showAppletStatus(String status, Object arg)
           
protected  void showAppletStatus(String status, Object arg1, Object arg2)
           
protected  void stopLoading()
          Request that the loading of the applet be stopped.
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, insets, invalidate, isAncestorOf, layout, list, list, locate, paint, paintComponents, paramString, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

doInit

protected boolean doInit
Applet will allow initialization. Should be set to false if loading a serialized applet that was pickled in the init=true state.

APPLET_DISPOSE

public static final int APPLET_DISPOSE

APPLET_LOAD

public static final int APPLET_LOAD

APPLET_INIT

public static final int APPLET_INIT

APPLET_START

public static final int APPLET_START

APPLET_STOP

public static final int APPLET_STOP

APPLET_DESTROY

public static final int APPLET_DESTROY

APPLET_QUIT

public static final int APPLET_QUIT

APPLET_ERROR

public static final int APPLET_ERROR

APPLET_RESIZE

public static final int APPLET_RESIZE

APPLET_LOADING

public static final int APPLET_LOADING

APPLET_LOADING_COMPLETED

public static final int APPLET_LOADING_COMPLETED

status

protected int status
The current status. One of: APPLET_DISPOSE, APPLET_LOAD, APPLET_INIT, APPLET_START, APPLET_STOP, APPLET_DESTROY, APPLET_ERROR.
Constructor Detail

AppletPanel

public AppletPanel()
Method Detail

getCode

protected abstract String getCode()

getJarFiles

protected abstract String getJarFiles()

getSerializedObject

protected abstract String getSerializedObject()

getWidth

public abstract int getWidth()
Overrides:
getWidth in class Component

getHeight

public abstract int getHeight()
Overrides:
getHeight in class Component

init

public void init()
Construct an applet viewer and start the applet.

getMinimumSize

public Dimension getMinimumSize()
Returns:
an instance of Dimension that represents the minimum size of this container.
Overrides:
getMinimumSize in class Container
Since:
JDK1.1
See Also:
Container.getPreferredSize(), Container.getLayout(), LayoutManager.minimumLayoutSize(java.awt.Container), Component.getMinimumSize()

minimumSize

public Dimension minimumSize()
Deprecated. As of JDK version 1.1, replaced by getMinimumSize().
Overrides:
minimumSize in class Container

getPreferredSize

public Dimension getPreferredSize()
Returns:
an instance of Dimension that represents the preferred size of this container.
Overrides:
getPreferredSize in class Container
Since:
JDK1.0
See Also:
Container.getMinimumSize(), Container.getLayout(), LayoutManager.preferredLayoutSize(java.awt.Container), Component.getPreferredSize()

preferredSize

public Dimension preferredSize()
Deprecated. As of JDK version 1.1, replaced by getPreferredSize().
Overrides:
preferredSize in class Container

addAppletListener

public void addAppletListener(sun.applet.AppletListener l)

removeAppletListener

public void removeAppletListener(sun.applet.AppletListener l)

dispatchAppletEvent

public void dispatchAppletEvent(int id,
                                Object argument)
Dispatch event to the listeners..

sendEvent

public void sendEvent(int id)
Send an event. Queue it for execution by the handler thread.

run

public void run()
Execute applet events.
Specified by:
run in interface Runnable

createApplet

protected java.applet.Applet createApplet(AppletClassLoader loader)
                                   throws ClassNotFoundException,
                                          IllegalAccessException,
                                          IOException,
                                          InstantiationException,
                                          InterruptedException

loadJarFiles

protected void loadJarFiles(AppletClassLoader loader)
                     throws IOException,
                            InterruptedException

stopLoading

protected void stopLoading()
Request that the loading of the applet be stopped.

okToLoad

protected boolean okToLoad()

clearLoadAbortRequest

protected void clearLoadAbortRequest()

setLoadAbortRequest

protected void setLoadAbortRequest()

isActive

public boolean isActive()
Return true when the applet has been started.
Specified by:
isActive in interface java.applet.AppletStub

appletResize

public void appletResize(int width,
                         int height)
Is called when the applet wants to be resized.
Specified by:
appletResize in interface java.applet.AppletStub

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Overrides:
setBounds in class Component

getApplet

public java.applet.Applet getApplet()

showAppletStatus

protected void showAppletStatus(String status)
Status line. Called by the AppletPanel to provide feedback on the Applet's state.

showAppletStatus

protected void showAppletStatus(String status,
                                Object arg)

showAppletStatus

protected void showAppletStatus(String status,
                                Object arg1,
                                Object arg2)

showAppletLog

protected void showAppletLog(String msg)
Called by the AppletPanel to print to the log.

showAppletLog

protected void showAppletLog(String msg,
                             Object arg)

showAppletException

protected void showAppletException(Throwable t)
Called by the AppletPanel to provide feedback when an exception has happened.

flushClassLoader

public static void flushClassLoader(URL codebase)
Flush a class loader.

flushClassLoaders

public static void flushClassLoaders()
Flush all class loaders.

createClassLoader

protected AppletClassLoader createClassLoader(URL codebase)
This method actually creates an AppletClassLoader. It can be override by subclasses (such as the Plug-in) to provide different classloaders.

getAppletHandlerThread

public Thread getAppletHandlerThread()

getAppletWidth

public int getAppletWidth()

getAppletHeight

public int getAppletHeight()