de.javagl.swogl.interaction
Class SpaceInteractionControl

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

public class SpaceInteractionControl
extends java.lang.Object
implements 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(SwoglContainer swoglContainer)
          Creates a new space interaction control for the given SwoglContainer.
 
Method Summary
 void attachTo(javax.swing.JComponent component)
          Attach this control to the given component
 void detachFrom(javax.swing.JComponent component)
          Detach this control from the given component
 boolean isEnabled()
          Returns whether this control is enabled
 void setEnabled(boolean enabled)
          Enable or disable this control
 void setMovingCondition(Condition<java.awt.event.MouseEvent> movingCondition)
          Set the condition for passing events to the MovingBehavior
 void setRotatingCondition(Condition<java.awt.event.MouseEvent> rotatingCondition)
          Set the condition for passing events to the RotatingBehavior
 void setScalingCondition(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(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(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(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(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)
Description copied from interface: Control
Attach this control to the given component

Specified by:
attachTo in interface Control
Parameters:
component - The component to attach to

detachFrom

public void detachFrom(javax.swing.JComponent component)
Description copied from interface: Control
Detach this control from the given component

Specified by:
detachFrom in interface Control
Parameters:
component - The component to detach from

setEnabled

public void setEnabled(boolean enabled)
Description copied from interface: Control
Enable or disable this control

Specified by:
setEnabled in interface Control
Parameters:
enabled - Whether this control is enabled

isEnabled

public boolean isEnabled()
Description copied from interface: Control
Returns whether this control is enabled

Specified by:
isEnabled in interface Control
Returns:
Whether this control is enabled