rootbisection
Class AppletRootFromHTML

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--java.applet.Applet
                          |
                          +--rootbisection.AppletRootFromHTML
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class AppletRootFromHTML
extends java.applet.Applet

Toma los parametros desde una llamada (disen~ada para HTML) para el uso de los algoritmos para encontrar raices de una funcion.

Version:
1.0, 25/08/2001
Author:
Omar Posada Villarreal
See Also:
Serialized Form

Inner classes inherited from class java.applet.Applet
java.applet.Applet.AccessibleApplet
 
Inner classes inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock
 
Field Summary
private  double a
           
private  double b
           
private  java.lang.String choosedMethod
           
private  double[] coef
           
private  boolean found
           
private  UserFunction function
           
private  int iterations
           
private  int maxCoef
           
private  java.awt.Panel panRoot
           
private  double root
           
private  java.awt.TextArea taRoot
           
private  java.awt.TextField tfTit
           
private  double tolerance
           
 
Fields inherited from class java.applet.Applet
accessibleContext, serialVersionUID, stub
 
Fields inherited from class java.awt.Panel
base, nameCounter
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, dbg, dispatcher, layoutMgr, listeningBoundsChildren, listeningChildren, maxSize, ncomponents, printing, printingThreads
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
AppletRootFromHTML()
           
 
Method Summary
 void calculateRoot()
          Corre el algoritmo de Bisection o NewtonRaphson.
 double getRoot()
          Regresa la raiz encontrada.
 void init()
          Prepara el despliega del PanelRoot.
private  void initPolynom(double[] cf)
          Inicializa el polinomio.
 void initRootCoefficients(java.lang.String c0, java.lang.String c1, java.lang.String c2, java.lang.String c3, java.lang.String c4, java.lang.String c5, java.lang.String c6, java.lang.String c7, java.lang.String c8)
          Inicializa los coeficientes del polinomio de grado 8.
 void initRootParameters(java.lang.String sA, java.lang.String sB, java.lang.String sTolerance, java.lang.String sIterations)
          Inicializa los parametros del polinomio.
 boolean wasFound()
          Checa si se encontro una raiz.
 
Methods inherited from class java.applet.Applet
destroy, getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop
 
Methods inherited from class java.awt.Panel
, addNotify, constructComponentName
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, adjustListeningChildren, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventImpl, dispatchEventToSelf, doLayout, eventEnabled, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, initIDs, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, nextFocus, numListening, paint, paintComponents, paintHeavyweightComponents, paramString, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, print, printComponents, printHeavyweightComponents, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, readObject, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusOwner, setFont, setLayout, transferFocus, update, validate, validateTree, writeObject
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkit, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, resetGC, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

root

private double root

found

private boolean found

function

private UserFunction function

coef

private double[] coef

maxCoef

private int maxCoef

a

private double a

b

private double b

tolerance

private double tolerance

iterations

private int iterations

panRoot

private java.awt.Panel panRoot

tfTit

private java.awt.TextField tfTit

taRoot

private java.awt.TextArea taRoot

choosedMethod

private java.lang.String choosedMethod
Constructor Detail

AppletRootFromHTML

public AppletRootFromHTML()
Method Detail

initRootCoefficients

public void initRootCoefficients(java.lang.String c0,
                                 java.lang.String c1,
                                 java.lang.String c2,
                                 java.lang.String c3,
                                 java.lang.String c4,
                                 java.lang.String c5,
                                 java.lang.String c6,
                                 java.lang.String c7,
                                 java.lang.String c8)
Inicializa los coeficientes del polinomio de grado 8. Uso para llamada de HTML.

initRootParameters

public void initRootParameters(java.lang.String sA,
                               java.lang.String sB,
                               java.lang.String sTolerance,
                               java.lang.String sIterations)
Inicializa los parametros del polinomio. Uso para llamada de HTML.

initPolynom

private void initPolynom(double[] cf)
Inicializa el polinomio.

getRoot

public double getRoot()
Regresa la raiz encontrada.

wasFound

public boolean wasFound()
Checa si se encontro una raiz.

init

public void init()
Prepara el despliega del PanelRoot.
Overrides:
init in class java.applet.Applet

calculateRoot

public void calculateRoot()
Corre el algoritmo de Bisection o NewtonRaphson. Uso desde HTML: Necesita que antes se haya llamado a "initRootCoefficients(String c0, ... String c8);" "initRootParameters(String sA, String sB, String sTolerance, String sIterations);" Muestra los resultados.