|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.inria.zvtm.engine.ViewPanel
public abstract class ViewPanel
JPanel used to paint the content of a view (all camera layers).
| Field Summary | |
|---|---|
int |
activeLayer
active layer in this view (corresponds to the index of a camera in cams[]) |
protected Cursor |
awtCursor
the AWT cursor |
Camera[] |
cams
list of cameras used in this view |
static short |
CIRCLE
should a circle between point where we started dragging the mouse and current point |
protected int |
curDragx
drag-segment/rectangle coords |
protected int |
curDragy
drag-segment/rectangle coords |
protected boolean |
drawVTMcursor
VTM cursor is drawn only when AWT cursor is set to CUSTOM_CURSOR |
protected Image |
FIRST_ORDER_PAN_WIDGET
|
protected Lens |
lens
Lens (fisheye, etc.) |
static int |
NO_COORDS
Value that specifies that there isn't any point for which no mouse move/drag event is sent. |
static short |
NONE
draw no oval between point where we started dragging the mouse and current point |
protected int |
oldX
Previous coordinates of the mouse. |
protected int |
oldY
|
protected int |
origDragx
drag-segment/rectangle coords |
protected int |
origDragy
drag-segment/rectangle coords |
static short |
OVAL
draw an oval between point where we started dragging the mouse and current point |
View |
parent
view |
protected Graphics2D |
stableRefToBackBufferGraphics
|
| Constructor Summary | |
|---|---|
ViewPanel()
|
|
| Method Summary | |
|---|---|
protected void |
afterLensHook()
|
protected void |
backgroundHook()
|
void |
componentHidden(ComponentEvent e)
|
void |
componentMoved(ComponentEvent e)
|
void |
componentResized(ComponentEvent e)
|
void |
componentShown(ComponentEvent e)
|
protected void |
drawPortals()
|
protected void |
foregroundHook()
|
boolean |
getAutoRequestFocusOnMouseEnter()
Tells whether the viewpanel is automatically requesting focus when cursor enters it or not. |
abstract Component |
getComponent()
Get the underlying Swing component. |
long |
getDelay()
Get the actual instantaneous refresh rate. |
Glyph[] |
getGlyphsUnderCursorList()
Get the list of glyphs currently under mouse (last entry is last glyph entered) This returns a copy of the actual array managed by VCursor at the time the method is called (in other words, the array returned by this method is not synchronized with the actual list over time) |
abstract BufferedImage |
getImage()
|
protected Lens |
getLens()
return Lens cyrrently used by this view (null if none) |
ViewListener[] |
getListeners()
|
Point |
getNoEventCoordinates()
Get the coordinates of a particular point in view panel coordinates for which mouse move/drag events are ignored, if any. |
abstract int |
getRefreshRate()
Gets the maximum view refresh rate. |
VCursor |
getVCursor()
Get VCursor instance associated with the parent view. |
protected int[] |
getVisibilityPadding()
get the padding values customizing the region inside the view for which objects are actually visible |
void |
hideFirstOrderPanWidget()
Hide the icon representing first-order-of-control panning. |
boolean |
isShowingFirstOrderPanWidget()
Is the icon used to represent first-order-of-control panning currently being shown. |
Glyph |
lastGlyphEntered()
last glyph the mouse entered in (for this view and current active layer) |
void |
mouseClicked(MouseEvent e)
send event to application event handler |
void |
mouseDragged(MouseEvent e)
send event to application event handler |
void |
mouseEntered(MouseEvent e)
Mouse cursor entered this view. |
void |
mouseExited(MouseEvent e)
Mouse cursor exited this view. |
void |
mouseMoved(MouseEvent e)
|
void |
mousePressed(MouseEvent e)
send event to application event handler |
void |
mouseReleased(MouseEvent e)
send event to application event handler |
void |
mouseWheelMoved(MouseWheelEvent e)
send event to application event handler |
protected void |
portalsHook()
|
void |
setAutoRequestFocusOnMouseEnter(boolean b)
Should the viewpanel automatically request focus when cursor enters it or not. |
protected void |
setAWTCursor(Cursor c)
Set the cursor. |
protected void |
setAWTCursor(int cursorType)
Set the cursor. |
void |
setDrawCursor(boolean b)
|
void |
setDrawDrag(boolean b)
true will draw a segment between origin of drag and current cursor pos until drag is finished (still visible for backward compatibility reasons - should use setDrawSegment instead) |
void |
setDrawOval(short s)
draw a circle between origin of drag and current cursor pos until drag is finished (drag segment represents the radius of the circle, not its diameter) - use OVAL for any oval, CIRCLE for circle, NONE to stop drawing it |
void |
setDrawRect(boolean b)
true will draw a rectangle between origin of drag and current cursor pos until drag is finished |
void |
setDrawSegment(boolean b)
true will draw a segment between origin of drag and current cursor pos until drag is finished |
void |
setFirstOrderPanWidget(Image icon)
Set the icon used to represent first-order-of-control panning. |
protected Lens |
setLens(Lens l)
set a lens for this view ; set to null to remove an existing lens |
void |
setNoEventCoordinates(int x,
int y)
Set a particular point in view panel coordinates for which mouse move/drag events should be ignored. |
abstract void |
setRefreshRate(int r)
Sets the maximum view refresh rate. |
protected void |
setVisibilityPadding(int[] wnesPadding)
set a padding for customizing the region inside the view for which objects are actually visible |
void |
showFirstOrderPanWidget(int jpx,
int jpy)
Show the icon representing first-order-of-control panning. |
Point |
spaceToViewCoords(Camera c,
double vx,
double vy)
Converts between virtual space coordinates and view coordinates for a given camera. |
Point2D.Double |
viewToSpaceCoords(Camera c,
int jpx,
int jpy)
Converts between view coordinates and virtual space coordinates for a given camera. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final short NONE
public static final short OVAL
public static final short CIRCLE
protected Graphics2D stableRefToBackBufferGraphics
public Camera[] cams
public int activeLayer
public View parent
protected int oldX
protected int oldY
protected int origDragx
protected int origDragy
protected int curDragx
protected int curDragy
protected Image FIRST_ORDER_PAN_WIDGET
protected boolean drawVTMcursor
protected Cursor awtCursor
protected Lens lens
public static final int NO_COORDS
| Constructor Detail |
|---|
public ViewPanel()
| Method Detail |
|---|
public ViewListener[] getListeners()
public abstract Component getComponent()
protected void setAWTCursor(int cursorType)
cursorType - any of the cursor type values declared in java.awt.Cursor, such as DEFAULT_CURSOR, CROSSHAIR_CURSOR HAND_CURSOR, etc. To get the ZVTM cursor, use Cursor.CUSTOM_CURSOR.public void setDrawCursor(boolean b)
protected void setAWTCursor(Cursor c)
c - an AWT cursor instantiated e.g. by calling java.awt.Toolkit.createCustomCursor(Image cursor, Point hotSpot, String name)
public Point2D.Double viewToSpaceCoords(Camera c,
int jpx,
int jpy)
c - camerajpx - x coordinate in the panel system (JPanel coordinates)jpy - y coordinate in the panel system (JPanel coordinates)
spaceToViewCoords(Camera cam, double vx, double vy)
public Point spaceToViewCoords(Camera c,
double vx,
double vy)
c - cameravx - x coordinate in virtual spacevy - y coordinate in virtual space
viewToSpaceCoords(Camera cam, int jpx, int jpy)public void setDrawDrag(boolean b)
public void setDrawSegment(boolean b)
public void setDrawRect(boolean b)
public void setDrawOval(short s)
public void showFirstOrderPanWidget(int jpx,
int jpy)
jpx - x-coordinate of icon's center in JPanel coordinate systemjpy - y-coordinate of icon's center in JPanel coordinate systemhideFirstOrderPanWidget(),
setFirstOrderPanWidget(Image icon),
isShowingFirstOrderPanWidget()public void hideFirstOrderPanWidget()
showFirstOrderPanWidget(int jpx, int jpy),
setFirstOrderPanWidget(Image icon),
isShowingFirstOrderPanWidget()public void setFirstOrderPanWidget(Image icon)
showFirstOrderPanWidget(int jpx, int jpy),
hideFirstOrderPanWidget(),
isShowingFirstOrderPanWidget()public boolean isShowingFirstOrderPanWidget()
showFirstOrderPanWidget(int jpx, int jpy),
hideFirstOrderPanWidget(),
setFirstOrderPanWidget(Image icon)public void mousePressed(MouseEvent e)
mousePressed in interface MouseListenerpublic void mouseClicked(MouseEvent e)
mouseClicked in interface MouseListenerpublic void mouseReleased(MouseEvent e)
mouseReleased in interface MouseListenerpublic void mouseEntered(MouseEvent e)
mouseEntered in interface MouseListenerpublic void mouseExited(MouseEvent e)
mouseExited in interface MouseListenerpublic void setAutoRequestFocusOnMouseEnter(boolean b)
public boolean getAutoRequestFocusOnMouseEnter()
public void setNoEventCoordinates(int x,
int y)
x - x-coordinate in the JPanel's system ; set to ViewPanel.NO_COORDS to cancel any previsouly set point.y - y-coordinate in the JPanel's system ; set to ViewPanel.NO_COORDS to cancel any previsouly set point.public Point getNoEventCoordinates()
public void mouseMoved(MouseEvent e)
mouseMoved in interface MouseMotionListenerpublic void mouseDragged(MouseEvent e)
mouseDragged in interface MouseMotionListenerpublic void mouseWheelMoved(MouseWheelEvent e)
mouseWheelMoved in interface MouseWheelListenerpublic VCursor getVCursor()
public Glyph lastGlyphEntered()
public Glyph[] getGlyphsUnderCursorList()
public abstract BufferedImage getImage()
public abstract void setRefreshRate(int r)
r - positive integer in millisecondspublic abstract int getRefreshRate()
public long getDelay()
protected Lens setLens(Lens l)
protected Lens getLens()
protected void setVisibilityPadding(int[] wnesPadding)
wnesPadding - padding values in pixels for the west, north, east and south bordersprotected int[] getVisibilityPadding()
public void componentResized(ComponentEvent e)
componentResized in interface ComponentListenerpublic void componentMoved(ComponentEvent e)
componentMoved in interface ComponentListenerpublic void componentShown(ComponentEvent e)
componentShown in interface ComponentListenerpublic void componentHidden(ComponentEvent e)
componentHidden in interface ComponentListenerprotected final void drawPortals()
protected final void portalsHook()
protected final void backgroundHook()
protected final void foregroundHook()
protected final void afterLensHook()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||