|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Panel
java.applet.Applet
edu.davidson.tools.SApplet
poisson.Poisson
This applet solves Poisson's equation. Both conductors and charge distributions can be specified using "add" methods.
Field Summary |
Fields inherited from class edu.davidson.tools.SApplet |
destroyed |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Method Summary | |
int |
addCircle(double x,
double y,
int r,
double v)
Add a circular conductor with a fixed voltage. |
int |
addCircleCharge(double x,
double y,
int r,
double q)
Add a circular charge distribution. |
int |
addConnectorLine(int id1,
int id2)
Add a connecting line between two objects |
int |
addObject(java.lang.String name,
java.lang.String parList)
Create an object and add it to the Physlet. |
int |
addRectangle(double x,
double y,
int w,
int h,
double q)
Add a rectangular conductor with a fixed voltage. |
int |
addRectangleCharge(double x,
double y,
int w,
int h,
double v)
Add a rectangular charge distribution. |
int |
getChargeArrayID()
Gets the object identifier for the charge density. |
int |
getEnsembleID()
Gets the object identifier for ensemble of objects in the poisson applet. |
int |
getPotentialArrayID()
Gets the object identifier for the potential array. |
double |
getXPos(int id)
Gets the x position. |
double |
getYPos(int id)
Gets the y position. |
boolean |
set(int id,
java.lang.String name,
java.lang.String parList)
Changes the properies of an object. |
boolean |
setAnimationSlave(int masterID,
int slaveID)
Forces an object to follow another object on the screen. |
void |
setAutoRefresh(boolean ar)
Repaints when the system parameters are changed. |
void |
setCaption(java.lang.String caption)
Set the caption. |
boolean |
setChargeDensity(int id,
double q)
Sets the charge density. |
boolean |
setChi(int id,
double chi)
Sets the dielectric permittivity. |
boolean |
setConnector(int id,
int id1,
int id2)
Sets the connector line between two objects. |
boolean |
setConstantQ(int id,
double q,
boolean isConstant)
Makes the charge rather than the voltage on this conductor constant. |
boolean |
setConstraint(int id,
int constraintID)
Sets a motion constraint on an object. |
void |
setDefault()
Sets the default values: grid=false, fild vectors=false,contours=true, drag=false, no E and no V on mouse drag. |
void |
setDefaultDragable(boolean drag)
Sets the dragable property for all subsequent objects. |
void |
setDefaultRGB(int r,
int g,
int b)
Sets the color for all subsequent drawing. |
boolean |
setDisplayOffset(int id,
int xOff,
int yOff)
Offset the object's position on the screen from its default drawing position. |
boolean |
setDragable(int id,
boolean isDragable)
Makes an object dragable. |
void |
setDrawChargeDensity(boolean isChargeMode)
Sets the drawing to chargedensity mode or conductor mode in the UI. |
void |
setFieldResolution(int r)
Sets the resoltion for the field vectors. |
boolean |
setFont(int id,
java.lang.String family,
int style,
int size)
change the object's font for any text that is displayed. |
boolean |
setFormat(int id,
java.lang.String format)
change the object's numerical format for any numbers that is displayed. |
void |
setGutter(int g)
Sets a gutter of grid points outside the viewing region. |
void |
setMaxIterations(int m)
Sets the maximum number of inerations for the Poisson solver. |
void |
setMessage(java.lang.String msg)
Display a message in the yellow message box. |
boolean |
setObjectFont(int id,
java.lang.String family,
int style,
int size)
Sets the object's font if the object has text that can be displayed. |
boolean |
setResizable(int id,
boolean isResizable)
Makes an object resizable. |
boolean |
setRGB(int id,
int r,
int g,
int b)
Sets the color for an object. |
boolean |
setShowCharge(int id,
boolean isShowCharge)
Shows the induced charge. |
void |
setShowContours(boolean isShowContours)
Shows the contour lines? |
void |
setShowEOnDrag(boolean isShowEOnDrag)
Show the magnitude of the electric field when the mouse is dragged. |
void |
setShowFieldVectors(boolean isShowField)
Turn field vectors off and on. |
void |
setShowGrid(boolean isShowGrid)
Turns grid off and on. |
void |
setShowRhoOnDrag(boolean isShowRhoOnDrag)
Show the charge density when the mouse is dragged. |
void |
setShowVOnDrag(boolean isShowVOnDrag)
Show the charge voltage when the mouse is dragged. |
void |
setTolerance(double tol)
Sets the tolerance of the Poisson solver. |
boolean |
setVisibility(int id,
boolean isVisible)
Makes an object visible. |
boolean |
setVoltage(int id,
double v)
Sets the voltage on the conductor. |
boolean |
setXPos(int id,
double x)
Sets the x position. |
void |
setXRange(double xmin,
double xmax)
Sets the scale using the horizontal axis. |
boolean |
setXYPos(int id,
double x,
double y)
Sets the position. |
boolean |
setYPos(int id,
double y)
Sets the y position. |
void |
setYRange(double ymin,
double ymax)
Method setYRange |
Methods inherited from class java.applet.Applet |
destroy, getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, init, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start |
Methods inherited from class java.awt.Panel |
addNotify |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
public int addConnectorLine(int id1, int id2)
id1
- The first id of a screen object.id2
- The second id of a screen object.
public int addCircle(double x, double y, int r, double v)
x
- x postion of centery
- y postion of centerr
- radius in pixelsv
- voltage of conductor
public int addCircleCharge(double x, double y, int r, double q)
x
- x postion of centery
- y postion of centerr
- radius in pixelsq
- charge
public int addObject(java.lang.String name, java.lang.String parList)
addObject ("circle", "x = 0, y = -1.0, r = 10");
name
- the type of object to be created.parList
- a list of parameters to be set
public int addRectangle(double x, double y, int w, int h, double q)
x
- x postion of centery
- y postion of centerw
- width in pixelsh
- height in pixelsq
-
public int addRectangleCharge(double x, double y, int w, int h, double v)
x
- x postion of centery
- y postion of centerw
- width in pixelsh
- height in pixelsv
-
public boolean set(int id, java.lang.String name, java.lang.String parList)
set(id, "sale", "xmin=0, xmax=2, autoscalx=false");
id
- the identifier of the objectname
- the type of property to be created.parList
- a list of parameters
public boolean setAnimationSlave(int masterID, int slaveID)
masterID
- The id of the master object.slaveID
- The id of the slave object.
public void setAutoRefresh(boolean ar)
setAutoRefresh
in class SApplet
ar
- public void setCaption(java.lang.String caption)
caption
- The applet caption.public boolean setConnector(int id, int id1, int id2)
id
- the id of the connector object.id1
- the id of the first object.id2
- the id of the second object.
true
if successful.public boolean setConstraint(int id, int constraintID)
id
- the ID of the object.constraintID
- the ID of the constraint.
true
if successful.public void setDefaultRGB(int r, int g, int b)
r
- 0<=red<=255g
- 0<=green<=255b
- 0<=blue<=255public void setDefault()
setDefault
in class SApplet
public boolean setDisplayOffset(int id, int xOff, int yOff)
id
- The id of the object.xOff
- yOff
-
public void setDefaultDragable(boolean drag)
drag
- public void setShowFieldVectors(boolean isShowField)
isShowField
- public boolean setShowCharge(int id, boolean isShowCharge)
id
- the id of the object.isShowCharge
- property
public void setShowContours(boolean isShowContours)
isShowContours
- public void setShowGrid(boolean isShowGrid)
isShowGrid
- public boolean setDragable(int id, boolean isDragable)
id
- The ID of the object.isDragable
-
true
if successful.public boolean setResizable(int id, boolean isResizable)
id
- the ID of the object.isResizable
-
true
if successful.public boolean setConstantQ(int id, double q, boolean isConstant)
id
- the object identifier.q
- the charge valueisConstant
- true
if charge should be held constant.
true
if successful.public boolean setVoltage(int id, double v)
id
- the object identifier.v
-
true
if successful.public double getXPos(int id)
id
- the object identifier.
true
if successful.public double getYPos(int id)
id
- the object identifier.
true
if successful.public boolean setXPos(int id, double x)
id
- the object identifier.x
- the x position
true
if successful.public boolean setYPos(int id, double y)
id
- the object identifier.y
-
true
if successful.public boolean setXYPos(int id, double x, double y)
id
- the object identifier.x
- the x positiony
-
true
if successful.public boolean setChi(int id, double chi)
id
- the object identifier.chi
- the permittivity
true
if successful.public boolean setChargeDensity(int id, double q)
id
- the object identifier.q
- the charge value
true
if successful.public boolean setVisibility(int id, boolean isVisible)
id
- The ID of the object.isVisible
-
true
if successful.public void setFieldResolution(int r)
r
- the resolutionpublic void setGutter(int g)
g
- the gutterpublic boolean setFont(int id, java.lang.String family, int style, int size)
id
- The id of the object.family
- The font family: Helvetica, Times.style
- The style, 0=plain, 1=bold.size
- The size of the font;
public boolean setObjectFont(int id, java.lang.String family, int style, int size)
id
- The id of the object.family
- The font family: Helvetica, Times.style
- The style, 0=plain, 1=bold.size
- The size of the font;
public boolean setFormat(int id, java.lang.String format)
id
- The id of the object.format
- a string using unix printf conventions.
public void setMessage(java.lang.String msg)
msg
- Message to display after the animation stops.public void setMaxIterations(int m)
m
- public void setTolerance(double tol)
tol
- public void setDrawChargeDensity(boolean isChargeMode)
isChargeMode
- true
if chargedensity mode and false
otherwisepublic void setXRange(double xmin, double xmax)
xmin
- Minimuum value on x axis.xmax
- Maximum value on x axis.public void setYRange(double ymin, double ymax)
ymin
- ymax
- public void setShowEOnDrag(boolean isShowEOnDrag)
isShowEOnDrag
- public void setShowRhoOnDrag(boolean isShowRhoOnDrag)
isShowRhoOnDrag
- Show charge density on drag?public void setShowVOnDrag(boolean isShowVOnDrag)
isShowVOnDrag
- public boolean setRGB(int id, int r, int g, int b)
id
- The ID of the object.r
- red.g
- green.b
- blue.
public int getPotentialArrayID()
public int getChargeArrayID()
public int getEnsembleID()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |