edu.ucla.stat.SOCR.core
Class SOCRApplet

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 edu.ucla.stat.SOCR.core.SOCRApplet
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer
Direct Known Subclasses:
SOCRAnalyses, SOCRDistributions, SOCRExperiments, SOCRGames, SOCRModeler

public abstract class SOCRApplet
extends javax.swing.JApplet

This is abstract JApplect which used for edu.ucla.stat.SOCR. subclass must implements getCurrentItem() to return the current object which the applect is working on. e.g. for Distributions it should be an Distribution instance.

The contentPane is a split Pane, the left pane is called fControlPane, it has a JComboBox, an Panel for buttons, if the getCurrentItem() return a IValueSettable it will add valueSetters automatically. You dont have to construct it from scratch. Instead, you just provide in the method initGUI() a implementedFile a value to let the JComboBox to initilize from the file. Using addButton() to add Button to it. Subclasses also should implement or override the following mehtods initGUI(),itemChanged() for detailed information, see javadoc of these methods

Author:
Jeff Ma
See Also:
Serialized Form

Nested Class Summary
static class SOCRApplet.SOCRTextArea
           
 
Nested classes/interfaces inherited from class javax.swing.JApplet
javax.swing.JApplet.AccessibleJApplet
 
Nested classes/interfaces inherited from class java.applet.Applet
java.applet.Applet.AccessibleApplet
 
Nested classes/interfaces inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 javax.swing.JPanel buttonP
           
 javax.swing.JPanel buttonP2
           
protected  java.net.URL codeBase
           
 java.lang.String controlPanelTitle
           
 javax.swing.JPanel fControlPanel
           
protected  javax.swing.JScrollPane fPresentPanel
           
protected  javax.swing.JSplitPane fSOCRPane
          Controlpane has two component, north and valueSetterPane
 java.lang.String implementedFile
           
 javax.swing.JPanel jTextAreaPane
           
 javax.swing.JPanel radioButtonP
           
static java.awt.Color textColor
           
static java.awt.Font textFont
           
 javax.swing.JPanel valueSetterPane
           
 
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
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SOCRApplet()
           
 
Method Summary
 void addButton(javax.swing.JButton b)
           
 void addButton(java.lang.String text, java.awt.event.ActionListener l)
           
 void addButton(java.lang.String text, java.lang.String toolTipText, java.awt.event.ActionListener l)
           
 void addButton2(java.lang.String text, java.lang.String toolTipText, java.awt.event.ActionListener l)
           
 void addJCheckBox(javax.swing.JCheckBox b)
           
 void addJLabel(java.lang.String b)
           
 void addJPanel(javax.swing.JPanel jp)
           
 void addJScrollPane(javax.swing.JScrollPane jp)
           
 void addJTextField(javax.swing.JTextField b)
           
 void addJTextField(javax.swing.JTextField b, javax.swing.JLabel l)
           
 void addRadioButton(java.lang.String text, java.lang.String toolTipText, java.lang.String[] bValues, int defaultIndex, java.awt.event.ActionListener l)
           
 void clearvalueSetterPane()
           
static java.lang.String format(double x)
           
 java.lang.String getAppletInfo()
           
abstract  java.lang.Object getCurrentItem()
           
 SOCRJComboBox getImplementedCombo()
           
 void getParameterFromHtml()
           
 java.net.URL getSOCRAppletCodeBase()
           
 void init()
           
protected  void initGUI()
          initialize gui, however it don't have to create Controlpane from scratch, it should itialize the implementedFile add invoke addButton() to add buttons, if it is necessary
protected  void itemChanged(java.lang.String className)
          subclass should implement this method to do whatever needed coressponding the itemchanged event of JComboBox.
 void packControlPaneExternalCall()
           
 void popInfo(java.lang.String noConnectionInfo, java.net.URL isConnectedUrl, java.lang.String target)
           
 void removeComponent(int pos)
           
 void resetRadioButton(int defaultIndex)
           
 void setSelectedApplication(java.lang.String appName)
           
 void setSOCRAppletCodeBase(java.net.URL _codeBase)
           
 void start()
           
 
