CubeTwister 2.0alpha142 2012-02-11

ch.randelshofer.rubik
Class Cube3DEvent

java.lang.Object
  extended by java.util.EventObject
      extended by ch.randelshofer.rubik.Cube3DEvent
All Implemented Interfaces:
java.io.Serializable

public class Cube3DEvent
extends java.util.EventObject

Cube3DEvent is used to notify interested parties that an event has occured in a Cube3D object.

Version:
3.2 2010-08-14 Added methods getCube(), getLayerMask(), getAxis(), getAngle().
3.1 2009-01-19 Treat CTRL_DOWN_MASK like META_DOWN_MASK - except on Mac OS X.
3.0 2009-01-14 Use MouseEvent.modifiersEx instead of modifiersEx. Re-implemented support for modifier keys.
2.0 2007-08-28 Forward mouse event instead of just the mouseEvent.
1.0 December 22, 2003 Created.
Author:
Werner Randelshofer
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
Cube3DEvent(Cube3D source, int partIndex, int orientation, int sideIndex, int stickerIndex, int modifiersEx)
          Creates a new instance.
Cube3DEvent(Cube3D source, int partIndex, int orientation, int sideIndex, int stickerIndex, int scraping, int modifiersEx)
           
Cube3DEvent(Cube3D source, int partIndex, int orientation, int sideIndex, int stickerIndex, int scraping, java.awt.event.MouseEvent mouseEvent)
           
Cube3DEvent(Cube3D source, int partIndex, int orientation, int sideIndex, int stickerIndex, java.awt.event.MouseEvent mouseEvent)
          Creates a new instance.
 
Method Summary
 void applyTo(Cube cube)
          Applies this event to the specified cube.
 int getAngle()
           
 int getAxis()
           
 Cube getCube()
           
 Cube3D getCube3D()
           
 int getLayerMask()
           
 int getModifiersEx()
          The extended modifiers.
 java.awt.event.MouseEvent getMouseEvent()
          The mouse event.
 int getOrientation()
          The orientation of the face on the part.
 int getPartIndex()
          The index of the cube part.
 int getSideIndex()
          The side of the cube.
 int getStickerIndex()
          The sticker index or -1 if there is no sticker on the face of the part where the mouse event occured.
 boolean isDoubleAngle()
           
 boolean isDoubleLayer()
           
 boolean isInverse()
           
 java.lang.String toString()
           
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Cube3DEvent

public Cube3DEvent(Cube3D source,
                   int partIndex,
                   int orientation,
                   int sideIndex,
                   int stickerIndex,
                   java.awt.event.MouseEvent mouseEvent)
Creates a new instance.


Cube3DEvent

public Cube3DEvent(Cube3D source,
                   int partIndex,
                   int orientation,
                   int sideIndex,
                   int stickerIndex,
                   int scraping,
                   java.awt.event.MouseEvent mouseEvent)

Cube3DEvent

public Cube3DEvent(Cube3D source,
                   int partIndex,
                   int orientation,
                   int sideIndex,
                   int stickerIndex,
                   int modifiersEx)
Creates a new instance.


Cube3DEvent

public Cube3DEvent(Cube3D source,
                   int partIndex,
                   int orientation,
                   int sideIndex,
                   int stickerIndex,
                   int scraping,
                   int modifiersEx)
Method Detail

getCube3D

public Cube3D getCube3D()

getCube

public Cube getCube()

isInverse

public boolean isInverse()

isDoubleAngle

public boolean isDoubleAngle()

isDoubleLayer

public boolean isDoubleLayer()

getAxis

public int getAxis()

getLayerMask

public int getLayerMask()

getAngle

public int getAngle()

applyTo

public void applyTo(Cube cube)
Applies this event to the specified cube. If the event does not represent a cube transformation, nothing happens.


getPartIndex

public int getPartIndex()
The index of the cube part. Values 0..7 are corners, 8..19 edges, 20..25 sides, 26 center.


getOrientation

public int getOrientation()
The orientation of the face on the part. -1 if not applicable.


getSideIndex

public int getSideIndex()
The side of the cube. Values 0..5 = Front, Right, Bottom, Back, Left, Top. Or -1 if the side can not be determined.


getStickerIndex

public int getStickerIndex()
The sticker index or -1 if there is no sticker on the face of the part where the mouse event occured.


getModifiersEx

public int getModifiersEx()
The extended modifiers.


getMouseEvent

public java.awt.event.MouseEvent getMouseEvent()
The mouse event. This method returns null, when the event has been fired due to an action event.


toString

public java.lang.String toString()
Overrides:
toString in class java.util.EventObject

(c) Werner Randelshofer.
All rights reserved.