|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.inria.zvtm.engine.VCursor
public class VCursor
Glyph representing pointing device cursor. One instance per view.
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 | |
|---|---|
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 |
| Method Summary | |
|---|---|
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 |
propagateMove()
Propagate cursor movements to sticked glyphs. |
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 cursor. |
void |
unProject(Camera c,
ViewPanel v)
Unproject the cursor from JPanel coordinates to VirtualSpace coordinates. |
Glyph |
unstickLastGlyph()
Unstick glyph that was last sticked to mouse. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected float cx
protected float cy
protected double vx
protected double vy
protected double pvx
protected double pvy
protected int jpx
protected int jpy
| Method Detail |
|---|
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 propagateMove()
public void stickGlyph(Glyph g)
public Glyph unstickLastGlyph()
public int getStickedGlyphsNumber()
public Glyph[] getStickedGlyphArray()
public 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()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||