|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.javagl.swogl.interaction.MovingBehavior
public class MovingBehavior
This class allows moving 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,
MouseMotionListener and MouseWheelListener by calling the
main public methods accordingly:
startMovement(Point)
when the mouse is pressed to start a movement
doMovement(Point, int)
when the mouse is dragged or the mouse wheel is rotated
to move a SwoglComponent
Constructor Summary | |
---|---|
MovingBehavior(de.javagl.swogl.SwoglContainer swoglContainer)
Creates a new MovingBehavior for the given SwoglContainer. |
Method Summary | |
---|---|
void |
doMovement(java.awt.Point point,
int deltaZ)
Move the current SwoglComponent. |
void |
startMovement(java.awt.Point point)
Start the movement of a SwoglComponent. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MovingBehavior(de.javagl.swogl.SwoglContainer swoglContainer)
swoglContainer
- The SwoglContainer this behavior operates on
java.lang.NullPointerException
- if the given SwoglContainer
is null
Method Detail |
---|
public void startMovement(java.awt.Point point)
doMovement(Point, int)
will move
the SwoglComponent.
point
- The point where the movement should startpublic void doMovement(java.awt.Point point, int deltaZ)
startMovement(Point)
, then this
method does not have any effect. Otherwise, this method will
move the SwoglComponent so that the position where it was picked
will be at the position that is passed in as the argument, or
along the viewing Z-axis by the given amount.
point
- The point where the SwoglComponent should move todeltaZ
- The movement delta along the picking ray
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |