public abstract class ViewPanel extends Object implements MouseListener, MouseMotionListener, MouseWheelListener, ComponentListener
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
ViewPanel() |
Modifier and Type | Method and Description |
---|---|
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 the cursor.
|
abstract BufferedImage |
getImage() |
protected boolean[] |
getLayerVisibilityOfContext() |
protected boolean[] |
getLayerVisibilityOfLens() |
protected Lens |
getLens()
Get the Lens currently used by this view.
|
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(int layer)
Get the padding values customizing the region inside the view in 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()
Get the 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 |
setDrawOval(short s)
Draw a circle/oval between the point where a press event was heard and the current position of the cursor (drag).
|
void |
setDrawRect(boolean b)
Draw a rectangle between the point where a press event was heard and the current position of the cursor (drag).
|
void |
setDrawSegment(boolean b)
Draw a segment between the point where a press event was heard and the current position of the cursor (drag).
|
void |
setFirstOrderPanWidget(Image icon)
Set the icon used to represent first-order-of-control panning.
|
protected void |
setLayerVisibility(boolean[] context,
boolean[] lens) |
protected Lens |
setLens(Lens l)
Set a lens for this view.
|
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,
int layer)
Get the padding values customizing the region inside the view in 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.
|
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
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 spaceviewToSpaceCoords(Camera cam, int jpx, int jpy)
public void setDrawSegment(boolean b)
b
- true to draw the segment.public void setDrawRect(boolean b)
b
- true to draw the rectangle.public void setDrawOval(short s)
s
- use OVAL for any oval, CIRCLE for circle, NONE to stop drawing.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()
public void setFirstOrderPanWidget(Image icon)
icon
- the image used as an 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 MouseListener
public void mouseClicked(MouseEvent e)
mouseClicked
in interface MouseListener
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
public void mouseEntered(MouseEvent e)
mouseEntered
in interface MouseListener
public void mouseExited(MouseEvent e)
mouseExited
in interface MouseListener
public void setAutoRequestFocusOnMouseEnter(boolean b)
b
- pass true to automatically request focus, false not to request it.
Default is false for external views (EView).
Default is true for panel views (PView) as keyboard events don't get sent otherwise.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 MouseMotionListener
public void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
public void mouseWheelMoved(MouseWheelEvent e)
mouseWheelMoved
in interface MouseWheelListener
public 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)
l
- pass null to remove an existing lens.protected Lens getLens()
protected void setLayerVisibility(boolean[] context, boolean[] lens)
protected boolean[] getLayerVisibilityOfContext()
protected boolean[] getLayerVisibilityOfLens()
protected void setVisibilityPadding(int[] wnesPadding, int layer)
wnesPadding
- padding values in pixels for the west, north, east and south borderslayer
- the layer in the view to which this padding should be applied.protected int[] getVisibilityPadding(int layer)
layer
- specify the layer for which this information is requested (different layers canhave different padding settings).public void componentResized(ComponentEvent e)
componentResized
in interface ComponentListener
public void componentMoved(ComponentEvent e)
componentMoved
in interface ComponentListener
public void componentShown(ComponentEvent e)
componentShown
in interface ComponentListener
public void componentHidden(ComponentEvent e)
componentHidden
in interface ComponentListener
protected final void drawPortals()
protected final void portalsHook()
protected final void backgroundHook()
protected final void foregroundHook()
protected final void afterLensHook()
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.