edu.ucla.stat.SOCR.applications.demo
Class PortfolioApplication2

java.lang.Object
  extended by edu.ucla.stat.SOCR.core.SOCRValueSettable
      extended by edu.ucla.stat.SOCR.core.MultiplePartsPanel
          extended by edu.ucla.stat.SOCR.applications.Application
              extended by edu.ucla.stat.SOCR.applications.demo.PortfolioApplication2
All Implemented Interfaces:
IExperiment, IValueSettable, Pluginable, java.awt.event.ActionListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener, java.util.Observer

public class PortfolioApplication2
extends Application
implements java.util.Observer, IExperiment, java.awt.event.ActionListener

The triangle experiment is to break a stick at random and see if the pieces form a triangle. If so, is the triangle acute or obtuse?


Nested Class Summary
 
Nested classes/interfaces inherited from class edu.ucla.stat.SOCR.core.MultiplePartsPanel
MultiplePartsPanel.SOCRToolBar
 
Field Summary
protected  java.lang.String ALL
           
 double[] c
           
protected  int CHART_SIZE_X
           
protected  int CHART_SIZE_Y
           
protected  ChartPanel chartPanel
           
protected  double[][] CORR
           
static java.lang.String CORR_Switch
           
protected  double[][] COVR
           
static java.lang.String COVR_Switch
           
protected  double[][] ExpectedReturn
           
protected  java.lang.String GRAPH
           
protected  javax.swing.JPanel graphPanel
           
protected  javax.swing.JPanel graphPanel2
           
protected  java.lang.String INPUT
           
protected  javax.swing.JPanel inputPanel
           
protected  javax.swing.JPanel leftControl
           
 double[] m
           
protected  javax.swing.JPanel mixPanel
           
protected  double mouse_x
           
protected  double mouse_y
           
 double[] r
           
protected  boolean SHOW_STATUS_TEXTAREA
           
protected  boolean show_tangent
           
protected  int SLIDER_SIZE_X
           
protected  javax.swing.JPanel sliderPanel
           
protected  javax.swing.JPanel sliderPanel2
           
static java.lang.String STOCK2
           
static java.lang.String STOCK3
           
static java.lang.String STOCK4
           
static java.lang.String STOCK5
           
protected  double t1_x
           
protected  double t1_y
           
protected  double t2_x
           
protected  double t2_y
           
protected  int tabbedPaneCount
           
 javax.swing.JTabbedPane tabbedPanelContainer
           
 
Fields inherited from class edu.ucla.stat.SOCR.applications.Application
clipboard, numStocks
 
Fields inherited from class edu.ucla.stat.SOCR.core.MultiplePartsPanel
applet, fName, graphs, mainPane, recordTable, tables, toolbar, toolbar2, toolbars
 
Constructor Summary
PortfolioApplication2()
          This method initializes the experiment, including the toolbar, triangle, scatterplot, random variable graph and table
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent evt)
           
 void addRadioButton(int x, int y, java.lang.String text, java.lang.String toolTipText, java.lang.String[] bValues, int defaultIndex, javax.swing.JPanel panel, java.awt.event.ActionListener l)
           
 void addRadioButton2Left(java.lang.String text, java.lang.String toolTipText, java.lang.String[] bValues, int defaultIndex, java.awt.event.ActionListener l)
           
 void addTabbedPane(java.lang.String title, javax.swing.Icon icon, javax.swing.JComponent component, java.lang.String tip)
          This method add a new component to the tabbed panel.
 void addTabbedPane(java.lang.String name, javax.swing.JComponent c)
          This method add a new component to the tabbed panel.
 void chartMouseClicked(ChartMouseEvent arg0)
           
 void chartMouseMoved(ChartMouseEvent arg0)
           
protected  JFreeChart createEmptyChart(PieDataset dataset)
           
protected  JFreeChart createEmptyChart(java.lang.String chartTitle, PieDataset dataset)
           
protected  void fillMatrix(double[][] m)
           
 java.lang.String getAppletInfo()
           
 java.awt.Container getDisplayPane()
           
 java.lang.String getOnlineDescription()
           
 void init()
           
protected  void initGraphPanel()
           
protected  void initInputPanel()
           
protected  void initMixPanel()
           
 void loadSlider(double[] r1, double[] c1, double[] m1)
           
 void mouseClicked(java.awt.event.MouseEvent event)
           
 void removeTabbedPane(int index)
          This method removes a component from the tabbed panel.
protected  void setInputPanel()
           
protected  void setMixPanel()
           
 void setNumberStocks(java.lang.String number)
           
 void setTabbedPaneComponent(int index, javax.swing.JComponent c)
          This method sets a component in the tabbed panel to a specified new component.
 void setTangent(boolean t)
           
 void update()
          This method is the default update method and defines how the display is updated.
 void update(java.util.Observable arg0, java.lang.Object arg1)
          This method is the default update method and defines how the display is updated.
 
Methods inherited from class edu.ucla.stat.SOCR.applications.Application
addTool2, doExperiment, emptyTool, emptyTool2, getInstance, getLocalAbout, getLocalHelp, getResultTable, getStopFreq, getTime, getWikiAbout, getWikiHelp, graphUpdate, initialize, pasteData, reset, setApplet, setShowModelDistribution, setStopFreq, setStopNow, step, stop, updateGraph
 
Methods inherited from class edu.ucla.stat.SOCR.core.MultiplePartsPanel
addGraph, addTable, addTool, addTool2, addToolbar, format, getMainPanel, getName, getRecordTable, getTextPanel, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, play, removeToolbar, setName
 
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
 
