fr.inria.zvtm.engine
Class DynaPicker

java.lang.Object
  extended by fr.inria.zvtm.engine.DynaPicker

public class DynaPicker
extends Object

DynaSpot picker.

Author:
Emmanuel Pietriga

Using DynaSpot

The DynaSpot behavior must be activated in VCursor, calling

In your ViewListener, simply call VCursor.dynaPick(Camera c) wherever this makes sense. Usually this will be mouseMoved(...):

This updates the list of glyphs intersected by the DynaSpot disc, and identifies the one glyph actually selected (which is returned). The method also takes care of highlighting/unhighlighting the selected glyph.

Note: dynaPick() also gets called internally when DynaSpot's size changes.


Field Summary
static short DYNASPOT_VISIBILITY_FADEIN
          The DynaSpot area is invisible when the cursor is still, and gradually fades in when the cursor moves.
static short DYNASPOT_VISIBILITY_FADEOUT
          The DynaSpot area is visible when the cursor is still, and gradually fades out when the cursor moves.
static short DYNASPOT_VISIBILITY_INVISIBLE
          The DynaSpot area is never displayed.
static short DYNASPOT_VISIBILITY_VISIBLE
          The DynaSpot area is always displayed.
 
Method Summary
 void activateDynaSpot(boolean b)
          Enable/disable DynaSpot cursor behavior.
 Glyph dynaPick(Camera c)
          Compute the list of glyphs picked by the DynaSpot cursor.
 Color getDynaSpotColor()
          Get the color of the dynaspot area.
 int getDynaSpotLagTime()
          Get DynaSpot lag parameter.
 DynaSpotListener getDynaSpotListener()
          Find out who is listening for DynaSpot events.
 int getDynaSpotMaxRadius()
          Get maximum size of DynaSpot selection region.
 int getDynaSpotRadius()
          Get DynaSpot's current radius.
 int getDynaSpotReducTime()
          Get DynaSpot reduction time parameter.
 float getDynaSpotTranslucence()
          Get the translucence level of the dynaspot area.
 Set getGlyphsInDynaSpotRegion(Camera c)
          Get the set of glyphs intersected by the cursor's dynaspot region.
 SelectionListener getSelectionListener()
          Get the Selection Listener callback triggered when a glyph gets selected/unselected by DynaSpot.
 boolean isDynaSpotActivated()
          Tells whether DynaSpot cursor behavior is enabled or not.
 void setDynaSpotColor(Color c)
          Set the color of the dynaspot area.
 void setDynaSpotLagTime(int t)
          Set DynaSpot lag parameter.
 void setDynaSpotListener(DynaSpotListener dsl)
          Listen for DynaSpot events.
 void setDynaSpotMaxRadius(int r)
          Set maximum size of DynaSpot selection region.
 void setDynaSpotReducTime(int t)
          Set DynaSpot reduction time parameter.
 void setDynaSpotTranslucence(float a)
          Set the translucence level of the dynaspot area.
 void setDynaSpotVisibility(short v)
          Set the visibility and visual behaviour of the DynaSpot.
 void setSelectionListener(SelectionListener sl)
          Set a Selection Listener callback triggered when a glyph gets selected/unselected by DynaSpot.
 void updateDynaSpot(long currentTime)
          Update DynaSpot's parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DYNASPOT_VISIBILITY_INVISIBLE

public static final short DYNASPOT_VISIBILITY_INVISIBLE
The DynaSpot area is never displayed.

See Also:
Constant Field Values

DYNASPOT_VISIBILITY_VISIBLE

public static final short DYNASPOT_VISIBILITY_VISIBLE
The DynaSpot area is always displayed.

See Also:
Constant Field Values

DYNASPOT_VISIBILITY_FADEIN

public static final short DYNASPOT_VISIBILITY_FADEIN
The DynaSpot area is invisible when the cursor is still, and gradually fades in when the cursor moves.

See Also:
Constant Field Values

DYNASPOT_VISIBILITY_FADEOUT

public static final short DYNASPOT_VISIBILITY_FADEOUT
The DynaSpot area is visible when the cursor is still, and gradually fades out when the cursor moves.

