cox.jmatt.java.MathTools.demo
Class MathSetPizza

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.MathSetPizza
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 MathSetPizza
extends PizzaPanel

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

The demonstrations in this panel are:

  1. Create a MSet using String.0 as the initial parameter then addSets(String.1). The set is closed and dumpInfo() called.
  2. Create a set per 'A' but this time the information is via toPizza()/
  3. Using the pre-defined Real-Number MathSet, select the set described in String.0 and format it per the template in String.1. Set Boolean.2 to true to use the Complex numbers instead.
  4. Using the Real (or Complex, if boolean.1 is true) numbers, check to see if the set in String.0 is contained.
  5. This utility demo parses the RAW data from the parameter panel into a MathSet. Each line should contain only valid set descriptors and the area MUST be cleared completely first: no 'par.0' etc. or it will not parse properly! Once the set is parsed and stored, the pizza is sent to the clipboard and printed.
  6. This utility demo parses and stores a set, but this time from a (properly-formatted!!) Pizza, preferably the result of a toPizza() call. as above, the pizza is consumed, converted into a MathSet and stored using the SHELF_KEY.
  7. Using the built-in set of Complex Numbers, String.0 is selected. Next String.1 is checked with hasSuperset() and hasSubset()
  8. Select String.0 from the Complex Numbers then print a random superset and subset.
  9. From the Complex Numbers select String.0. List all upersets and subsets of it.
  10. Using the Complex numbers, create and print a Question. String.0 and String.1 are the sets to select in the main and clone, respectively. String.2 is the Problem format and String.3 is the Anser format. String.4 is the format used to print the Question. If not defined, the default debug format is used.
  11. This demo uses the two-argument 'hasSubset' and 'hasSuperset' methods and tests the proper working of the inner clone. The set used is the Complex Numbers.
  12. Create a random Question on the Complex Numbers. Boolean.0 determines whether it is a 'superset' or 'subset' question. The format symbol is changed in order to fit the question (capitalized, plural).
  13. Create a simple question on the Complex numbers. String.0 and String.1 select the sets to use and boolean.2 decides superset/subset.
  14. Select String.1 in the Complex numbers, then call shakeShakeShake(b.1) to mix up the sets. Next call the two-string createQuestion() with a simple format.

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
MathSetPizza()
           
 
Method Summary
 java.awt.Panel getNorthPanel()
          Retrieve the component to be displayed in the NORTH part of the Panel.
 MathSet parseMathSet()
          This method is used to parse the (RAW!) contents of the parameter area into a MathSet.
 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

MathSetPizza

public MathSetPizza()
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

parseMathSet

public MathSet parseMathSet()
This method is used to parse the (RAW!) contents of the parameter area into a MathSet. Demo selection 'E' uses this method to build a MathSet and store it on The Shelf. If the area is empty, MathSet.emptySet() is returned.