ch.randelshofer.rubik
Class RubiksCubeGeom3D
java.lang.Object
ch.randelshofer.rubik.AbstractCube3D
ch.randelshofer.rubik.AbstractCubeGeom3D
ch.randelshofer.rubik.AbstractRubiksCubeGeom3D
ch.randelshofer.rubik.RubiksCubeGeom3D
- All Implemented Interfaces:
- Cube3D, CubeListener, java.beans.PropertyChangeListener, java.util.EventListener, javax.swing.event.ChangeListener
public class RubiksCubeGeom3D
- extends AbstractRubiksCubeGeom3D
Geometrical representation of a Rubik's Cube in
three dimensions.
- Version:
- 3.1 2010-04-03 Added swipe actions to edges adjacent to stickers.
8.0 2009-01-04 Added support for twisting the cube by swiping over
its faces.
7.0 2008-01-06 Adapted to changes in AbstractCube.
6.0 2005-03-06 Reworked.
1.0 2000-03-11 Created
- Author:
- Werner Randelshofer, Hausmatt 10, CH-6405 Immensee
| Fields inherited from class ch.randelshofer.rubik.AbstractCubeGeom3D |
centerCount, centerOffset, cornerCount, cornerOffset, edgeCount, edgeOffset, HALF_PI, identityTransforms, isInStartedPlayer, mode, partCount, PARTS_MODE, PI, scene, shapes, sideCount, sideOffset, transforms, TWIST_MODE |
| Methods inherited from class ch.randelshofer.rubik.AbstractCubeGeom3D |
getPart, getPartCount, getScene, init, isInStartedPlayer, setInStartedPlayer, setMode, setStickerBeveling, updateAlphaBeta, updateAttributes, updateCube, updateExplosionFactor, updatePartsVisibility, updatePartVisibility, updateScaleFactor, updateStickersFillColor, updateStickersImage, updateStickerVisibility, validateTwist |
| Methods inherited from class ch.randelshofer.rubik.AbstractCube3D |
addChangeListener, addCube3DListener, cubeChanged, dispatch, dispose, fireActionPerformed, fireMouseEntered, fireMouseExited, fireMousePressed, fireMouseReleased, fireStateChanged, getAnimator, getAttributes, getCube, getDispatcher, getLock, isAdjusting, isAnimated, isAnimating, isShowGhostParts, propertyChange, removeChangeListener, removeCube3DListener, setAnimated, setAnimator, setAttributes, setCube, setDispatcher, setLock, setShowGhostParts, stateChanged, stopAnimation |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RubiksCubeGeom3D
public RubiksCubeGeom3D()
getPartIndexForStickerIndex
public int getPartIndexForStickerIndex(int stickerIndex)
- Gets the part which holds the indicated sticker.
The sticker index is interpreted according to this
scheme:
+---+---+---+
| 9 | 10| 11|
+---+---+---+
| 12| 13| 14|
+---+---+---+
| 15| 16| 17|
+---+---+---+---+---+---+---+---+---+---+---+---+
| 27| 28| 29| 18| 19| 20| 0 | 1 | 2 | 45| 46| 47|
+---+---+---+---+---+---+---+---+---+---+---+---+
| 30| 31| 32| 21| 22| 23| 3 | 4 | 5 | 48| 49| 50|
+---+---+---+---+---+---+---+---+---+---+---+---+
| 33| 34| 35| 24| 25| 26| 6 | 7 | 8 | 51| 52| 53|
+---+---+---+---+---+---+---+---+---+---+---+---+
| 36| 37| 38|
+---+---+---+
| 39| 40| 41|
+---+---+---+
| 42| 43| 44|
+---+---+---+
- Specified by:
getPartIndexForStickerIndex in interface Cube3D- Specified by:
getPartIndexForStickerIndex in class AbstractCube3D
getPartFaceIndexForStickerIndex
protected int getPartFaceIndexForStickerIndex(int stickerIndex)
- Specified by:
getPartFaceIndexForStickerIndex in class AbstractCube3D
getStickerIndexForPart
protected int getStickerIndexForPart(int part,
int orientation)
getStickerCount
public int getStickerCount()
- Specified by:
getStickerCount in class AbstractCube3D
updatePartsOutlineColor
protected void updatePartsOutlineColor()
- Updates the outline color of the parts.
- Specified by:
updatePartsOutlineColor in class AbstractCubeGeom3D
updatePartsFillColor
protected final void updatePartsFillColor()
- Updates the fill color of the parts.
- Specified by:
updatePartsFillColor in class AbstractCubeGeom3D
createAttributes
public CubeAttributes createAttributes()
- Description copied from class:
AbstractCube3D
- Creates cube attributes (e.g. colors, sticker pictures, ...).
- Specified by:
createAttributes in class AbstractCube3D
getName
public java.lang.String getName()
initCorners
protected void initCorners()
- Specified by:
initCorners in class AbstractCubeGeom3D
initEdges
protected void initEdges()
- Specified by:
initEdges in class AbstractCubeGeom3D
getKind
public CubeKind getKind()
- Description copied from interface:
Cube3D
- Gets the kind of the cube.
initActions
protected void initActions()
- Specified by:
initActions in class AbstractCubeGeom3D