org.activemath.applets
Class ProxiedAppletLoader

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by java.applet.Applet
                  extended by org.activemath.applets.AppletLoader
                      extended by org.activemath.applets.ProxiedAppletLoader
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class ProxiedAppletLoader
extends AppletLoader

An extension of AppletLoader where the applet is actually constructed after a request to the server for an HTML page whose first <applet> element is parsed and used to define the applet class and parameters.

The interest of such an applet-loader relies in the ability to start a resource on the server to support the applet only when the applet is actually opened. Such objects, in ActiveMath, are called Proxy as defined by interface org.activemath.proxy.Proxy.

Parameters are:

This applet-loader will, on button press, load the document indicated by the proxyRequestURL parameter. It will then parse it and define the frame-name (the title attribute), the frame size (the width, and height attributes), and the class-name of the applet (the code attribute).
It is to be noted that the document being downloaded is supposed to be well-formed XML as an XML parser (namely the MinML parser) is used to read this content and that attribute names are supposed to be lower-case; XML Namespaces are ignored by this parser though. Finally, please note that the classpath defined by the archive and codebase attributes of the applet tag are ignored in the proxy document so that only the classpath specified in the applet-loader's applet tag define the classpath.

Here is an example of the applet-loader tag:

 <APPLET archive="ConsoleApplet.jar,AppletLoader.jar" code="org.activemath.applets.ProxiedAppletLoader" 
                width="100" height="100">
 <PARAM name="AppletClass"                                         value="HelloWorld">
 <PARAM name="StartingMessage"                     value="Loading...">
 <PARAM name="ReadyToStartMessage"         value="Start my applet">
 <PARAM name="ShowMessage"                                         value="Show">
 <PARAM name="proxyRequestURL"                             value="ProxiedOne.xml">
 Your browser does not support Java, so nothing is displayed.
 </APPLET>
        

Here is an example of the tag delivered by the proxy (or, in the case of the applet-loader provider above, here is what the file ProxiedOne.xml should look like:

        <APPLET code="HelloWorld" width="600" height="200"
        title="My little title">
        </APPLET>
        

todo:

Polish the code.

Version:
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.activemath.applets.AppletLoader
AppletLoader.AppletLoaderAware
 
Nested classes/interfaces inherited from class java.applet.Applet
Applet.AccessibleApplet
 
Nested classes/interfaces inherited from class java.awt.Panel
Panel.AccessibleAWTPanel
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ProxiedAppletLoader()
           
 
Method Summary
 void init()
          Builds the small user-interface of the in-page applet that makes this button and attaches actions.
 
Methods inherited from class org.activemath.applets.AppletLoader
appletShouldBeThrownAway, destroy
 
Methods inherited from class java.applet.Applet
getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, 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, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProxiedAppletLoader

public ProxiedAppletLoader()
Method Detail

init

public void init()
Description copied from class: AppletLoader
Builds the small user-interface of the in-page applet that makes this button and attaches actions.

Overrides:
init in class AppletLoader