|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.javagl.swogl.interaction.RotatingBehavior
public class RotatingBehavior
This class allows rotating the SwoglComponents
of a SwoglContainer
in space. It may be used for the cases
where the SwoglContainer has no layout manager.
Usually this class will be controlled by a MouseListener,
and MouseWheelListener by calling the main public methods
accordingly:
startRotation(Point)
when the mouse is pressed to start a rotation
doRotation(Point)
when the mouse is dragged to rotate a SwoglComponent
Constructor Summary | |
---|---|
RotatingBehavior(de.javagl.swogl.SwoglContainer swoglContainer)
Creates a new RotatingBehavior for the given SwoglContainer . |
Method Summary | |
---|---|
void |
doRotation(java.awt.Point point)
Rotate the current SwoglComponent . |
void |
setRotationSpeed(float rotationSpeed)
Set the rotation speed factor for this behavior. |
void |
startRotation(java.awt.Point point)
Start the rotation of a SwoglComponent . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RotatingBehavior(de.javagl.swogl.SwoglContainer swoglContainer)
SwoglContainer
.
The rotation speed
will be 0.5.
swoglContainer
- The SwoglContainer this behavior operates on
java.lang.NullPointerException
- if the given SwoglContainer
is null
Method Detail |
---|
public void startRotation(java.awt.Point point)
SwoglComponent
. If a SwoglComponent
is found inside the SwoglContainer at the given point, then
subsequent calls to doRotation(Point)
will rotate
the SwoglComponent.
point
- The point where the rotation should start
java.lang.NullPointerException
- if the given point
is null
public void doRotation(java.awt.Point point)
SwoglComponent
. If no SwoglComponent was
hit by the previous call to startRotation(Point)
, then this
method does not have any visible effect. Otherwise, this method will
rotate the SwoglComponent depending on the difference between
the given point and the previous point.
point
- The current point
java.lang.NullPointerException
- if the given point
is null
public void setRotationSpeed(float rotationSpeed)
rotationSpeed
- The rotation speed factor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |