cox.jmatt.java.MathTools.demo
Class MathXMLPizza

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

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

The demos here are:

  1. All dangerous XML characters in the parameter area are escaped: greater- and less-than brackets, ampersand, quote, and apostrophe. They are replaced with their XML entity escapes. This is automatically sent to processMathObject(), which in Basic MathPrinter sends it to the clipboard. Clearing the area first allows arbitrary text to be XML-escaped.
  2. String.0 is wrapped in <math> tags. String.1 is an optional 'display=' attribute. The only accepted values are 'block' and 'inline' but the method does not enforce this.
  3. Call wrapTag() with String.0 as the tag name and String.1 as the content. The tags are formed and the content put between them without checking or escaping XML entities; use with caution!
  4. Demonstrate wrapMN() by wrapping String.0 in number tags.
  5. Demonstrate wrapMI() by wrapping String.0 in identifier (variable) tags.
  6. Demonstrate wrapMO() by wrapping String.0 in operation tags.
  7. Wrap String.0 in <mrow> tags. Content is NOT escaped before it is added!
  8. Parse the entire parameter panel content and convert it to MathML. The characters and other tokens MUST be space-separated, and parser format tokens can be included. For a list of format tokens see MathXML.parseMathML(). Multiple lines are preserved but not <mrow>'ed. Any blank lines are ignored.
  9. Create a fraction tag, with or without a whole part. String.0 is the whole part, String.1 is the numerator and String.2 is the denominator. These Strings ARE parsed, so format tokens are acceptable. The resulting content should be automatically interpreted and tagged correctly.
  10. Look up the MathSymbol specified in String.0 and print information about it.
  11. (MTXProcessor) Check the file specified in String.0 for structural errors; i.e. parse via checkXML().
  12. (MTXProcessor) Parse the file specified in String.0 for MathTools markup and print the results.
  13. (MTXProcessor) Transform the file String.0 using the stylesheet String.1. If the '... not available...' message appears the Math ClassLoader must be set explicitly from an URLLoaderPanel (Scripting or MathDBC demo). As long as the application is not termiated the Math ClassLoader remains active. This demo automatically uses it and always checks for availability before transforming. Similarly the Global Pizza must be set manually if it is to be used. NOTE: The entire file paths must be entered. The result of the transform is printed and sent to processMathObject(); BasicMathPrinter will send it to the clipboard.

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
MathXMLPizza()
           
 
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

MathXMLPizza

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