public class RegionPicker extends ZuistPicker
A region picker that tells what regions overlap the corresponding coordinates. The picker will only test for regions that are visible in the given level range.
A RegionPicker is instantiated as follows:
SceneManager sm = ...; // create a picker that will only consider regions visible at ZUIST levels 3 through 5 (any of these levels or all of them) RegionPicker rPicker = sm.createRegionPicker(3,5); rPicker.setListener(aListener);
with aListener a RegionListener that gets notified whenever the picker enters or exits a Region.
A RegionPicker is moved programmatically using setVSCoordinates(). Any VirtualSpace coordinates can be given to it.
One way to tie it to a VCursor is simply to call setVSCoordinates() in the mouseMoved listener associated with the corresponding ViewListener.
public void mouseMoved(ViewPanel v, int jpx, int jpy, MouseEvent e){ rPicker.setVSCoordinates(v.getVCursor().getVSXCoordinate(), v.getVCursor().getVSYCoordinate()); }
Modifier and Type | Field and Description |
---|---|
protected int |
maxIndex |
Modifier and Type | Method and Description |
---|---|
void |
computePickedRegionList()
Compute the list of Regions currently picked.
|
RegionListener |
getListener() |
Region[] |
getPickedRegionList()
Get the list of regions currently picked.
|
void |
reset()
Reset the list of glyphs under the cursor.
|
void |
setLevelRange(int tl,
int bl)
Get the picker's level range, i.e., the levels at which the picker is looking for candidates.
|
void |
setListener(RegionListener rl) |
void |
setVSCoordinates(double x,
double y)
Set picker's coordinates (virtual space coordinates system).
|
void |
updateCandidateRegions()
This method should be called whenever regions are added/removed in the level range considered for picking.
|
getLevelRange, getVSCoordinates
public void updateCandidateRegions()
public void setListener(RegionListener rl)
public RegionListener getListener()
public void setVSCoordinates(double x, double y)
ZuistPicker
setVSCoordinates
in class ZuistPicker
x
- x-coordinate, in virtual space coordinates systemy
- y-coordinate, in virtual space coordinates systempublic void setLevelRange(int tl, int bl)
ZuistPicker
setLevelRange
in class ZuistPicker
tl
- top levelbl
- bottom levelpublic void reset()
public Region[] getPickedRegionList()
public void computePickedRegionList()
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.