See Also:
Constant Field Values
Method Detail

setDynaSpotVisibility

public void setDynaSpotVisibility(short v)
Set the visibility and visual behaviour of the DynaSpot.

Parameters:
v - one of DYNASPOT_VISIBILITY_*

setDynaSpotColor

public void setDynaSpotColor(Color c)
Set the color of the dynaspot area.

Parameters:
c - color of dynaspot area

getDynaSpotColor

public Color getDynaSpotColor()
Get the color of the dynaspot area.


setDynaSpotTranslucence

public void setDynaSpotTranslucence(float a)
Set the translucence level of the dynaspot area.

Parameters:
a - alpha value in [0.0-1.0]

getDynaSpotTranslucence

public float getDynaSpotTranslucence()
Get the translucence level of the dynaspot area.

Returns:
an alpha value in [0.0-1.0]

setDynaSpotLagTime

public void setDynaSpotLagTime(int t)
Set DynaSpot lag parameter. See http://zvtm.sourceforge.net/doc/dynaspot.html for more detail.


getDynaSpotLagTime

public int getDynaSpotLagTime()
Get DynaSpot lag parameter. See http://zvtm.sourceforge.net/doc/dynaspot.html for more detail.


setDynaSpotReducTime

public void setDynaSpotReducTime(int t)
Set DynaSpot reduction time parameter. See http://zvtm.sourceforge.net/doc/dynaspot.html for more detail.


getDynaSpotReducTime

public int getDynaSpotReducTime()
Get DynaSpot reduction time parameter. See http://zvtm.sourceforge.net/doc/dynaspot.html for more detail.


updateDynaSpot

public void updateDynaSpot(long currentTime)
Update DynaSpot's parameters.

Parameters:
currentTime - current absolute time, obtained from System.currentTimeMillis()

getDynaSpotRadius

public int getDynaSpotRadius()
Get DynaSpot's current radius. See http://zvtm.sourceforge.net/doc/dynaspot.html for more detail.


setDynaSpotListener

public void setDynaSpotListener(DynaSpotListener dsl)
Listen for DynaSpot events.


getDynaSpotListener

public DynaSpotListener getDynaSpotListener()
Find out who is listening for DynaSpot events.


activateDynaSpot

public void activateDynaSpot(boolean b)
Enable/disable DynaSpot cursor behavior.


isDynaSpotActivated

public boolean isDynaSpotActivated()
Tells whether DynaSpot cursor behavior is enabled or not.


setDynaSpotMaxRadius

public void setDynaSpotMaxRadius(int r)
Set maximum size of DynaSpot selection region. See http://zvtm.sourceforge.net/doc/dynaspot.html for more detail.


getDynaSpotMaxRadius

public int getDynaSpotMaxRadius()
Get maximum size of DynaSpot selection region. See http://zvtm.sourceforge.net/doc/dynaspot.html for more detail.


setSelectionListener

public void setSelectionListener(SelectionListener sl)
Set a Selection Listener callback triggered when a glyph gets selected/unselected by DynaSpot.

Parameters:
sl - set to null to remove

getSelectionListener

public SelectionListener getSelectionListener()
Get the Selection Listener callback triggered when a glyph gets selected/unselected by DynaSpot.

Returns:
null if none set.

dynaPick

public Glyph dynaPick(Camera c)
Compute the list of glyphs picked by the DynaSpot cursor. The best picked glyph is returned. See http://zvtm.sourceforge.net/doc/dynaspot.html for more detail.

Returns:
null if the dynaspot cursor does not pick anything.
See Also:
dynaPick()

getGlyphsInDynaSpotRegion

public Set getGlyphsInDynaSpotRegion(Camera c)
Get the set of glyphs intersected by the cursor's dynaspot region. See http://zvtm.sourceforge.net/doc/dynaspot.html for more detail.

Returns:
a set of Glyph IDs
See Also:
dynaPick(Camera c)


Copyright © 2000-2002 Xerox Corporation. All Rights Reserved
Copyright © 2003 World Wide Web Consortium. All Rights Reserved
Copyright © 2004-2011 INRIA. All Rights Reserved
Licensed under the GNU LGPL. For full terms see the file COPYING.