de.javagl.swogl.interaction
Interface Control

All Known Implementing Classes:
ArcballCameraControl, BrowseLayoutControl, GridLayoutControl, MagnifyingGlassControl, SpaceInteractionControl, WheelLayoutControl

public interface Control

This interface describes a control that may be attached to or detached from a component. A control usually summarizes a set of listeners or input actions. A control may be enabled or disabled, offering the possibility to switch between different control modes.


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
 

Method Detail

attachTo

void attachTo(javax.swing.JComponent component)
Attach this control to the given component. This usually will attach the listeners that are associated with this control to the given component. In order to properly remove the listeners when the control is no longer used, the detachFrom(JComponent) method has to be called.

Parameters:
component - The component to attach to

detachFrom

void detachFrom(javax.swing.JComponent component)
Detach this control from the given component. This will remove all listeners from the component that have been added when attachTo(JComponent) was called.

Parameters:
component - The component to detach from

setEnabled

void setEnabled(boolean enabled)
Enable or disable this control

Parameters:
enabled - Whether this control is enabled

isEnabled

boolean isEnabled()
Returns whether this control is enabled

Returns:
Whether this control is enabled