|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component net.sourceforge.webcompmath.draw.Drawable net.sourceforge.webcompmath.draw.beans.WCMIntegralCurveBean
public class WCMIntegralCurveBean
An intergral curve draws a solution to a set of differential equations. You can use it with a vector field or by itself.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
static int |
DASHED_STYLE
Specifies that the shape should be drawn with dashed line(s). |
static int |
EULER
Use Euler's method |
protected int |
lineStyle
The line style, SOLID_STYLE or DASHED_STYLE |
static int |
RK2
Use Runge-Kutta 2 |
static int |
RK4
Use Runge-Kutta 4 |
static int |
SOLID_STYLE
Specifies that the shape should be drawn with solid line(s). |
Fields inherited from class net.sourceforge.webcompmath.draw.Drawable |
---|
canvas, coords |
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 | |
---|---|
WCMIntegralCurveBean()
Create an integral curve object with a default graph. |
|
WCMIntegralCurveBean(Function xFunc,
Function yFunc,
Value x,
Value y,
Value dt,
int method,
Value stepsMinus,
Value stepsPlus)
Create an integral curve with the specified functions and method. |
Method Summary | |
---|---|
void |
compute()
Recompute data for the integral curve and make sure that the area of the display canvas that shows the curve is redrawn. |
void |
draw(java.awt.Graphics g,
boolean coordsChanged)
Draw the curve (possibly recomputing the data if the CoordinateRect has changed). |
java.awt.Color |
getColor()
Get the color that is used to draw the integral curve. |
Value |
getDeltaT()
Get the delta T |
int |
getLineStyle()
Get the line style, SOLID_STYLE or DASHED_STYLE |
int |
getLineWidth()
Get the width, in pixels, of lines that are drawn. |
int |
getMethod()
Get the method. |
Value |
getStepsMinus()
Get the number of steps in the minus direction |
Value |
getStepsPlus()
Get the number of steps in the positive direction |
Value |
getXCoord()
Get the starting x coord |
Function |
getXFunction()
Get the (possibly null) function that gives the x-component of the integral curve |
Value |
getYCoord()
Get the starting y coordinate |
Function |
getYFunction()
Get the (possibly null) function that gives the y-component of the vector field. |
void |
setColor(java.awt.Color c)
Set the color to be used for drawing the integral curve. |
void |
setDeltaT(Value deltaT)
Set the delta t |
void |
setFunctions(Function dx,
Function dy)
Sets the functions that give the components of the integral curve. |
void |
setLineStyle(int lineStyle)
Set the line style, SOLID_STYLE or DASHED_STYLE |
void |
setLineWidth(int width)
Set the width, in pixels, of lines that are drawn. |
void |
setMethod(int method)
Set the method.This should be one of the constants EULER, RK2 or RK4 |
void |
setStepsMinus(Value stepsMinus)
Set the number of steps in the minus direction |
void |
setStepsPlus(Value stepsPlus)
Set the number of steps in the positive direction |
void |
setXCoord(Value coord)
Set the starting x coord |
void |
setXFunction(Function dx)
Set the function that gives the x-component of the integral curve. |
void |
setYCoord(Value coord)
Set the starting y coordinate |
void |
setYFunction(Function dy)
Set the function that gives the y-component of the integral curve. |
Methods inherited from class net.sourceforge.webcompmath.draw.Drawable |
---|
getVisible, needsRedraw, setOwnerData, setVisible |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int EULER
public static final int RK2
public static final int RK4
public static final int SOLID_STYLE
public static final int DASHED_STYLE
protected int lineStyle
Constructor Detail |
---|
public WCMIntegralCurveBean()
public WCMIntegralCurveBean(Function xFunc, Function yFunc, Value x, Value y, Value dt, int method, Value stepsMinus, Value stepsPlus)
xFunc
- A Function of two variables giving the x-component of the
integral curve. If this is null, then nothing will be drawn.yFunc
- A Function of two variables giving the y-component of the
integral curve. If this is null, then nothing will be drawn.x
- the x coordinate of the starting pointy
- the y coordinate of the starting pointdt
- the delta tmethod
- one of EULER, RK2 or RK4stepsMinus
- steps in the negative directionstepsPlus
- steps in the positive directionMethod Detail |
---|
public void setColor(java.awt.Color c)
c
- field line colorpublic java.awt.Color getColor()
public void setFunctions(Function dx, Function dy)
dx
- function that gives the x-component of the integral curvedy
- function that gives the y-component of the integral curvepublic void setXFunction(Function dx)
dx
- function that gives the x-component of the integral curvepublic void setYFunction(Function dy)
dy
- function that gives the y-component of the integral curvepublic Function getXFunction()
public Function getYFunction()
public int getMethod()
public void setMethod(int method)
method
- method constantpublic void setLineWidth(int width)
width
- line widthpublic int getLineWidth()
public int getLineStyle()
public void setLineStyle(int lineStyle)
lineStyle
- The lineStyle to set.public Value getDeltaT()
public void setDeltaT(Value deltaT)
deltaT
- The deltaT to set.public Value getXCoord()
public void setXCoord(Value coord)
coord
- The xCoord to set.public Value getYCoord()
public void setYCoord(Value coord)
coord
- The yCoord to set.public Value getStepsMinus()
public void setStepsMinus(Value stepsMinus)
stepsMinus
- the number of stepspublic Value getStepsPlus()
public void setStepsPlus(Value stepsPlus)
stepsPlus
- the number of stepspublic void compute()
compute
in interface Computable
public void draw(java.awt.Graphics g, boolean coordsChanged)
draw
in class Drawable
g
- graphics contextcoordsChanged
- true or false
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |