edu.ucla.stat.SOCR.core
Class MultiplePartsPanel

java.lang.Object
  extended by edu.ucla.stat.SOCR.core.SOCRValueSettable
      extended by edu.ucla.stat.SOCR.core.MultiplePartsPanel
All Implemented Interfaces:
IValueSettable, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener, java.util.Observer
Direct Known Subclasses:
Application, Experiment, Game

public class MultiplePartsPanel
extends SOCRValueSettable
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener

This class will be used for game and experiment, basically it has three parts. the upmost part is a simulated toolbar, which is populated by addTool(). It also can contain multiple toolbars, you can call addToolBar() to add more. The middle part is for graph, you can add your component there by addGraph(); The lowest part is for TextArea, you can add your component there by addTable()

Author:
Jeff Ma

Nested Class Summary
static class MultiplePartsPanel.SOCRToolBar
           
 
Field Summary
static javax.swing.JApplet applet
           
protected  java.lang.String fName
           
protected  javax.swing.JPanel graphs
           
protected  javax.swing.JPanel mainPane
           
protected  SOCRApplet.SOCRTextArea recordTable
           
protected  javax.swing.JPanel tables
           
protected  MultiplePartsPanel.SOCRToolBar toolbar
           
protected  MultiplePartsPanel.SOCRToolBar toolbar2
           
protected  javax.swing.JPanel toolbars
           
 
Constructor Summary
MultiplePartsPanel()
           
 
Method Summary
 void addGraph(java.awt.Component c)
          This method adds a new component usually a graph to the center panel.
 void addTable(java.awt.Component c)
          This method adds a new component usually a text areas to the bottom panel
 void addTool(java.awt.Component c)
          This method adds a new component (such as a button) to the main toolbar.
 void addTool2(java.awt.Component c)
          This method adds a new component (such as a button) to the second toolbar.
 void addToolbar(java.awt.Component c)
          to add the second tool bar
 java.lang.String format(double d)
           
 javax.swing.JComponent getMainPanel()
           
 java.lang.String getName()
           
 javax.swing.JTextArea getRecordTable()
          This method returns the record table
 javax.swing.JComponent getTextPanel()
           
 void mouseClicked(java.awt.event.MouseEvent event)
           
 void mouseDragged(java.awt.event.MouseEvent event)
           
 void mouseEntered(java.awt.event.MouseEvent event)
           
 void mouseExited(java.awt.event.MouseEvent event)
           
 void mouseMoved(java.awt.event.MouseEvent event)
           
 void mousePressed(java.awt.event.MouseEvent event)
           
 void mouseReleased(java.awt.event.MouseEvent event)
           
static void play(java.lang.String audiofile)
           
 void removeToolbar()
           
 void setApplet(javax.swing.JApplet a)
           
 void setName(java.lang.String name)
           
 void update(java.util.Observable o, java.lang.Object arg)
           
 
Methods inherited from class edu.ucla.stat.SOCR.core.SOCRValueSettable
createComponentSetter, createValueSetter, createValueSetter, createValueSetter, createValueSetter, getComponentSetter, getComponentSetters, getValueSetter, getValueSetters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

applet

public static javax.swing.JApplet applet

mainPane

protected javax.swing.JPanel mainPane

toolbar

protected MultiplePartsPanel.SOCRToolBar toolbar

toolbar2

protected MultiplePartsPanel.SOCRToolBar toolbar2

toolbars

protected javax.swing.JPanel toolbars

graphs

protected javax.swing.JPanel graphs

tables

protected javax.swing.JPanel tables

recordTable

protected SOCRApplet.SOCRTextArea recordTable

fName

protected java.lang.String fName
Constructor Detail

MultiplePartsPanel

public MultiplePartsPanel()
Method Detail

getName

public java.lang.String getName()
Returns:
Returns the fName.

setName

public void setName(java.lang.String name)
Parameters:
name - The fName to set.

getMainPanel

public javax.swing.JComponent getMainPanel()

addToolbar

public void addToolbar(java.awt.Component c)
to add the second tool bar


removeToolbar

public void removeToolbar()

addTable

public void addTable(java.awt.Component c)
This method adds a new component usually a text areas to the bottom panel


addGraph

public void addGraph(java.awt.Component c)
This method adds a new component usually a graph to the center panel.


addTool

public void addTool(java.awt.Component c)
This method adds a new component (such as a button) to the main toolbar.


addTool2

public void addTool2(java.awt.Component c)
This method adds a new component (such as a button) to the second toolbar.


getRecordTable

public javax.swing.JTextArea getRecordTable()
This method returns the record table


setApplet

public void setApplet(javax.swing.JApplet a)

play

public static void play(java.lang.String audiofile)

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent event)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent event)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent event)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent event)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent event)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent event)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent event)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

format

public java.lang.String format(double d)

update

public void update(java.util.Observable o,
                   java.lang.Object arg)
Specified by:
update in interface java.util.Observer

getTextPanel

public javax.swing.JComponent getTextPanel()