|
|||||||
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
bfield.BField
Class BField
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 |
Constructor Summary | |
BField()
Constructor BField |
Method Summary | |
int |
addCoil(double x,
double y,
double current)
Add add a single coil. |
int |
addObject(java.lang.String name,
java.lang.String parList)
Creates an object and adds it to the Physlet. |
int |
addWire(double x,
double y,
double current)
Add add a Wire. |
void |
clearSeries(int s)
Clears the data from a series. |
void |
deleteSeries(int s)
Deletes a series from the graph |
int |
getAppletCount()
Counts the number of applets on a page. |
java.lang.String |
getAppletInfo()
Gets information about this applet. |
double |
getBx(double x,
double y)
Gets the x component of the B field at a point. |
double |
getBy(double x,
double y)
Gets the y component of the B field at a point. |
int |
getGraphID()
Gets the series ID for the graph object. |
java.lang.String[][] |
getParameterInfo()
Gets information about the embedding parameters. |
double |
getXPos(int id)
Gets X position of an object. |
double |
getYPos(int id)
Gets X position of an object. |
void |
reset()
Resets the applet and clears the field lines. |
boolean |
setAnimationSlave(int masterID,
int slaveID)
Forces an object to follow another object on the screen. |
void |
setAutoRefresh(boolean ar)
Automatically repaints the Physlet every time a parameter is changed. |
void |
setBFunctions(java.lang.String bx,
java.lang.String by,
double xmin,
double xmax,
double ymin,
double ymax)
Sets an external magnetic field. |
boolean |
setConstraint(int id,
int constraintID)
Sets a motion constraint on an object. |
boolean |
setCurrent(int id,
double c)
Changes the current of a wire or loop after it has been created. |
void |
setDefault()
Removes the wires and coils and resets the applet into a predfined state. |
void |
setDefaultLabel(java.lang.String str)
Sets the default label that will be drawn inside a wire. |
void |
setDefaultRGB(int r,
int g,
int b)
Sets the default red, green, and blue color values for all subsequent wires and coils. |
boolean |
setDisplayOffset(int id,
int xOff,
int yOff)
Offsets the object's position on the screen from its default drawing position. |
boolean |
setDragable(int id,
boolean drag)
Changes the drag property of an object. |
boolean |
setFont(int id,
java.lang.String family,
int style,
int size)
Sets the object's font for text that is associated with the object. |
boolean |
setFormat(int id,
java.lang.String fstr)
Changes the object's format for the display of numeric data. |
void |
setHideWire(boolean hw)
Sets the default visibility for wires and coils. |
boolean |
setLabel(int id,
java.lang.String str)
Changes the label property of a wire or loop after it has been created. |
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 |
setOptionDrag(int id,
boolean isDrag)
Deprecated. |
boolean |
setRadius(int id,
double r)
Changes the radius of a loop after it has been created. |
boolean |
setResizable(int id,
boolean isResizable)
Makes an object resizable. |
boolean |
setRGB(int id,
int r,
int g,
int b)
Sets the red, green, and blue color values for a wire or coil that has already been created. |
void |
setSeriesRGB(int id,
int r,
int g,
int b)
Set the series line and marker color. |
void |
setSeriesStyle(int id,
boolean conPts,
int m)
Sets the series style for the graph object. |
void |
setShowBOnDrag(boolean sb)
Enables a the user to read the magnetic field magnitude by click-dragging the mouse. |
void |
setShowControls(boolean sc)
Enables interactive controls. |
void |
setShowCoordOnDrag(boolean sc)
Enables a the user to read coordinates by click-dragging the mouse. |
boolean |
setShowFComponents(int id,
boolean showComponents)
Enables a wire to show the force vector components. |
void |
setShowFieldLineOnClick(boolean sfl)
Enables the user to click in order to draw a magnetic field line. |
void |
setShowFieldLineOnDoubleClick(boolean sfl)
Enables the user to double click in order to draw a magnetic field line. |
void |
setShowFieldVectors(boolean sfv)
Shows the vector field. |
boolean |
setShowForce(int id,
boolean showForce)
Shows the force on a wire in the message box when the object is clicked. |
boolean |
setShowFVector(int id,
boolean showForce)
Shows the net force vector on a wire. |
boolean |
setShowInfo(int id,
boolean showInfo)
Enables an object to show information such as the current. |
int |
setSketchMode(boolean sketch)
Enables sketching with the mouse. |
boolean |
setVisibility(int id,
boolean v)
Sets an objects visibility. |
boolean |
setXPos(int id,
double x)
Sets x position of an object. |
boolean |
setXY(int id,
double x,
double y)
Sets position of an object. |
boolean |
setY(int id,
double y)
Sets the y postion of an object. |
boolean |
setYPos(int id,
double y)
Sets Y position of an object. |
boolean |
swapZOrder(int id1,
int id2)
Swaps the drawing order on the screen. |
Methods inherited from class java.applet.Applet |
destroy, getAccessibleContext, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, 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 |
Constructor Detail |
public BField()
Method Detail |
public java.lang.String getAppletInfo()
public java.lang.String[][] getParameterInfo()
public int addWire(double x, double y, double current)
x
- The x position.y
- The y position.current
- The current.
BField.addCoil(double, double, double)
,
BField.setBFunctions(java.lang.String, java.lang.String, double, double, double, double)
public int addCoil(double x, double y, double current)
x
- The x position.y
- The y position.current
- The current.
BField.addWire(double, double, double)
,
BField.setBFunctions(java.lang.String, java.lang.String, double, double, double, double)
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 boolean setAnimationSlave(int masterID, int slaveID)
masterID
- The id of the master object.slaveID
- The id of the slave object.
public double getBx(double x, double y)
x
- The x coordinate.y
- The y coordinate.
public double getBy(double x, double y)
x
- The x coordinate.y
- The y coordinate.
public int getGraphID()
public void setSeriesRGB(int id, int r, int g, int b)
id
- The series id.r
- red.g
- green.b
- blue.public void setSeriesStyle(int id, boolean conPts, int m)
id
- The series id.conPts
- Connect the points?m
- Marker style. (m=1 is cross; m=2 is square, m=3 is
circle)public void deleteSeries(int s)
s
- public void clearSeries(int s)
s
- public void setAutoRefresh(boolean ar)
setAutoRefresh
in class SApplet
ar
- Automatic repaint?public void setBFunctions(java.lang.String bx, java.lang.String by, double xmin, double xmax, double ymin, double ymax)
bx
- Bx(x,y)by
- By(x,y)xmin
- The x minimum value.xmax
- The x maximum value.ymin
- The y minimum value.ymax
- The y maximum value.BField.addWire(double, double, double)
,
BField.addCoil(double, double, double)
public void setDefault()
setDefault
in class SApplet
public void reset()
reset
in class SApplet
public void setShowFieldLineOnClick(boolean sfl)
sfl
- Boolean value.public void setShowFieldLineOnDoubleClick(boolean sfl)
sfl
- Boolean value.public void setShowFieldVectors(boolean sfv)
sfv
- Boolean value.public boolean setRGB(int id, int r, int g, int b)
id
- The id for the wire or loop.r
- red.g
- green.b
- blue.
public boolean setLabel(int id, java.lang.String str)
id
- The id for the wire or loop.str
- The new label.
public boolean setDisplayOffset(int id, int xOff, int yOff)
id
- The id of the object.xOff
- yOff
-
public boolean setDragable(int id, boolean drag)
id
- the object identifierdrag
- true if dragable
public boolean setFormat(int id, java.lang.String fstr)
id
- The id of the object.fstr
- the format string.
public 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 setOptionDrag(int id, boolean isDrag)
id
- The id for the wire or loop.isDrag
- The new current.
setResizable
public boolean setResizable(int id, boolean isResizable)
id
- the object identifier.isResizable
-
true
if successful.public boolean setCurrent(int id, double c)
id
- The id for the wire or loop.c
- The new current.
public boolean setConstraint(int id, int constraintID)
id
- the ID of the object.constraintID
- the ID of the constraint.
true
if successful.public boolean setRadius(int id, double r)
id
- The id for the wire or loop.r
- The new radius.
public boolean setShowFVector(int id, boolean showForce)
id
- The id for the wire or loop.showForce
- Boolean value.
public boolean setShowForce(int id, boolean showForce)
id
- showForce
-
public boolean setShowFComponents(int id, boolean showComponents)
id
- The id for the wire or loop.showComponents
- Boolean value.
public boolean setShowInfo(int id, boolean showInfo)
id
- The id for the wire or loop.showInfo
- Boolean value.
public boolean setVisibility(int id, boolean v)
id
- the id for the wire or loop.v
- true if visible
public boolean setXY(int id, double x, double y)
id
- The ID of the object.x
- The x coordinate.y
- The y coordinate.
public boolean setXPos(int id, double x)
id
- The ID of the object.x
- The x coordinate.
public double getXPos(int id)
id
- The ID of the object.
public boolean setYPos(int id, double y)
id
- The ID of the object.y
- The y coordinate.
public boolean setY(int id, double y)
id
- y
-
public double getYPos(int id)
id
- The ID of the object.
public void setShowCoordOnDrag(boolean sc)
sc
- Boolean value.public int setSketchMode(boolean sketch)
sketch
- true will sketch
public void setShowBOnDrag(boolean sb)
sb
- Boolean value.public void setShowControls(boolean sc)
sc
- Boolean value.public void setHideWire(boolean hw)
hw
- Boolean value.public void setDefaultRGB(int r, int g, int b)
r
- red.g
- green.b
- blue.public void setDefaultLabel(java.lang.String str)
str
- the labelpublic boolean swapZOrder(int id1, int id2)
id1
- the first id of a screen objectid2
- the second id of a screen object
public int getAppletCount()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |