wjhk.jupload2
Class JUploadApplet

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 wjhk.jupload2.JUploadApplet
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class JUploadApplet
extends Applet

The applet. It contains quite only the call to creation of the JUploadPanel, which contains the real code.

The behaviour of the applet can easily be adapted, by :

  • Using an existing UploadPolicy, and specifying parameters.
  • Creating a new upload policy, based on the DefaultUploadPolicy, or created from scratch.
  • Version:
    $Revision: 537 $
    Author:
    William JinHua Kwong (updated by etienne_sf)
    See Also:
    Serialized Form

    Nested Class Summary
     
    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
    static String BUILD_DATE
              Date of the build for the applet.
    static String LAST_MODIFIED
              Deprecated. since v3.1
    static String VERSION
              The version of this applet.
     
    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
    JUploadApplet()
               
     
    Method Summary
     void destroy()
               
     void displayDebug(String debug, int minDebugLevel)
              Call to UploadPolicy.displayDebug(String, int)
     void displayErr(String err)
              Call to UploadPolicy.displayErr(Exception)
     void displayInfo(String info)
              Call to UploadPolicy.displayInfo(String)
     void displayWarn(String warn)
              Call to UploadPolicy.displayWarn(String)
     JUploadTextArea getLogWindow()
              Retrieves the current log window of this applet.
    static Properties getSvnProperties()
              Helper function, to get the Revision number, if available.
     JUploadPanel getUploadPanel()
              Retrieves the current upload panel.
     UploadPolicy getUploadPolicy()
              Retrieves the current upload policy.
     void init()
               
    static void main(String[] args)
              Helper function for ant build to retrieve the current version.
     void registerUnload(Object o, String method)
              Register a callback to be executed during applet termination.
     void setProperty(String prop, String value)
              This allow runtime modifications of properties, from javascript.
     String startUpload()
              example public method that can be called by Javascript to start upload
     void stop()
               
     
    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
     
    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
     

    Field Detail

    VERSION

    public static final String VERSION
    The version of this applet. The version itseld is to be updated in the JUploadApplet.java file. The revision is added at build time, by the build.xml ant file, packaged with the applet.


    LAST_MODIFIED

    @Deprecated
    public static final String LAST_MODIFIED
    Deprecated. since v3.1
    The last modification of this applet. Not accurate: would work only if the whole src folder is commited. Replaced by the build date.


    BUILD_DATE

    public static final String BUILD_DATE
    Date of the build for the applet. It's generated at build time by the build.xml packaged by the script. If compiled with eclipse (for instance), the build_date is noted as 'unknown'.

    Constructor Detail

    JUploadApplet

    public JUploadApplet()
    Method Detail

    init

    public void init()
    Overrides:
    init in class Applet
    See Also:
    Applet.init()

    getLogWindow

    public JUploadTextArea getLogWindow()
    Retrieves the current log window of this applet. This log window may visible or not depending on various applet parameter.

    Returns:
    the current log window of this instance.
    See Also:
    JUploadPanel.showOrHideLogWindow()

    getUploadPanel

    public JUploadPanel getUploadPanel()
    Retrieves the current upload panel.

    Returns:
    the current upload panel of this instance.

    getUploadPolicy

    public UploadPolicy getUploadPolicy()
    Retrieves the current upload policy.

    Returns:
    the current upload policy of this instance.

    setProperty

    public void setProperty(String prop,
                            String value)
    This allow runtime modifications of properties, from javascript. Currently, this can only be used after full initialization. This method only calls the UploadPolicy.setProperty method.
    Ex: document.jupload.setProperty(prop, value);

    Parameters:
    prop - The property name that must be set.
    value - The value of this property.

    startUpload

    public String startUpload()
    example public method that can be called by Javascript to start upload

    Returns:
    Returns the upload result. See the constants defined in the JavascriptHandler javadoc.

    displayErr

    public void displayErr(String err)
    Call to UploadPolicy.displayErr(Exception)

    Parameters:
    err - The error text to be displayed.

    displayInfo

    public void displayInfo(String info)
    Call to UploadPolicy.displayInfo(String)

    Parameters:
    info - The info text to display

    displayWarn

    public void displayWarn(String warn)
    Call to UploadPolicy.displayWarn(String)

    Parameters:
    warn - The error text to be displayed.

    displayDebug

    public void displayDebug(String debug,
                             int minDebugLevel)
    Call to UploadPolicy.displayDebug(String, int)

    Parameters:
    debug - The debug message.
    minDebugLevel - The minimum level that debug level should have, to display this message. Values can go from 0 to 100.

    stop

    public void stop()
    Overrides:
    stop in class Applet
    See Also:
    Applet.stop()

    main

    public static void main(String[] args)
    Helper function for ant build to retrieve the current version.

    Parameters:
    args - Standard argument for main method. Not used.

    getSvnProperties

    public static Properties getSvnProperties()
    Helper function, to get the Revision number, if available. The applet must be built from the build.xml ant file.

    Returns:
    The svn properties

    registerUnload

    public void registerUnload(Object o,
                               String method)
    Register a callback to be executed during applet termination.

    Parameters:
    o - The Object instance to be registered
    method - The Method of that object to be registered. The method must be of type void and must not take any parameters and must be public.

    destroy

    public void destroy()
    Overrides:
    destroy in class Applet
    See Also:
    Applet.destroy()