public class VCursor 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 |
---|---|
protected float |
cx
coord in camera space (same as jpanel coords, but conventional coord sys at center of view panel, upward)
|
protected float |
cy
coord in camera space (same as jpanel coords, but conventional coord sys at center of view panel, upward)
|
protected int |
jpx
coords in JPanel
|
protected int |
jpy
coords in JPanel
|
protected double |
pvx
previous coords in virtual space
|
protected double |
pvy
previous coords in virtual space
|
protected double |
vx
coord in virtual space
|
protected double |
vy
coord in virtual space
|
Modifier and Type | Method and Description |
---|---|
DynaPicker |
getDynaPicker() |
Point2D.Double |
getLocation()
Get the cursor's location in virtual space (for active layer/camera).
|
View |
getOwningView()
Get view to which this cursor belongs.
|
int |
getPanelXCoordinate()
Get the cursor's x-coordinate in JPanel coordinates system.
|
int |
getPanelYCoordinate()
Get the cursor's y-coordinate in JPanel coordinates system.
|
Picker |
getPicker() |
int |
getSize()
Get cursor size (crosshair length).
|
Glyph[] |
getStickedGlyphArray()
Get list of glyphs sticked to cursor.
|
int |
getStickedGlyphsNumber()
Get the number of glyphs sticked to the cursor.
|
boolean |
getSync()
Tells whether this ZVTM cursor is synchronized with the system cursor or not.
|
Point2D.Double |
getVSCoordinates(Camera c)
Get the virtual space coordinates of the cursor.
|
double |
getVSXCoordinate()
Get the cursor's x-coordinate in virtual space coordinates system.
|
double |
getVSYCoordinate()
Get the cursor's y-coordinate in virtual space coordinates system.
|
boolean |
isSensitive()
Tells whether entry/exit of cursor into/from glyphs is enabled or disabled.
|
void |
setColor(Color c)
Set cursor color.
|
void |
setHintColor(Color c)
Set color of elements associated with cursor (drag segment, selection rectangle, etc.).
|
void |
setJPanelCoordinates(int x,
int y)
Move mouse cursor (JPanel coordinates).
|
void |
setSensitivity(boolean b)
Enable/disable entry/exit of cursor into/from glyphs.
|
void |
setSize(int s)
Set cursor size (crosshair length).
|
void |
setSync(boolean b)
Set whether this ZVTM cursor is synchronized with the system cursor or not.
|
void |
setVisibility(boolean b)
Should the cursor glyph be drawn or not.
|
void |
stickGlyph(Glyph g)
Attach glyph g to this cursor.
|
void |
unProject(Camera c,
ViewPanel v)
Unproject the cursor from JPanel coordinates to VirtualSpace coordinates.
|
void |
unstickGlyph(Glyph g)
Unstick glyph from cursor.
|
Glyph |
unstickLastGlyph()
Unstick glyph that was last sticked to this cursor.
|
protected float cx
protected float cy
protected double vx
protected double vy
protected double pvx
protected double pvy
protected int jpx
protected int jpy
public void setSize(int s)
public int getSize()
public Point2D.Double getLocation()
public View getOwningView()
public void setSync(boolean b)
public boolean getSync()
public void setColor(Color c)
public void setHintColor(Color c)
public void setJPanelCoordinates(int x, int y)
x
- x-coordinate, in JPanel coordinates systemy
- y-coordinate, in JPanel coordinates systempublic void setVisibility(boolean b)
public void setSensitivity(boolean b)
public boolean isSensitive()
public void unProject(Camera c, ViewPanel v)
public Picker getPicker()
public DynaPicker getDynaPicker()
public Point2D.Double getVSCoordinates(Camera c)
public int getPanelXCoordinate()
public int getPanelYCoordinate()
public double getVSXCoordinate()
public double getVSYCoordinate()
public void stickGlyph(Glyph g)
public Glyph unstickLastGlyph()
public int getStickedGlyphsNumber()
public void unstickGlyph(Glyph g)
public Glyph[] getStickedGlyphArray()
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.