org.opensourcephysics.sip.ch10
Class ElectricFieldApp

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

public class ElectricFieldApp
extends AbstractCalculation
implements InteractiveMouseHandler

ElectricFieldApp draws the vector field from point charges.


Field Summary
 
Fields inherited from class org.opensourcephysics.controls.AbstractCalculation
control, decimalFormat, mainFrame
 
Constructor Summary
ElectricFieldApp()
          The ElectricFieldApp constructor.
 
Method Summary
 void calculate()
          Adds a new charge.
 void handleMouseAction(InteractivePanel panel, java.awt.event.MouseEvent evt)
          Handles mouse actions from the panel.
static void main(java.lang.String[] args)
          The main method starts the Java application.
 void reset()
          Removes charges and recalculates the field.
 
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

ElectricFieldApp

public ElectricFieldApp()
The ElectricFieldApp constructor.

Method Detail

calculate

public void calculate()
Adds a new charge.

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

reset

public void reset()
Removes charges and recalculates the field.

Overrides:
reset in class AbstractCalculation

handleMouseAction

public void handleMouseAction(InteractivePanel panel,
                              java.awt.event.MouseEvent evt)
Handles mouse actions from the panel.

Specified by:
handleMouseAction in interface InteractiveMouseHandler
Parameters:
panel -
evt -

main

public static void main(java.lang.String[] args)
The main method starts the Java application.

Parameters:
args[] - the input parameters