com.ajc.esim.core
Class LineCharge

java.lang.Object
  extended by com.ajc.esim.core.Charge
      extended by com.ajc.esim.core.LineCharge
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public class LineCharge
extends Charge

Not currently in use. This class represents a 2D rectangular charge. It is not currently implemented due to the complexity of the math required to calculate the force it exerts.

See Also:
sci.core.Charge, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.ajc.esim.core.Charge
Charge.ChargeType
 
Field Summary
 
Fields inherited from class com.ajc.esim.core.Charge
isSel, myShape
 
Constructor Summary
LineCharge(double charge, double x, double y, double w, double l)
           
 
Method Summary
 boolean checkClick(java.awt.event.MouseEvent e)
          Checks to see if this was clicked on.
 double getHeight()
          Gets the height of the charge, default is 1/2 of getSize(), can be overridden
 double getLength()
          Gets the length of the charge, default is 1/2 of getSize(), can be overridden
 double getSize()
          Size of charge for painting, currently set at 16.
 double getX()
           
 double getY()
           
 boolean isInside(double x, double y)
          Needs to be overridden by implementing classes
 void paint(java.awt.Graphics g)
          Paint method, to be overridden by implementing classes
 void reBuildShape()
          Builder for shape object, to be overridden by implementing classes
 void setHeight(double width)
           
 void setLength(double length)
           
 
Methods inherited from class com.ajc.esim.core.Charge
compareTo, drawOutline, getCharge, getChargeText, getPaintX, getPaintY, getType, setCharge, setType, setX, setY, toStringShort
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineCharge

public LineCharge(double charge,
                  double x,
                  double y,
                  double w,
                  double l)
Method Detail

checkClick

public boolean checkClick(java.awt.event.MouseEvent e)
Description copied from class: Charge
Checks to see if this was clicked on.

Overrides:
checkClick in class Charge
Parameters:
e - MouseEvent, passed from Launcher.win
Returns:
true if moused clicked on this, otherwise, false

getHeight

public double getHeight()
Description copied from class: Charge
Gets the height of the charge, default is 1/2 of getSize(), can be overridden

Overrides:
getHeight in class Charge
Returns:
double height
See Also:
Charge.getSize()

getLength

public double getLength()
Description copied from class: Charge
Gets the length of the charge, default is 1/2 of getSize(), can be overridden

Overrides:
getLength in class Charge
Returns:
double length
See Also:
Charge.getSize()

getSize

public double getSize()
Description copied from class: Charge
Size of charge for painting, currently set at 16.

Overrides:
getSize in class Charge
Returns:
double, size of charge

getX

public double getX()
Overrides:
getX in class Charge
Returns:
Returns the x location.

getY

public double getY()
Overrides:
getY in class Charge
Returns:
Returns the y location.

isInside

public boolean isInside(double x,
                        double y)
Description copied from class: Charge
Needs to be overridden by implementing classes

Specified by:
isInside in class Charge
Parameters:
x - X location of point to check
y - Y location of point to check
Returns:
boolean True if point (X,Y) is covered by the charge when displayed on screen

paint

public void paint(java.awt.Graphics g)
Description copied from class: Charge
Paint method, to be overridden by implementing classes

Specified by:
paint in class Charge
Parameters:
g - Graphics object for painting

reBuildShape

public void reBuildShape()
Description copied from class: Charge
Builder for shape object, to be overridden by implementing classes

Specified by:
reBuildShape in class Charge
See Also:
Charge.myShape

setHeight

public void setHeight(double width)

setLength

public void setLength(double length)