|
CubeTwister 2.0alpha142 2012-02-11 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Panel
java.applet.Applet
javax.swing.JApplet
ch.randelshofer.rubik.player.AbstractPlayerApplet
public abstract class AbstractPlayerApplet
This is the base class for Applets featuring a Rubik's Cube like puzzle which can play back scripts.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JApplet |
|---|
javax.swing.JApplet.AccessibleJApplet |
| Nested classes/interfaces inherited from class java.applet.Applet |
|---|
java.applet.Applet.AccessibleApplet |
| 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 | |
|---|---|
protected Cube3DCanvas |
frontCanvas
|
protected boolean |
isRearViewVisible
|
protected CubeMarkupNotation |
notation
|
protected ScriptPlayer |
player
|
protected Cube3DCanvas |
rearCanvas
|
| Fields inherited from class javax.swing.JApplet |
|---|
accessibleContext, rootPane, rootPaneCheckingEnabled |
| 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 | |
|---|---|
AbstractPlayerApplet()
|
|
| Method Summary | |
|---|---|
protected void |
configurePlayer(ScriptPlayer p)
|
protected abstract ScriptPlayer |
createPlayer()
|
protected Cube3DCanvas |
createRearCanvas()
|
protected java.awt.Image |
decodeBase64Image(java.lang.String base64)
|
void |
destroy()
|
java.lang.String[][] |
getAPIInfo()
Returns information about the JavaScript API supported by this applet. |
java.lang.String |
getAppletCopyright()
|
java.lang.String |
getAppletInfo()
Returns version and copyright information. |
java.lang.String |
getAppletName()
|
protected java.lang.String |
getAppletVersion()
|
protected Cube |
getCube()
|
int |
getCurrentPosition()
JavaScript API: Gets the current position of the playhead. |
int |
getEndPosition()
JavaScript API: Gets the start position of the playhead. |
protected abstract int |
getLayerCount()
|
java.lang.String |
getParameter(java.lang.String name)
|
java.lang.String[][] |
getParameterInfo()
Returns information about the parameters supported by this applet. |
java.lang.String |
getPermutation()
JavaScript API: Gets the current permutation of the cube. |
protected java.io.InputStream |
getPlayerResources()
Returns the Default XML Resource Data of this Applet as an Input Stream. |
java.lang.String |
getScript()
JavaScript API: Gets a script. |
java.lang.String |
getScriptType()
JavaScript API: Gets the script type. |
int |
getStartPosition()
JavaScript API: Gets the end position of the playhead. |
void |
init()
Initializes the applet. |
boolean |
isPlaying()
JavaScript API: Returns true, if a script is currently being played. |
static void |
main(AbstractPlayerApplet applet,
java.lang.String[] args)
|
void |
pause()
JavaScript API: Pauses playback of a script. |
void |
play()
JavaScript API: Starts/continues playback of a script. |
protected void |
printWarning(java.lang.String message)
|
protected void |
readCubeAttributes(nanoxml.XMLElement resources,
CubeKind kind,
DefaultCubeAttributes attr)
Reads cube attributes from the specified XML Element. |
protected void |
readParameters()
|
void |
reset()
JavaScript API: Pauses playback, moves playback position to the beginning of a script and resets the cube. |
void |
resetCube()
JavaScript API: Resets the cube. |
void |
run()
This method is public due to a side effect of the implementation. |
protected void |
selectCurrentSymbol()
|
void |
setCurrentPosition(int newValue)
JavaScript API: Sets the current position of the playhead. |
void |
setPermutation(java.lang.String newValue)
JavaScript API: Sets the current permutation of the cube. |
protected void |
setRearViewVisible(boolean newValue)
|
void |
setScript(java.lang.String newValue)
JavaScript API: Sets a script. |
void |
setScriptType(java.lang.String newValue)
JavaScript API: Sets the script type. |
protected void |
setSettingsPanelVisible(boolean b)
|
void |
stop()
Stops all background threads. |
protected void |
updateInfo()
|
| Methods inherited from class javax.swing.JApplet |
|---|
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update |
| Methods inherited from class java.applet.Applet |
|---|
getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start |
| Methods inherited from class java.awt.Panel |
|---|
addNotify |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, 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, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, 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, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, 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 |
| Field Detail |
|---|
protected ScriptPlayer player
protected Cube3DCanvas frontCanvas
protected Cube3DCanvas rearCanvas
protected CubeMarkupNotation notation
protected boolean isRearViewVisible
| Constructor Detail |
|---|
public AbstractPlayerApplet()
| Method Detail |
|---|
public void init()
init in class java.applet.Appletpublic void stop()
stop in class java.applet.Appletpublic void destroy()
destroy in class java.applet.Applet
public static void main(AbstractPlayerApplet applet,
java.lang.String[] args)
protected java.lang.String getAppletVersion()
protected abstract ScriptPlayer createPlayer()
protected abstract int getLayerCount()
protected Cube3DCanvas createRearCanvas()
protected void configurePlayer(ScriptPlayer p)
public void run()
Initialises the applet. This is done on a background thread, because it may take a while.
run in interface java.lang.Runnableinit()protected void setSettingsPanelVisible(boolean b)
protected void setRearViewVisible(boolean newValue)
protected void selectCurrentSymbol()
protected Cube getCube()
protected void printWarning(java.lang.String message)
protected void readParameters()
throws AppletParameterException
AppletParameterExceptionprotected java.io.InputStream getPlayerResources()
public java.lang.String getAppletInfo()
getAppletInfo in class java.applet.Appletpublic java.lang.String getAppletCopyright()
public java.lang.String getAppletName()
protected void readCubeAttributes(nanoxml.XMLElement resources,
CubeKind kind,
DefaultCubeAttributes attr)
resources - The XML element which holds the attribute data.attr - The CubeAttributes onto which we store the attribute values.protected java.awt.Image decodeBase64Image(java.lang.String base64)
public java.lang.String getParameter(java.lang.String name)
getParameter in class java.applet.Appletpublic java.lang.String[][] getParameterInfo()
getParameterInfo in class java.applet.Appletpublic java.lang.String[][] getAPIInfo()
protected void updateInfo()
public void play()
public void pause()
public boolean isPlaying()
public void reset()
public void resetCube()
public void setScript(java.lang.String newValue)
public java.lang.String getScript()
public void setScriptType(java.lang.String newValue)
public java.lang.String getScriptType()
public java.lang.String getPermutation()
public void setPermutation(java.lang.String newValue)
public int getCurrentPosition()
public void setCurrentPosition(int newValue)
public int getEndPosition()
public int getStartPosition()
|
(c) Werner Randelshofer. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||