public class DynaPicker extends Object
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.
Modifier and Type | Field and Description |
---|---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public static final short DYNASPOT_VISIBILITY_INVISIBLE
public static final short DYNASPOT_VISIBILITY_VISIBLE
public static final short DYNASPOT_VISIBILITY_FADEIN
public static final short DYNASPOT_VISIBILITY_FADEOUT
public void setDynaSpotVisibility(short v)
v
- one of DYNASPOT_VISIBILITY_*public void setDynaSpotColor(Color c)
c
- color of dynaspot areapublic Color getDynaSpotColor()
public void setDynaSpotTranslucence(float a)
a
- alpha value in [0.0-1.0]public float getDynaSpotTranslucence()
public void setDynaSpotLagTime(int t)
t
- lag in milliseconds
See http://zvtm.sourceforge.net/doc/dynaspot.html for more detail.public int getDynaSpotLagTime()
public void setDynaSpotReducTime(int t)
t
- reduction time in milliseconds
See http://zvtm.sourceforge.net/doc/dynaspot.html for more detail.public int getDynaSpotReducTime()
public void updateDynaSpot(long currentTime)
currentTime
- current absolute time, obtained from System.currentTimeMillis()public int getDynaSpotRadius()
public void setDynaSpotListener(DynaSpotListener dsl)
dsl
- callback implementation.public DynaSpotListener getDynaSpotListener()
public void activateDynaSpot(boolean b)
b
- true to enable, false to disable.public boolean isDynaSpotActivated()
public void setDynaSpotMaxRadius(int r)
r
- radius in pixels.
See http://zvtm.sourceforge.net/doc/dynaspot.html for more detail.public int getDynaSpotMaxRadius()
public void setSelectionListener(SelectionListener sl)
sl
- set to null to removepublic SelectionListener getSelectionListener()
public Glyph dynaPick(Camera c)
c
- the camera/layer considered for picking.
The best picked glyph is returned.
See http://zvtm.sourceforge.net/doc/dynaspot.html for more detail.dynaPick()
public Set getGlyphsInDynaSpotRegion(Camera c)
c
- the camera/layer considered for picking.
See http://zvtm.sourceforge.net/doc/dynaspot.html for more detail.dynaPick(Camera c)
Copyright © 2000-2002 Xerox Corporation. All Rights Reserved
Copyright © 2003 World Wide Web Consortium. All Rights Reserved
Copyright © 2004-2015 INRIA. All Rights Reserved
Licensed under the GNU LGPL. For full terms see the file COPYING.