ptolemy.gui
Class BasicJApplet

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--java.applet.Applet
                          |
                          +--javax.swing.JApplet
                                |
                                +--ptolemy.gui.BasicJApplet

public class BasicJApplet
extends javax.swing.JApplet

Base class for swing applets. This class provides basic management for background colors, a standardized mechanism for reporting errors and exceptions, and a minimal amount of information about the applet.

Version:
$Id: BasicJApplet.java,v 1.1 1999/07/21 20:00:22 eal Exp $
Author:
Edward A. Lee
See Also:
Serialized Form

Inner classes inherited from class javax.swing.JApplet
javax.swing.JApplet.AccessibleJApplet
 
Fields inherited from class javax.swing.JApplet
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
BasicJApplet()
           
 
Method Summary
protected  java.lang.String[][] _concatStringArrays(java.lang.String[][] first, java.lang.String[][] second)
          Concatenate two parameter info string arrays and return the result.
protected  java.awt.Color _getBackground()
          Get the background color as set by the "background" applet parameter.
 java.lang.String getAppletInfo()
          Return generic applet information.
 java.lang.String[][] getParameterInfo()
          Describe the applet parameters.
 void init()
          Initialize the applet.
 void report(java.lang.Exception ex)
          Report an exception.
 void report(java.lang.String message, java.lang.Exception ex)
          Report an exception with an additional message.
 
Methods inherited from class javax.swing.JApplet
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, remove, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.applet.Applet
destroy, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, 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, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setCursor, setFont, 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, getHeight, getInputContext, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, 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, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, setBackground, setBounds, setBounds, setComponentOrientation, 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
 

Constructor Detail

BasicJApplet

public BasicJApplet()
Method Detail

getAppletInfo

public java.lang.String getAppletInfo()
Return generic applet information.
Overrides:
getAppletInfo in class java.applet.Applet
Returns:
A string giving minimal information about Ptolemy II.

getParameterInfo

public java.lang.String[][] getParameterInfo()
Describe the applet parameters. Derived classes should override this and append their own parameters. The protected method _concatStringArrays() is provided to make this easy to do.
Overrides:
getParameterInfo in class java.applet.Applet
Returns:
An array describing the applet parameters.

init

public void init()
Initialize the applet. This method is called by the browser or applet viewer to inform this applet that it has been loaded into the system. It is always called before the first time that the start() method is called. In this base class, this method reads the background color parameter. If the background color parameter has not been set, then the background color is set to white.
Overrides:
init in class java.applet.Applet

report

public void report(java.lang.Exception ex)
Report an exception. This prints a message to the standard error stream, followed by the stack trace.

report

public void report(java.lang.String message,
                   java.lang.Exception ex)
Report an exception with an additional message. Currently this prints a message to standard error, followed by the stack trace, although soon it will pop up a message window instead.

_concatStringArrays

protected java.lang.String[][] _concatStringArrays(java.lang.String[][] first,
                                                   java.lang.String[][] second)
Concatenate two parameter info string arrays and return the result. This is provided to make it easy for derived classes to override the getParameterInfo() method. The returned array has length equal to the sums of the lengths of the two arguments, and containing the arrays contained by the arguments.
Parameters:
first - The first string array.
second - The second string array.
Returns:
A concatenated string array.

_getBackground

protected java.awt.Color _getBackground()
Get the background color as set by the "background" applet parameter. This is protected so that derived classes can find out what the background color is. Derived classes may wish to know the color so they can match it in some of their components.