de.javagl.swogl.interaction
Class MagnifyingGlassControl

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

public class MagnifyingGlassControl
extends java.lang.Object
implements Control

Implementation of a default Control for a MagnifyingGlass.


Constructor Summary
MagnifyingGlassControl(de.javagl.swogl.SwoglContainer swoglContainer, de.javagl.swogl.SwoglComponent swoglComponent, de.javagl.swogl.geometry.SimpleGeometry geometry)
          Creates a new Magnifier that magnifies the contents of the given SwoglComponent, which resides in the given SwoglContainer and contains the given Geometry.
 
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 setFocusingCondition(de.javagl.swogl.Condition<java.awt.event.MouseEvent> focusingCondition)
          Set the condition which states whether mouse events should change the focus location of the magnifying glass
 void setMagnificationCondition(de.javagl.swogl.Condition<java.awt.event.MouseEvent> magnificationCondition)
          Set the condition which states whether mouse events should change the magnification of the magnifying glass
 void setRadiusCondition(de.javagl.swogl.Condition<java.awt.event.MouseEvent> radiusCondition)
          Set the condition which states whether mouse events should change the radius of the magnifying glass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MagnifyingGlassControl

public MagnifyingGlassControl(de.javagl.swogl.SwoglContainer swoglContainer,
                              de.javagl.swogl.SwoglComponent swoglComponent,
                              de.javagl.swogl.geometry.SimpleGeometry geometry)
Creates a new Magnifier that magnifies the contents of the given SwoglComponent, which resides in the given SwoglContainer and contains the given Geometry.

Parameters:
swoglContainer - The SwoglContainer that contains the SwoglComponent
swoglComponent - The swoglComponent that is to be magnified
geometry - The geometry that the SwoglComponent consists of
Method Detail

attachTo

public void attachTo(javax.swing.JComponent component)
Description copied from interface: Control
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 Control.detachFrom(JComponent) method has to be called.

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. This will remove all listeners from the component that have been added when Control.attachTo(JComponent) was called.

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

setFocusingCondition

public void setFocusingCondition(de.javagl.swogl.Condition<java.awt.event.MouseEvent> focusingCondition)
Set the condition which states whether mouse events should change the focus location of the magnifying glass

Parameters:
focusingCondition - The focusing condition to set

setRadiusCondition

public void setRadiusCondition(de.javagl.swogl.Condition<java.awt.event.MouseEvent> radiusCondition)
Set the condition which states whether mouse events should change the radius of the magnifying glass

Parameters:
radiusCondition - The radius condition to set

setMagnificationCondition

public void setMagnificationCondition(de.javagl.swogl.Condition<java.awt.event.MouseEvent> magnificationCondition)
Set the condition which states whether mouse events should change the magnification of the magnifying glass

Parameters:
magnificationCondition - The magnification condition to set