|
CubeTwister 2.0alpha141 2011-10-13 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectch.randelshofer.rubik.AbstractCube3D
public abstract class AbstractCube3D
Abstract base class for classes which implement the Cube3D
interface.
| Nested Class Summary | |
|---|---|
protected class |
AbstractCube3D.PartAction
This action is used to forward user actions on the cube parts to Cube3DListeners. |
protected class |
AbstractCube3D.SwipeAction
|
| Field Summary | |
|---|---|
protected CubeAttributes |
attributes
|
protected javax.swing.event.ChangeEvent |
changeEvent
|
protected Dispatcher |
dispatcher
|
protected boolean |
isAnimated
|
protected int |
layerCount
|
protected javax.swing.event.EventListenerList |
listenerList
|
| Constructor Summary | |
|---|---|
AbstractCube3D(int layerCount)
Creates a new instance. |
|
| Method Summary | |
|---|---|
void |
addChangeListener(javax.swing.event.ChangeListener listener)
Adds a change listener. |
void |
addCube3DListener(Cube3DListener listener)
|
protected abstract CubeAttributes |
createAttributes()
Creates cube attributes (e.g. |
void |
cubeChanged(CubeEvent evt)
|
void |
cubeTwisted(CubeEvent evt)
|
void |
dispatch(org.mmonte.media.Interpolator interpolator)
|
void |
dispose()
|
protected void |
fireActionPerformed(Cube3DEvent event)
Notify all listeners that have registered interest for notification on this event type. |
protected void |
fireMouseEntered(Cube3DEvent event)
Notify all listeners that have registered interest for notification on this event type. |
protected void |
fireMouseExited(Cube3DEvent event)
Notify all listeners that have registered interest for notification on this event type. |
protected void |
fireMousePressed(Cube3DEvent event)
Notify all listeners that have registered interest for notification on this event type. |
protected void |
fireMouseReleased(Cube3DEvent event)
Notify all listeners that have registered interest for notification on this event type. |
protected void |
fireStateChanged()
Notify all listeners that have registered interest for notification on this event type. |
org.mmonte.media.Animator |
getAnimator()
|
CubeAttributes |
getAttributes()
Gets cube attributees. |
Cube |
getCube()
Gets the underlying permutation model. |
Dispatcher |
getDispatcher()
Gets the dispatcher used to process animations of the 3D geometry. |
java.lang.Object |
getLock()
Returns the lock object used for synchronizing model and view changes. |
protected abstract int |
getPartFaceIndexForStickerIndex(int stickerIndex)
|
abstract int |
getPartIndexForStickerIndex(int stickerIndex)
|
abstract java.lang.Object |
getScene()
Returns the 3D scene of the cube. |
protected abstract int |
getStickerCount()
|
protected boolean |
isAdjusting()
|
boolean |
isAnimated()
Returns true when the 3D geometry animates permutation changes. |
boolean |
isAnimating()
Returns true if the cube is currently performing an animation. |
boolean |
isShowGhostParts()
|
void |
propertyChange(java.beans.PropertyChangeEvent evt)
|
void |
removeChangeListener(javax.swing.event.ChangeListener listener)
Removes a change listener. |
void |
removeCube3DListener(Cube3DListener listener)
|
void |
setAnimated(boolean b)
Sets whether changes in the permutation model shall cause an animated (multi-frame) change in the 3D geometry or whether they shall be reflected immediately. |
void |
setAnimator(org.mmonte.media.Animator newValue)
|
void |
setAttributes(CubeAttributes attributes)
Sets cube attributees. |
void |
setCube(Cube cube)
Sets the underlying permutation model. |
void |
setDispatcher(Dispatcher dispatcher)
Sets the dispatcher used to process animations of the 3D geometry. |
void |
setLock(java.lang.Object o)
Sets the lock object used for synchronizing model and view changes. |
void |
setShowGhostParts(boolean b)
|
void |
stateChanged(javax.swing.event.ChangeEvent event)
|
void |
stopAnimation()
Stops all currently running animations. |
protected abstract void |
updateAlphaBeta()
|
protected abstract void |
updateAttributes()
|
protected abstract void |
updateCube()
|
protected abstract void |
updateExplosionFactor(float factor)
|
protected abstract void |
updatePartVisibility(int index,
float alpha)
Updates the fill color of a part. |
protected abstract void |
updateScaleFactor(float factor)
|
protected abstract void |
updateStickersImage()
Updates the sticker imagery. |
protected abstract void |
updateStickerVisibility(int index,
float alpha)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface ch.randelshofer.rubik.Cube3D |
|---|
getKind, getPartCount, isInStartedPlayer, setInStartedPlayer, setStickerBeveling |
| Field Detail |
|---|
protected javax.swing.event.EventListenerList listenerList
protected javax.swing.event.ChangeEvent changeEvent
protected CubeAttributes attributes
protected boolean isAnimated
protected Dispatcher dispatcher
protected int layerCount
| Constructor Detail |
|---|
public AbstractCube3D(int layerCount)
| Method Detail |
|---|
public abstract java.lang.Object getScene()
getScene in interface Cube3Dpublic java.lang.Object getLock()
getLock in interface Cube3Dpublic void setLock(java.lang.Object o)
setLock in interface Cube3Dpublic void setDispatcher(Dispatcher dispatcher)
setDispatcher in interface Cube3Dpublic Dispatcher getDispatcher()
getDispatcher in interface Cube3Dprotected abstract void updateStickersImage()
public void setAnimated(boolean b)
setAnimated in interface Cube3Dpublic void setAnimator(org.mmonte.media.Animator newValue)
setAnimator in interface Cube3Dpublic org.mmonte.media.Animator getAnimator()
getAnimator in interface Cube3Dpublic boolean isAnimated()
isAnimated in interface Cube3Dprotected boolean isAdjusting()
public void stopAnimation()
stopAnimation in interface Cube3Dpublic void setCube(Cube cube)
setCube in interface Cube3Dpublic Cube getCube()
getCube in interface Cube3Dprotected abstract CubeAttributes createAttributes()
public void setAttributes(CubeAttributes attributes)
setAttributes in interface Cube3Dpublic CubeAttributes getAttributes()
getAttributes in interface Cube3Dprotected abstract int getStickerCount()
public abstract int getPartIndexForStickerIndex(int stickerIndex)
getPartIndexForStickerIndex in interface Cube3Dprotected abstract int getPartFaceIndexForStickerIndex(int stickerIndex)
public void addChangeListener(javax.swing.event.ChangeListener listener)
addChangeListener in interface Cube3Dpublic void removeChangeListener(javax.swing.event.ChangeListener listener)
removeChangeListener in interface Cube3D
protected abstract void updatePartVisibility(int index,
float alpha)
protected abstract void updateStickerVisibility(int index,
float alpha)
protected abstract void updateExplosionFactor(float factor)
protected abstract void updateScaleFactor(float factor)
public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange in interface java.beans.PropertyChangeListenerpublic void cubeChanged(CubeEvent evt)
cubeChanged in interface CubeListenerpublic void cubeTwisted(CubeEvent evt)
cubeTwisted in interface CubeListenerpublic void dispatch(org.mmonte.media.Interpolator interpolator)
protected abstract void updateAttributes()
protected abstract void updateCube()
protected abstract void updateAlphaBeta()
protected void fireStateChanged()
protected void fireActionPerformed(Cube3DEvent event)
protected void fireMouseEntered(Cube3DEvent event)
protected void fireMouseExited(Cube3DEvent event)
protected void fireMousePressed(Cube3DEvent event)
protected void fireMouseReleased(Cube3DEvent event)
public void addCube3DListener(Cube3DListener listener)
addCube3DListener in interface Cube3Dpublic void removeCube3DListener(Cube3DListener listener)
removeCube3DListener in interface Cube3Dpublic boolean isAnimating()
Cube3D
isAnimating in interface Cube3Dpublic void stateChanged(javax.swing.event.ChangeEvent event)
stateChanged in interface javax.swing.event.ChangeListenerpublic boolean isShowGhostParts()
isShowGhostParts in interface Cube3Dpublic void setShowGhostParts(boolean b)
setShowGhostParts in interface Cube3Dpublic void dispose()
dispose in interface Cube3D
|
(c) Werner Randelshofer. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||