cox.jmatt.java.MathTools.demo
Class PolynomialPizza

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by cox.jmatt.java.MathTools.demo.PizzaPanel
                  extended by cox.jmatt.java.MathTools.demo.PolynomialPizza
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class PolynomialPizza
extends PizzaPanel

This PizzaPanel demonstrates Polynomial methods. The parameter types are specified on the Choice component and the indicated method is called by clicking the [Go!] button.

The format used for entering Polynomials is here and it is consistent throughout the demos. The demos in this Panel are:

  1. Create a new Polynomial from String.0 and print it via its toString() method. The input and output will be very similar BUT if no variable or function name is supplied, the defaults will appear on the output.
  2. Format Polynomial(String.0) and print it. Boolean.1 true prints in ascending order and boolean.2 prints it as a polynomial function. Then its XML form is printed. String.3, if present, becomes the tag's ID. NOTE: This is not the same as its MathML representation!
  3. Format Polynomial(String.0) and then format it per the term template in String.1, boolean.2 ascending and boolean.3 to include zero terms.
  4. Create a random Polynomial by calling setPolyKnobs() with String.0 as the Knobs to use.
  5. Add Polynomial(String.0) to Polynomial(String.1).
  6. Subtract Polynomial(String.1) from Polynomial(String.0).
  7. Multiply Polynomial(String.0) by the constant int.1.
  8. Multiply Polynomial(String.0) by Polynomial(String.1).
  9. Evaluate Polynomial(String.0) as a function at the value int.1.
  10. Print the first and second derivative of Polynomial(String.0)
  11. Call the createQuotient() method on Polynomial(String.0) and Polynomial(String.1). String.2 is the division indicator, String.3 is the left fence and String.4 is the right fence.
  12. Convert Polynomial(String.0) to MathML markup. Boolean.1 true formats in ascending order and boolean.2 true activates 'smart' mode. In smart mode the exponent is not rendered if it is 1 and neither the exponent nor variable appear on the constant term.
  13. unFormat() Polynomial(String.0) based on the formatting String in String.1.
  14. Create Polynomial function F(x) from s.0, G(x) from s.1 and evaluate F(G(x)).
  15. Print the relation formatEquation() with Polynomial(String.0) and Polynomial(String.1). The relation is String.2 and the fence Strings are String.3 and String.4.
  16. Create Polynomials from String.0 and String.1 and test them for equality per the equals() method.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
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
 
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
PolynomialPizza()
           
 
Method Summary
 java.awt.Panel getNorthPanel()
          Retrieve the component to be displayed in the NORTH part of the Panel.
 void processGoButton()
          This method is called when the [Go!] button is clicked.
 
Methods inherited from class cox.jmatt.java.MathTools.demo.PizzaPanel
_addToPizza, actionPerformed, asBoolean, asDouble, asInt, asLong, asNullString, asString, clearParams, eatPizza, getRawPizza, resetParams, resetParams
 
Methods inherited from class java.awt.Panel
addNotify, getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PolynomialPizza

public PolynomialPizza()
Method Detail

getNorthPanel

public java.awt.Panel getNorthPanel()
Description copied from class: PizzaPanel
Retrieve the component to be displayed in the NORTH part of the Panel. Defaults to a title Label.

Overrides:
getNorthPanel in class PizzaPanel

processGoButton

public void processGoButton()
Description copied from class: PizzaPanel
This method is called when the [Go!] button is clicked. Default implementation calls eatPizza().

Overrides:
processGoButton in class PizzaPanel