CubeTwister 2.0alpha142 2012-02-11

ch.randelshofer.rubik
Class Cube6Geom3D

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

public class Cube6Geom3D
extends AbstractCube6Geom3D

Simplified geometrical representation of Cube6 in three dimensions.

The representation is simplified in the sense that all stickers of the cube are square. In a real physical representation, such as a V-Cube 6, the stickers on the edge parts need to be rectangular, and the stickers on the corner parts need to be larger than those on the center parts.

Version:
1.2 2010-04-04 Added swipe actions to edges adjacent to stickers.
1.1 2009-01-04 Added support for twisting the cube by swiping over its faces.
1.0 2008-08-17 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.AbstractCube6Geom3D
BEVEL_LENGTH, CORNER_EXPLODE_TRANSLATION, EDGE_EXPLODE_TRANSLATION, PART_LENGTH, SIDE_EXPLODE_TRANSLATION
 
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
 
Fields inherited from class ch.randelshofer.rubik.AbstractCube3D
attributes, changeEvent, dispatcher, isAnimated, layerCount, listenerList
 
Constructor Summary
Cube6Geom3D()
           
 
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)
           
 int getStickerCount()
           
protected  int getStickerIndexForPart(int part, int orientation)
           
protected  void initActions()
           
protected  void initCenter()
          The simple cube has no visible center because it can not be taken apart.
protected  void initCorners()
           
protected  void initEdges()
           
protected  void initSides()
           
protected  void updatePartsFillColor()
          Updates the fill color of the parts.
protected  void updatePartsOutlineColor()
          Updates the outline color of the parts.
 
Methods inherited from class ch.randelshofer.rubik.AbstractCube6Geom3D
computeTransformation, createCube, cubeTwisted, getUnitScaleFactor, initTransforms
 
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
 

Constructor Detail

Cube6Geom3D

public Cube6Geom3D()
Method Detail

initCorners

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

initEdges

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

initSides

protected void initSides()
Specified by:
initSides in class AbstractCubeGeom3D

initCenter

protected void initCenter()
The simple cube has no visible center because it can not be taken apart.

Specified by:
initCenter in class AbstractCubeGeom3D

initActions

protected void initActions()
Specified by:
initActions in class AbstractCubeGeom3D

getPartIndexForStickerIndex

public int getPartIndexForStickerIndex(int stickerIndex)
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

createAttributes

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

Specified by:
createAttributes 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

getKind

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


(c) Werner Randelshofer.
All rights reserved.