de.javagl.swogl.interaction
Class SpaceInteractionControl

java.lang.Object
  extended by de.javagl.swogl.interaction.SpaceInteractionControl
All Implemented Interfaces:
de.javagl.swogl.interaction.Control

public class SpaceInteractionControl
extends java.lang.Object
implements de.javagl.swogl.interaction.Control

Implementation of a Control that allows manipulating SwoglComponents inside a SwoglContainer. It combines a RotatingBehavior, a MovingBehavior and a ScalingBehavior and allows activating them based on Conditions that may be set for the incoming mouse events.


Constructor Summary
SpaceInteractionControl(de.javagl.swogl.SwoglContainer swoglContainer)
          Creates a new space interaction control for the given SwoglContainer.
 
Method Summary
 void attachTo(javax.swing.JComponent component)
           
 void detachFrom(javax.swing.JComponent component)
           
 boolean isEnabled()
           
 void setEnabled(boolean enabled)
           
 void setMovingCondition(de.javagl.swogl.Condition<java.awt.event.MouseEvent> movingCondition)
          Set the condition for passing events to the MovingBehavior
 void setRotatingCondition(de.javagl.swogl.Condition<java.awt.event.MouseEvent> rotatingCondition)
          Set the condition for passing events to the RotatingBehavior
 void setScalingCondition(de.javagl.swogl.Condition<java.awt.event.MouseEvent> scalingCondition)
          Set the condition for passing events to the ScalingBehavior
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpaceInteractionControl

public SpaceInteractionControl(de.javagl.swogl.SwoglContainer swoglContainer)
Creates a new space interaction control for the given SwoglContainer. The default conditions for the behaviors will be The mouse wheel will move the SwoglComponents along the Z-axis

Parameters:
swoglContainer - The SwoglContainer to operate on
Method Detail

setRotatingCondition

public void setRotatingCondition(de.javagl.swogl.Condition<java.awt.event.MouseEvent> rotatingCondition)
Set the condition for passing events to the RotatingBehavior

Parameters:
rotatingCondition - The rotating condition to set

setScalingCondition

public void setScalingCondition(de.javagl.swogl.Condition<java.awt.event.MouseEvent> scalingCondition)
Set the condition for passing events to the ScalingBehavior

Parameters:
scalingCondition - The scaling condition to set

setMovingCondition

public void setMovingCondition(de.javagl.swogl.Condition<java.awt.event.MouseEvent> movingCondition)
Set the condition for passing events to the MovingBehavior

Parameters:
movingCondition - The moving condition to set

attachTo

public void attachTo(javax.swing.JComponent component)
Specified by:
attachTo in interface de.javagl.swogl.interaction.Control

detachFrom

public void detachFrom(javax.swing.JComponent component)
Specified by:
detachFrom in interface de.javagl.swogl.interaction.Control

setEnabled

public void setEnabled(boolean enabled)
Specified by:
setEnabled in interface de.javagl.swogl.interaction.Control

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface de.javagl.swogl.interaction.Control