org.opensourcephysics.sip.ch10
Class FieldLineApp

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

public class FieldLineApp
extends AbstractCalculation
implements InteractiveMouseHandler

ElectricFieldApp draws electric field lines.


Field Summary
 
Fields inherited from class org.opensourcephysics.controls.AbstractCalculation
control, decimalFormat, mainFrame
 
Constructor Summary
FieldLineApp()
          The FieldLineApp constructor.
 
Method Summary
 void calculate()
          Adds a charge to the panel and does the calculation.
 void handleMouseAction(InteractivePanel panel, java.awt.event.MouseEvent evt)
          Handles mouse actions by dragging charges and starting field line calculations.
static void main(java.lang.String[] args)
          The main method starts the Java application.
 void reset()
          Removes all charges and field lines and sets the initial conditions.
 
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

FieldLineApp

public FieldLineApp()
The FieldLineApp constructor.

Method Detail

calculate

public void calculate()
Adds a charge to the panel and does the calculation.

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

reset

public void reset()
Removes all charges and field lines and sets the initial conditions.

Overrides:
reset in class AbstractCalculation

handleMouseAction

public void handleMouseAction(InteractivePanel panel,
                              java.awt.event.MouseEvent evt)
Handles mouse actions by dragging charges and starting field line calculations.

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