Methods inherited from interface edu.ucla.stat.SOCR.core.IExperiment
doExperiment, getResultTable, getStopFreq, getTime, graphUpdate, initialize, pasteData, reset, setShowModelDistribution, setStopFreq, setStopNow, step, stop
 
Methods inherited from interface edu.ucla.stat.SOCR.core.Pluginable
getName, setApplet
 

Field Detail

CHART_SIZE_X

protected final int CHART_SIZE_X
See Also:
Constant Field Values

SLIDER_SIZE_X

protected final int SLIDER_SIZE_X
See Also:
Constant Field Values

CHART_SIZE_Y

protected final int CHART_SIZE_Y
See Also:
Constant Field Values

chartPanel

protected ChartPanel chartPanel

GRAPH

protected final java.lang.String GRAPH
See Also:
Constant Field Values

INPUT

protected final java.lang.String INPUT
See Also:
Constant Field Values

ALL

protected final java.lang.String ALL
See Also:
Constant Field Values

SHOW_STATUS_TEXTAREA

protected boolean SHOW_STATUS_TEXTAREA

graphPanel

protected javax.swing.JPanel graphPanel

graphPanel2

protected javax.swing.JPanel graphPanel2

mixPanel

protected javax.swing.JPanel mixPanel

inputPanel

protected javax.swing.JPanel inputPanel

sliderPanel

protected javax.swing.JPanel sliderPanel

sliderPanel2

protected javax.swing.JPanel sliderPanel2

leftControl

protected javax.swing.JPanel leftControl

show_tangent

protected boolean show_tangent

mouse_x

protected double mouse_x

mouse_y

protected double mouse_y

ExpectedReturn

protected double[][] ExpectedReturn

COVR

protected double[][] COVR

CORR

protected double[][] CORR

t1_x

protected double t1_x

t2_x

protected double t2_x

t1_y

protected double t1_y

t2_y

protected double t2_y

COVR_Switch

public static java.lang.String COVR_Switch

CORR_Switch

public static java.lang.String CORR_Switch

tabbedPaneCount

protected int tabbedPaneCount

tabbedPanelContainer

public javax.swing.JTabbedPane tabbedPanelContainer

STOCK2

public static java.lang.String STOCK2

STOCK3

public static java.lang.String STOCK3

STOCK4

public static java.lang.String STOCK4

STOCK5

public static java.lang.String STOCK5

r

public double[] r

c

public double[] c

m

public double[] m
Constructor Detail

PortfolioApplication2

public PortfolioApplication2()
This method initializes the experiment, including the toolbar, triangle, scatterplot, random variable graph and table

Method Detail

setNumberStocks

public void setNumberStocks(java.lang.String number)
Overrides:
setNumberStocks in class Application

addTabbedPane

public void addTabbedPane(java.lang.String name,
                          javax.swing.JComponent c)
This method add a new component to the tabbed panel.


addTabbedPane

public void addTabbedPane(java.lang.String title,
                          javax.swing.Icon icon,
                          javax.swing.JComponent component,
                          java.lang.String tip)
This method add a new component to the tabbed panel.


removeTabbedPane

public void removeTabbedPane(int index)
This method removes a component from the tabbed panel.


setTabbedPaneComponent

public void setTabbedPaneComponent(int index,
                                   javax.swing.JComponent c)
This method sets a component in the tabbed panel to a specified new component.


createEmptyChart

protected JFreeChart createEmptyChart(java.lang.String chartTitle,
                                      PieDataset dataset)

initGraphPanel

protected void initGraphPanel()

initMixPanel

protected void initMixPanel()

initInputPanel

protected void initInputPanel()

init

public void init()
Overrides:
init in class Application

setInputPanel

protected void setInputPanel()

addRadioButton2Left

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

setMixPanel

protected void setMixPanel()

addRadioButton

public void addRadioButton(int x,
                           int y,
                           java.lang.String text,
                           java.lang.String toolTipText,
                           java.lang.String[] bValues,
                           int defaultIndex,
                           javax.swing.JPanel panel,
                           java.awt.event.ActionListener l)

createEmptyChart

protected JFreeChart createEmptyChart(PieDataset dataset)

loadSlider

public void loadSlider(double[] r1,
                       double[] c1,
                       double[] m1)
Overrides:
loadSlider in class Application

update

public void update(java.util.Observable arg0,
                   java.lang.Object arg1)
This method is the default update method and defines how the display is updated. get called when slider value changes

Specified by:
update in interface java.util.Observer
Overrides:
update in class MultiplePartsPanel

fillMatrix

protected void fillMatrix(double[][] m)

mouseClicked

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

getOnlineDescription

public java.lang.String getOnlineDescription()
Specified by:
getOnlineDescription in interface IExperiment
Overrides:
getOnlineDescription in class Application

getAppletInfo

public java.lang.String getAppletInfo()
Specified by:
getAppletInfo in interface IExperiment
Overrides:
getAppletInfo in class Application

getDisplayPane

public java.awt.Container getDisplayPane()
Specified by:
getDisplayPane in interface Pluginable
Overrides:
getDisplayPane in class Application

update

public void update()
Description copied from interface: IExperiment
This method is the default update method and defines how the display is updated. This method should be overridden.

Specified by:
update in interface IExperiment
Overrides:
update in class Application

setTangent

public void setTangent(boolean t)
Overrides:
setTangent in class Application

chartMouseClicked

public void chartMouseClicked(ChartMouseEvent arg0)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

chartMouseMoved

public void chartMouseMoved(ChartMouseEvent arg0)