|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--java.awt.Panel
|
+--java.applet.Applet
|
+--BaseApplet
|
+--LatticeApplet
Applet to illustrate the idea of lattice vectors. Two draggable vectors are provided, and a "grid" of bases is drawn according to these base vectors.
The basis may be chosen from a list of simple geometric figures; to add to
these, override or edit makeBases() to add
the basis to the list, and override or edit
makeLabels() to supply a label for the basis. The
position in the array of the new label should match that of the new basis.
| Inner Class Summary | |
protected class |
LatticeApplet.VectorMoveListener
Listener to detect changes in the positions of the lattice vectors. |
| 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 java.awt.Label |
angle
|
protected Lattice2D.Basis[] |
bases
A list of all available bases |
protected java.awt.Checkbox[] |
boxes
A checkbox for each basis |
protected java.awt.CheckboxGroup |
cbg
Ensures that exactly one basis will be selected |
protected java.lang.String[] |
labels
Names for all available bases |
protected java.awt.Point |
lastPos
|
protected Lattice2D |
lattice
The lattice itself |
static double |
MIN_SPACING
The minimum modulus (in pixels) permitted for the lattice vectors. |
protected java.awt.Label |
mod1
|
protected java.awt.Label |
mod2
|
protected java.awt.Label |
ratio
|
protected Lattice2D |
reciprocal
The lattice itself |
protected java.awt.Panel |
rightPanel
Container to hold all the GUI components. |
protected LatticeApplet.VectorMoveListener |
vectorMoveListener
Listener for changes in the vectors. |
| 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 | |
LatticeApplet()
|
|
| Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent ae)
Subclasses should at least provide an empty implementation of this method. |
void |
addWithLabel(java.awt.Panel root,
java.awt.Component c,
java.lang.String label)
Helper method to add a component with a label. |
java.awt.Point |
chooseWindowPos(int w,
int h,
int wndW,
int wndH)
|
int |
displayWidth()
Calculates the width of the area available for the lattice display |
void |
doPaint(java.awt.Graphics g)
Called by forcePaint() to actually
perform the painting. |
void |
init()
Performs extra intialisation specific to this class |
Lattice2D.Basis[] |
makeBases(Lattice2D l)
Returns an array of all available bases. |
java.lang.String[] |
makeLabels()
Returns an array of labels for all available bases. |
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. |
protected java.lang.String |
toString(double d)
Helper method to format a double for display in a text
label. |
void |
updateLabels()
Updates the numerical information displayed to the right of the applet (vector lengths, length ratio, angle between vectors). |
void |
updateReciprocal()
|
| 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 |
|
| Methods inherited from class java.awt.Container |
add,
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,
setLayout,
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 |
protected java.awt.Point lastPos
protected Lattice2D lattice
protected Lattice2D reciprocal
protected LatticeApplet.VectorMoveListener vectorMoveListener
protected java.awt.Label angle
protected java.awt.Label mod1
protected java.awt.Label mod2
protected java.awt.Label ratio
protected java.lang.String[] labels
protected Lattice2D.Basis[] bases
protected java.awt.Checkbox[] boxes
protected java.awt.CheckboxGroup cbg
protected java.awt.Panel rightPanel
public static final double MIN_SPACING
(The one exception to this rule is that it is no longer to create the degnerate lattice which is collapsed onto zero dimensions. This lattice is produced if and only if v1 = v2 = 0.)
| Constructor Detail |
public LatticeApplet()
| Method Detail |
public void init()
public void addWithLabel(java.awt.Panel root,
java.awt.Component c,
java.lang.String label)
root - The Panel to which the component and label should
be addedc - The component to be addedlabel - The text label for the componentpublic void start()
public void stop()
start().public int displayWidth()
public void doPaint(java.awt.Graphics g)
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.g - The Graphics object on which to paint
public java.awt.Point chooseWindowPos(int w,
int h,
int wndW,
int wndH)
public void updateLabels()
protected java.lang.String toString(double d)
double for display in a text
label.public void actionPerformed(java.awt.event.ActionEvent ae)
public void updateReciprocal()
public java.lang.String[] makeLabels()
public Lattice2D.Basis[] makeBases(Lattice2D l)
|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||