CubeTwister 2.0alpha142 2012-02-11

ch.randelshofer.rubik
Class RubiksDiamondIdx3D

java.lang.Object
  extended by ch.randelshofer.rubik.AbstractCube3D
      extended by ch.randelshofer.rubik.AbstractCubeIdx3D
          extended by ch.randelshofer.rubik.AbstractRubiksCubeIdx3D
              extended by ch.randelshofer.rubik.RubiksDiamondIdx3D
All Implemented Interfaces:
Cube3D, CubeListener, java.beans.PropertyChangeListener, java.util.EventListener, javax.swing.event.ChangeListener

public class RubiksDiamondIdx3D
extends AbstractRubiksCubeIdx3D

RubiksDiamondIdx3D.

Version:
3.0 2009-01-02 Added support for twisting the cube by swiping over its faces.
2.0 2008-01-03 Adapted to changes in AbstractCube.
1.0 December 26, 2003 Created.
Author:
Werner Randelshofer

Nested Class Summary
 
Nested classes/interfaces inherited from class ch.randelshofer.rubik.AbstractCube3D
AbstractCube3D.PartAction, AbstractCube3D.SwipeAction
 
Field Summary
 
Fields inherited from class ch.randelshofer.rubik.AbstractRubiksCubeIdx3D
PART_LENGTH
 
Fields inherited from class ch.randelshofer.rubik.AbstractCubeIdx3D
alphaBetaTransform, cachedStickersImage, centerCount, centerOffset, cornerCount, cornerOffset, edgeCount, edgeOffset, explosion, explosionShift, explosionTransforms, HALF_PI, identityNormalMatrix, identityVertexMatrix, isInStartedPlayer, locationTransforms, partCount, parts, PI, scaleTransform, scene, sharedLightmap, sideCount, sideOffset, stickersTexture
 
Fields inherited from class ch.randelshofer.rubik.AbstractCube3D
attributes, changeEvent, dispatcher, isAnimated, layerCount, listenerList
 
Constructor Summary
RubiksDiamondIdx3D()
          Creates a new instance.
 
Method Summary
protected  CubeAttributes createAttributes()
          Creates cube attributes (e.g.
 CubeKind getKind()
          Gets the kind of the cube.
protected  int getPartFaceIndexForStickerIndex(int stickerIndex)
           
 int getPartIndexForStickerIndex(int stickerIndex)
          Gets the part which holds the indicated sticker.
 int getStickerCount()
           
protected  int getStickerIndexForPart(int part, int orientation)
           
protected  float getUnitScaleFactor()
           
protected  void initActions(idx3d_Scene scene)
           
protected  void initCorners()
           
protected  void initEdges()
           
protected  void initSides()
          Initializes the side parts.
 void setStickerBeveling(float newValue)
           
 
Methods inherited from class ch.randelshofer.rubik.AbstractRubiksCubeIdx3D
cubeTwisted, init, initCenter, initTransforms, validateTwist
 
Methods inherited from class ch.randelshofer.rubik.AbstractCubeIdx3D
dispose, getLock, getPart, getPartCount, getScene, isInStartedPlayer, setInStartedPlayer, updateAlphaBeta, updateAttributes, updateCube, updateExplosionFactor, updateExplosionFactor, updatePartFillColor, updatePartOutlineColor, updatePartsFillColor, updatePartsVisibility, updatePartVisibility, updateScaleFactor, updateScaleFactor, updateStickerFillColor, updateStickersFillColor, updateStickersImage, updateStickerVisibility, validateAlphaBeta, validateAttributes, validateCube, validateScaleFactor, validateStickersImage
 
Methods inherited from class ch.randelshofer.rubik.AbstractCube3D
addChangeListener, addCube3DListener, cubeChanged, dispatch, fireActionPerformed, fireMouseEntered, fireMouseExited, fireMousePressed, fireMouseReleased, fireStateChanged, getAnimator, getAttributes, getCube, getDispatcher, 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
 

Constructor Detail

RubiksDiamondIdx3D

public RubiksDiamondIdx3D()
Creates a new instance.

Method Detail

getUnitScaleFactor

protected float getUnitScaleFactor()
Overrides:
getUnitScaleFactor in class AbstractRubiksCubeIdx3D

initCorners

protected void initCorners()
Specified by:
initCorners in class AbstractRubiksCubeIdx3D

initEdges

protected void initEdges()
Specified by:
initEdges in class AbstractRubiksCubeIdx3D

initSides

protected void initSides()
Initializes the side parts.

Specified by:
initSides in class AbstractRubiksCubeIdx3D

createAttributes

protected CubeAttributes createAttributes()
Description copied from class: AbstractCube3D
Creates cube attributes (e.g. colors, sticker pictures, ...).

Specified by:
createAttributes in class AbstractCube3D

getStickerCount

public int getStickerCount()
Specified by:
getStickerCount in class AbstractRubiksCubeIdx3D

getPartIndexForStickerIndex

public int getPartIndexForStickerIndex(int stickerIndex)
Gets the part which holds the indicated sticker. The sticker index is interpreted according to this scheme:
                     +---+
                     | 25|
         /\ +---+ /\ +---+ /\ +---+ /\ +---+
        /15\| 18|/21\| 0 |/ 3\| 6 |/ 9\| 12| 
       +----+---+----+---+----+---+----+---+
       | 16 | 19| 22 | 1 |  4 | 7 | 10 | 13| 
       +----+---+----+---+----+---+----+---+
        \17/| 20|\23/| 2 |\ 5/| 8 |\11/| 14| 
         \/ +---+ \/ +---+ \/ +---+ \/ +---+
                     | 24|
                     +---+
 

Specified by:
getPartIndexForStickerIndex in interface Cube3D
Specified by:
getPartIndexForStickerIndex in class AbstractRubiksCubeIdx3D

getPartFaceIndexForStickerIndex

protected int getPartFaceIndexForStickerIndex(int stickerIndex)
Specified by:
getPartFaceIndexForStickerIndex in class AbstractRubiksCubeIdx3D

getStickerIndexForPart

protected int getStickerIndexForPart(int part,
                                     int orientation)
Specified by:
getStickerIndexForPart in class AbstractRubiksCubeIdx3D

initActions

protected void initActions(idx3d_Scene scene)
Specified by:
initActions in class AbstractCubeIdx3D

setStickerBeveling

public void setStickerBeveling(float newValue)
Specified by:
setStickerBeveling in interface Cube3D
Specified by:
setStickerBeveling in class AbstractCubeIdx3D

getKind

public CubeKind getKind()
Description copied from interface: Cube3D
Gets the kind of the cube.


(c) Werner Randelshofer.
All rights reserved.