|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Canvas
jfig.canvas.FigBasicCanvas
jfig.canvas.ViewerCanvas
object canvas for the jfig viewer.
ViewerCanvas provides the object canvas for the jfig viewer. It is realized as a simple subclass of FigBasicCanvas, with additional support for mouse dragging to move the whole drawing (like, e.g., the Acrobat Reader), and some additional zoom options.
FigBasicCanvas,
Serialized Form| Nested Class Summary |
| Nested classes inherited from class jfig.canvas.FigBasicCanvas |
FigBasicCanvas.Options2D |
| Nested classes inherited from class java.awt.Canvas |
java.awt.Canvas.AccessibleAWTCanvas |
| Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
java.awt.Cursor |
moveCursor
|
| Fields inherited from class jfig.canvas.FigBasicCanvas |
backgroundColor, BASE_ANCHOR_X, BASE_ANCHOR_Y, canvasListener, cur_height, cur_width, cur_x, cur_y, debug, defaultColor, defaultCursor, enableTimingInfo, gridColor, gridGR, gridMode, gridVisible, helper, mouse_drag_x, mouse_drag_y, n_grid, n_redraws, n_trials_to_create_offscreenImage, n_updates, objectEnumerator, objectGR, offscreenGR, offscreenImage, old_x, old_y, pdbg, printer, ptmp, redrawMode, rubberband, RULER_XL_OFFSET, RULER_XR_OFFSET, RULER_YB_OFFSET, RULER_YT_OFFSET, rulerFont, t_delay, t_grid, t_grid_mean, t_redraw, t_redraw_mean, theObserver, tmp_sc, tmp_wc, trafo, waitCursor, zoomListenerVector |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface jfig.canvas.FigCanvas |
FullRedraw, MouseMotionRedraw, NoChanges, ObjectRedraw, panDOWN, panHOME, panLEFT, panRIGHT, panUP, SyncRedraw, SystemRedraw, TmpObjectRedraw, TmpTextRedraw |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
ViewerCanvas()
ViewerCanvas The default viewer canvas doesn't use neither a grid nor snapping. |
|
| Method Summary | |
void |
doZoomIn14()
zoom in by a factor of sqrt(two). |
void |
doZoomOut07()
|
void |
doZoomRegion(FigBbox bbox)
|
void |
doZoomRegionFree(FigBbox bbox)
|
void |
doZoomRegionSnapped(FigBbox bbox)
|
void |
mouseDragged(java.awt.event.MouseEvent evt)
Handle MouseDrag events: Currently, mouseDrag events are used for canvas panning. |
void |
mouseMoved(java.awt.event.MouseEvent evt)
Handle mouseMove events: update sliders/cross hatch, provide rubberbanding |
void |
mousePressed(java.awt.event.MouseEvent evt)
Handle mouseDown events: snap to the currently active grid, then call the parent mouseDown action function. |
void |
mouseReleased(java.awt.event.MouseEvent evt)
mouseReleased() is used to detect mouseDrag() events. |
| Methods inherited from class java.awt.Canvas |
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface jfig.canvas.FigCanvas |
getCursor, getSize, setCursor |
| Field Detail |
public java.awt.Cursor moveCursor
| Constructor Detail |
public ViewerCanvas()
The default viewer canvas doesn't use neither a grid nor snapping.
| Method Detail |
public void mousePressed(java.awt.event.MouseEvent evt)
FigBasicCanvas
mousePressed in interface FigCanvasmousePressed in class FigBasicCanvaspublic void mouseReleased(java.awt.event.MouseEvent evt)
FigBasicCanvasIf both the current and the previous mouse_drag_(x,y) position lie in the rulers and differ by more than 5 pixels (to suppress small 'jitter'), we calculate the corresponding viewport panning.
In the future, we should probably provide some kind of visual feedback about the current drag amout by using mouseDrag() to update the rulers correspondingly.
mouseReleased in interface FigCanvasmouseReleased in class FigBasicCanvaspublic void mouseMoved(java.awt.event.MouseEvent evt)
FigBasicCanvas
mouseMoved in interface FigCanvasmouseMoved in class FigBasicCanvaspublic void mouseDragged(java.awt.event.MouseEvent evt)
FigBasicCanvasHowever, mouseDrag() at the moment is not used: The actual panning calculations are done in mouseUp(). We should probably provide visual feedback about the drag amout by redrawing the rulers in this function.
mouseDragged in interface FigCanvasmouseDragged in class FigBasicCanvaspublic void doZoomIn14()
public void doZoomOut07()
public void doZoomRegionSnapped(FigBbox bbox)
public void doZoomRegionFree(FigBbox bbox)
public void doZoomRegion(FigBbox bbox)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||