Methods inherited from class javax.swing.JApplet
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.applet.Applet
destroy, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, 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, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, 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, 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, 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

textColor

public static final java.awt.Color textColor

textFont

public static final java.awt.Font textFont

codeBase

protected java.net.URL codeBase

fSOCRPane

protected javax.swing.JSplitPane fSOCRPane
Controlpane has two component, north and valueSetterPane


fControlPanel

public javax.swing.JPanel fControlPanel

fPresentPanel

protected javax.swing.JScrollPane fPresentPanel

controlPanelTitle

public java.lang.String controlPanelTitle

implementedFile

public java.lang.String implementedFile

buttonP

public javax.swing.JPanel buttonP

buttonP2

public javax.swing.JPanel buttonP2

radioButtonP

public javax.swing.JPanel radioButtonP

jTextAreaPane

public javax.swing.JPanel jTextAreaPane

valueSetterPane

public javax.swing.JPanel valueSetterPane
Constructor Detail

SOCRApplet

public SOCRApplet()
Method Detail

init

public void init()
Overrides:
init in class java.applet.Applet

setSOCRAppletCodeBase

public void setSOCRAppletCodeBase(java.net.URL _codeBase)

getSOCRAppletCodeBase

public java.net.URL getSOCRAppletCodeBase()

start

public void start()
Overrides:
start in class java.applet.Applet

initGUI

protected void initGUI()
initialize gui, however it don't have to create Controlpane from scratch, it should itialize the implementedFile add invoke addButton() to add buttons, if it is necessary


itemChanged

protected void itemChanged(java.lang.String className)
subclass should implement this method to do whatever needed coressponding the itemchanged event of JComboBox. It should update the object which the applet is working on

Parameters:
className - className what need be instantiated

getCurrentItem

public abstract java.lang.Object getCurrentItem()
Returns:
the object which the applet is working on. for SocrDistributin it should return current instance of Distribution.

packControlPaneExternalCall

public void packControlPaneExternalCall()

getParameterFromHtml

public void getParameterFromHtml()

setSelectedApplication

public void setSelectedApplication(java.lang.String appName)

getImplementedCombo

public SOCRJComboBox getImplementedCombo()

addButton2

public void addButton2(java.lang.String text,
                       java.lang.String toolTipText,
                       java.awt.event.ActionListener l)

addButton

public void addButton(java.lang.String text,
                      java.awt.event.ActionListener l)

addRadioButton

public void addRadioButton(java.lang.String text,
                           java.lang.String toolTipText,
                           java.lang.String[] bValues,
                           int defaultIndex,
                           java.awt.event.ActionListener l)

resetRadioButton

public void resetRadioButton(int defaultIndex)

addButton

public void addButton(java.lang.String text,
                      java.lang.String toolTipText,
                      java.awt.event.ActionListener l)

removeComponent

public void removeComponent(int pos)

addJScrollPane

public void addJScrollPane(javax.swing.JScrollPane jp)

addButton

public void addButton(javax.swing.JButton b)

addJCheckBox

public void addJCheckBox(javax.swing.JCheckBox b)

addJTextField

public void addJTextField(javax.swing.JTextField b)

addJTextField

public void addJTextField(javax.swing.JTextField b,
                          javax.swing.JLabel l)

addJLabel

public void addJLabel(java.lang.String b)

addJPanel

public void addJPanel(javax.swing.JPanel jp)

clearvalueSetterPane

public void clearvalueSetterPane()

getAppletInfo

public java.lang.String getAppletInfo()
Overrides:
getAppletInfo in class java.applet.Applet

format

public static java.lang.String format(double x)

popInfo

public void popInfo(java.lang.String noConnectionInfo,
                    java.net.URL isConnectedUrl,
                    java.lang.String target)