Class KP

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--java.applet.Applet
                          |
                          +--BaseApplet
                                |
                                +--BaseApplet2
                                      |
                                      +--KP

public class KP
extends BaseApplet2

Applet to show the Kronig-Penney model for periodic potential.

See Also:
Serialized Form

Inner classes inherited from class BaseApplet2
BaseApplet2.FixedButton, BaseApplet2.FixedCheckbox, BaseApplet2.GraphClickListener
 
Inner classes inherited from class BaseApplet
BaseApplet.MozillaWorkaround, BaseApplet.ResizeListener
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AWTTreeLock
 
Field Summary
protected static java.awt.Color AXES_COL
           
protected  SolnCache cache
          Stores solution, so that folding/unfolding does not require recalculation
protected static java.awt.Color ENERGY_COL
           
protected  Solvable eqn
          The Kronig-Penny model
protected  java.awt.Checkbox foldBox
           
protected  boolean folded
          true if the x-axis is folded, else false
protected static java.awt.Color FREE_COL
           
protected  java.awt.Checkbox freeBox
           
protected  Plotter freePlotter
           
protected  Plotter massPlotter
           
protected  java.awt.TextField maxXField
           
protected  boolean negative
          true if the x-axis includes negative values, else false
protected  java.awt.Checkbox negBox
           
protected  java.awt.TextField pField
           
protected  Plotter plotter
           
 
Fields inherited from class BaseApplet2
boxes, buttons, enablePrompt, fields, focus, panel, statusLabel, useSwing, V_MARGIN
 
Fields inherited from class BaseApplet
buffer, GRAPH_MARGIN, refresh, resizeListener, safetyLimit, useBuffer
 
Fields inherited from class java.applet.Applet
serialVersionUID, stub
 
Fields inherited from class java.awt.Panel
base, nameCounter, serialVersionUID
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, dispatcher, layoutMgr, maxSize, ncomponents, serialVersionUID
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, assert, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, hasFocus, height, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, serialVersionUID, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowListenerK, x, y
 
Constructor Summary
KP()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ae)
          Subclasses should at least provide an empty implementation of this method.
 void doPaint(java.awt.Graphics g)
          Called by forcePaint() to actually perform the painting.
 void init()
          Performs extra initialisation, including adding a panel to the bottom of the applet.
 void setFolded(boolean b)
          Used to set whether or not the x-axis is "folded" onto itself.
 void start()
          Applets should use this method to perform any final initialisation necessary to "activate" the applet
 void stop()
          When this method is called, the applet should cease any user interaction.
 void updateInput()
          Reads in (and validates) input from the text fields.
protected  void updateSolution(int w, int h)
           
 void validateInput(double p, double maxX)
          Performs the validation for updateInput().
 
Methods inherited from class BaseApplet2
add, add, addButton, addCheckbox, addField, addField, addField, addListeners, focusGained, focusLost, getDouble, getGraphHeight, getInt, lockControls, makeButton, makePanel, paintDashedLineH, paintDashedLineV, register, removeListeners, setComponentsEnabled, setLayout, setPromptEnabled, textValueChanged, toString, unlockControls
 
Methods inherited from class BaseApplet
changeFont, forcePaint, getAppletInfo, getParameterInfo, itemStateChanged, paint, refresh, update
 
Methods inherited from class java.applet.Applet
destroy, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus
 
Methods inherited from class java.awt.Panel
, addNotify, constructComponentName
 
Methods inherited from class java.awt.Container
add, add, add, add, addContainerListener, addImpl, applyOrientation, countComponents, deliverEvent, dispatchEventImpl, dispatchEventToSelf, doLayout, eventEnabled, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getCursorTarget, getInsets, getLayout, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, initIDs, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPrint, list, list, locate, minimumSize, nextFocus, paintComponents, paramString, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, print, printComponents, printOneComponent, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, readObject, remove, remove, removeAll, removeContainerListener, removeNotify, setCursor, setFocusOwner, setFont, transferFocus, updateCursor, validate, validateTree, writeObject
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getIntrinsicCursor, getLocation, getLocation, 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, 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, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, setBackground, setBounds, setBounds, setComponentOrientation, 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

pField

protected java.awt.TextField pField

maxXField

protected java.awt.TextField maxXField

foldBox

protected java.awt.Checkbox foldBox

negBox

protected java.awt.Checkbox negBox

freeBox

protected java.awt.Checkbox freeBox

folded

protected boolean folded
true if the x-axis is folded, else false

negative

protected boolean negative
true if the x-axis includes negative values, else false

eqn

protected Solvable eqn
The Kronig-Penny model

cache

protected SolnCache cache
Stores solution, so that folding/unfolding does not require recalculation

plotter

protected Plotter plotter

freePlotter

protected Plotter freePlotter

massPlotter

protected Plotter massPlotter

AXES_COL

protected static java.awt.Color AXES_COL

ENERGY_COL

protected static java.awt.Color ENERGY_COL

FREE_COL

protected static java.awt.Color FREE_COL
Constructor Detail

KP

public KP()
Method Detail

init

public void init()
Description copied from class: BaseApplet2
Performs extra initialisation, including adding a panel to the bottom of the applet.
Overrides:
init in class BaseApplet2

updateInput

public void updateInput()
Reads in (and validates) input from the text fields.
Throws:
java.lang.IllegalArgumentException - if any input fields are invalid

validateInput

public void validateInput(double p,
                          double maxX)
Performs the validation for updateInput().

start

public void start()
Description copied from class: BaseApplet
Applets should use this method to perform any final initialisation necessary to "activate" the applet
Overrides:
start in class BaseApplet2

stop

public void stop()
Description copied from class: BaseApplet
When this method is called, the applet should cease any user interaction. In particular, any threads explicitly started should be stopped, any external resources should be closed. This method should negate the action of start().
Overrides:
stop in class BaseApplet2

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)
Description copied from class: BaseApplet
Subclasses should at least provide an empty implementation of this method.
Overrides:
actionPerformed in class BaseApplet

updateSolution

protected void updateSolution(int w,
                              int h)

setFolded

public void setFolded(boolean b)
Used to set whether or not the x-axis is "folded" onto itself.

doPaint

public void doPaint(java.awt.Graphics g)
Description copied from class: BaseApplet
Called by forcePaint() to actually perform the painting. Subclasses should implement this method as if it were the standard paint() method; buffering will then take place transparently.
Overrides:
doPaint in class BaseApplet
Tags copied from class: BaseApplet
Parameters:
g - The Graphics object on which to paint