org.opensourcephysics.sip.ch12
Class PercolationApp

java.lang.Object
  extended by org.opensourcephysics.controls.AbstractCalculation
      extended by org.opensourcephysics.sip.ch12.PercolationApp
All Implemented Interfaces:
Calculation, InteractiveMouseHandler

public class PercolationApp
extends AbstractCalculation
implements InteractiveMouseHandler

PercolationApp displays site percolation clusters. Click on a cluster to select and change its color.


Field Summary
 
Fields inherited from class org.opensourcephysics.controls.AbstractCalculation
control, decimalFormat, mainFrame
 
Constructor Summary
PercolationApp()
          Creates the PercolationApp and sets the colors for lattice.
 
Method Summary
 void calculate()
          Occupy all sites with probability p
 void handleMouseAction(InteractivePanel panel, java.awt.event.MouseEvent evt)
           
static void main(java.lang.String[] args)
           
 void reset()
          Resets the program to its default state.
 
Methods inherited from class org.opensourcephysics.controls.AbstractCalculation
addChildFrame, clearChildFrames, getChildFrames, getLoader, getMainFrame, getOSPApp, resetCalculation, setControl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PercolationApp

public PercolationApp()
Creates the PercolationApp and sets the colors for lattice.

Method Detail

handleMouseAction

public void handleMouseAction(InteractivePanel panel,
                              java.awt.event.MouseEvent evt)
Specified by:
handleMouseAction in interface InteractiveMouseHandler
Parameters:
panel - InteractivePanel
evt - MouseEvent

calculate

public void calculate()
Occupy all sites with probability p

Specified by:
calculate in interface Calculation
Specified by:
calculate in class AbstractCalculation

reset

public void reset()
Description copied from class: AbstractCalculation
Resets the program to its default state. Override this method to set the program's parameters.

Overrides:
reset in class AbstractCalculation

main

public static void main(java.lang.String[] args)