public class Picker extends PickerVS
A picker that requires both VirtualSpace coordinates and View-projected coordinates.
All glyphs can be picked by this type of picker. It is the default picker associated with VCursor.
When instantiating a Picker manually, that picker should be registered with the VirtualSpace in which it is going to perform picking operations so that it gets notified whenever glyphs get removed from the VirtualSpace and updates itself accordingly. This is not necessary for the picker associated with a View's VCursor, that gets created automatically.
Modifier and Type | Field and Description |
---|---|
protected int |
jpx
coords in JPanel
|
protected int |
jpy
coords in JPanel
|
Constructor and Description |
---|
Picker()
Picker constructor.
|
Picker(int stackSize)
Picker constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
computePickedGlyphList(Camera c)
Compute the list of glyphs currently picked.
|
Vector<Glyph> |
getIntersectingGlyphs(Camera c,
boolean onlyGlyphsInViewport,
String type)
Get a list of all Glyphs (including segments and paths) picked.
|
Vector<VSegment> |
getIntersectingSegments(Camera c,
int tolerance)
Get a list of all VSegments picked at the picker's current coordinates.
|
static Vector<VSegment> |
getIntersectingSegments(Camera c,
int x,
int y,
int tolerance)
Get a list of all VSegments picked at a given set of coordinates.
|
boolean |
intersectsSegment(VSegment s,
int tolerance,
int camIndex)
Tells whether the picker is hovering a particular VSegment or not.
|
static boolean |
intersectsSegment(VSegment s,
int x,
int y,
int tolerance,
int camIndex)
Tells whether the picker is hovering a particular VSegment or not.
|
void |
setJPanelCoordinates(int x,
int y)
Set picker's coordinates (JPanel coordinates system).
|
computePickedGlyphList, getDrawOrderedPickedGlyphList, getIntersectingGlyphs, getIntersectingPaths, getIntersectingPaths, getIntersectingPaths, getListener, getPickedGlyphList, getPickedGlyphList, getStickedGlyphArray, getStickedGlyphsNumber, intersectsPath, intersectsPath, isPicked, lastGlyphEntered, pickOnTop, printList, propagateMove, setListener, setVSCoordinates, stickGlyph, unstickGlyph, unstickLastGlyph
public Picker()
public Picker(int stackSize)
stackSize
- start picked glyph stack size. Will double capacity if overflows.public void setJPanelCoordinates(int x, int y)
x
- x-coordinate, in JPanel coordinates systemy
- y-coordinate, in JPanel coordinates systempublic Vector<VSegment> getIntersectingSegments(Camera c, int tolerance)
c
- camera observing the segments of interesttolerance
- the segment's abstract thickness (w.r.t picking) in pixels, not virtual space units (we consider a narrow rectangular region, not an actual segment)getIntersectingSegments(Camera c, int jpx, int jpy, int tolerance)
,
intersectsSegment(VSegment s, int tolerance, int camIndex)
,
intersectsSegment(VSegment s, int jpx, int jpy, int tolerance, int camIndex)
public static Vector<VSegment> getIntersectingSegments(Camera c, int x, int y, int tolerance)
c
- camera observing the segments of interesttolerance
- the segment's abstract thickness (w.r.t picking) in pixels, not virtual space units (we consider a narrow rectangular region, not an actual segment)x
- cursor x-coordinate in JPanel coordinates systemy
- cursor y-coordinate in JPanel coordinates systemgetIntersectingSegments(Camera c, int tolerance)
,
intersectsSegment(VSegment s, int tolerance, int camIndex)
,
intersectsSegment(VSegment s, int jpx, int jpy, int tolerance, int camIndex)
public boolean intersectsSegment(VSegment s, int tolerance, int camIndex)
camIndex
- indes of camera observing the segments of interest (available through Camera.getIndex())tolerance
- the segment's abstract thickness (w.r.t picking) in pixels, not virtual space units (we consider a narrow rectangular region, not an actual segment)Camera.getIndex()
,
intersectsSegment(VSegment s, int jpx, int jpy, int tolerance, int camIndex)
,
getIntersectingSegments(Camera c, int jpx, int jpy, int tolerance)
,
getIntersectingSegments(Camera c, int tolerance)
public static boolean intersectsSegment(VSegment s, int x, int y, int tolerance, int camIndex)
camIndex
- index of camera observing the segments of interest (available through Camera.getIndex())tolerance
- the segment's abstract thickness (w.r.t picking) in pixels, not virtual space units (we consider a narrow rectangular region, not an actual segment)intersectsSegment(VSegment s, int tolerance, int camIndex)
,
getIntersectingSegments(Camera c, int jpx, int jpy, int tolerance)
,
getIntersectingSegments(Camera c, int tolerance)
public Vector<Glyph> getIntersectingGlyphs(Camera c, boolean onlyGlyphsInViewport, String type)
PickerVS
getIntersectingGlyphs
in class PickerVS
c
- a camera (the active camera can be obtained by VirtualSpaceManager.getActiveCamera())onlyGlyphsInViewport
- only perform picking test on glyphs that are drawn. Default value is true, as it limits the number of Glyphs to consider to those that fall within the camera's viewport.type
- the type of glyph to look for (pass null to look for any type of glyph). Type of glyph as specified with Glyph.setType().PickerVS.getIntersectingGlyphs(Camera c)
,
PickerVS.getPickedGlyphList()
public boolean computePickedGlyphList(Camera c)
PickerVS
computePickedGlyphList
in class PickerVS
c
- camera observing the glyphs of potential interest in the View.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.