Imp
[using it]
Interface Manipulation Package v4.0 (2008-06-25) a-projector ©copyright Author


imp.gui
Class IApplet

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 javax.swing.JApplet
                      extended by imp.gui.IApplet
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer
Direct Known Subclasses:
AnisotropicDiffusionApplet, ClassifierApplet, EstimatorApplet, FovealSmoothingApplet, LocalMotionApplet, MappingApplet, RgbImageApplet, TrajectoryApplet, WinnerTakeAllApplet

public class IApplet
extends JApplet

Defines an applet which can be opened as a standalone application.

Here, a basic interaction with the user environment is considered, while the applet can either be embedded in an HTML frame or opened as a standalone application.
In this context all Applet methods, inherited from Applet and related the Applet context or AppletStub are depreciated, using them generates exceptions.
Applets should not use CPU resources when the browser does not display the page that contains the applet: if applet code doesn't launch any threads explicitly, then its is OK. Otherwise the start() and stop() method must be used.
An applet cannot load libraries or define native methods, cannot ordinarily read or write files on the host that's executing, cannot make network connections except to the host that it came from, cannot start any program on the host that's executing it, cannot read usual system properties (java.home java.class.path user.name user.home user.dir). All this constraints are take into account here.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Component
Component.BaselineResizeBehavior
 
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
 
Method Summary
 void echo(String message)
          Echos a message in the status bar or in the terminal.
 String get(String name)
          Gets an applet field value.
static IApplet getApplet(String name)
          Gets the named applet of the Java environment (from this document or another).
 JComponent getComponent()
          Defines the component shown in this applet.
static void main(String[] arguments)
          Opens a IApplet as a standalone application with no security restriction.
static void open(String title, int width, int height, IApplet applet, Value parameters)
          Opens an applet as a stand-alone application.
 String resolve(String location)
          Returns an URL resolved against the applet document URL.
 void show(String location, boolean pop)
          Shows a document in the user environment browser.
 
Methods inherited from class javax.swing.JApplet
getAccessibleContext, getContentPane, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, remove, repaint, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setTransferHandler, update
 
Methods inherited from class java.applet.Applet
destroy, 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, 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, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

echo

public void echo(String message)
Echos a message in the status bar or in the terminal.

Parameters:
message - The message to output.

get

public String get(String name)
Gets an applet field value.

Parameters:
name - The field name, predefined name are:
nameDefines the applet name used to label it with respect to other applets
activeTrue if the applet is active else false
standaloneTrue if standalone applet, false if the applet is embedded in a document
hostThe applet host name ("localhost" for a standalone applet)
documentThe document containing this applet (or the applet specification for a standalone applet)
NOTICE: field values starting with "./" are considered as relative locations and automatically resolved with respect to the applet document URL.
Returns:
The applet field value if any, the empty string.

getApplet

public static IApplet getApplet(String name)
Gets the named applet of the Java environment (from this document or another).
Each applet with a parameter of name name is automatically registered and can thus be referenced. This allows interaction between applets in a browser.

Parameters:
name - The applet name.
Returns:
The last registered applet with the given name if any, else null.

getComponent

public JComponent getComponent()
Defines the component shown in this applet. This methods is called once by the init method.
The default behavior is to build the component from the definition given in the component parameter.


main

public static void main(String[] arguments)
Opens a IApplet as a standalone application with no security restriction.
Usage: $JAVA imp.gui.IApplet <applet-definition-file> to start an G.U.I. applet defined in an HTML file.
The applet definition file should contains a
<title>..</title>
element and an
<applet code="(applet class qualified name)" width=".." height=".."> <param name=".." value=".." /> .. </applet>
construct.
Usage: $JAVA imp.gui.IApplet -code <applet-class-name> -title <applet-title> -width <applet-width> -height <applet-height> (-<param-name> -<param-value>) to start an G.U.I. applet using command-line parameters.
Usage: $JAVA imp.gui.IApplet to start the default G.U.I. applet.


open

public static void open(String title,
                        int width,
                        int height,
                        IApplet applet,
                        Value parameters)
Opens an applet as a stand-alone application.

Parameters:
title - [optional, default is ""] Operating system window title.
width - [optional, default is 800] Operating system window width.
height - [optional, default is 600] Operating system window height.
applet - Applet to be shown an started.
parameters - [optional, default is null] Applet parameters.

resolve

public String resolve(String location)
Returns an URL resolved against the applet document URL.

Parameters:
location - A location relative to the applet document location.
Returns:
The corresponding absolute location.

show

public void show(String location,
                 boolean pop)
          throws IOException
Shows a document in the user environment browser.

Parameters:
location - The document URL location.
pop - If true pop-up a new window else uses the existing window
Throws:
IOException - If the action fails, because either
  • a Unix/Linux mozilla client is not yet running or
  • the document URL location can not be open.