|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Canvas jfig.canvas.FigBasicCanvas
basic object canvas to draw FIG objects.
FigBasicCanvas provides a canvas for displaying of FIG objects (subclasses of jfig.objects.FigObject) with zoom, several redraw and animation options. Use this class or a subclass of it as the main drawing canvas for a graphics editor like jfig or the corresponding viewer.
FigBasicCanvas handles mouseDown, mouseMove, mouseDrag, and KeyDown events for automatic panning (via cursor-keys or mouseMoves near the border). Other events are passed to the parent applet.
Drawing into the canvas is done in three steps with an offscreen buffer for the grid and the 'objects' respectively:
Additionally, FigBasicCanvas supports the standard zoom functionality.
Nested Class Summary | |
class |
FigBasicCanvas.Options2D
Options2D: inner class to encapsulate access to Java2D rendering hints in a Java 1.1 compatible way. |
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 | |
protected java.awt.Color |
backgroundColor
|
protected int |
BASE_ANCHOR_X
|
protected int |
BASE_ANCHOR_Y
|
(package private) FigCanvasListener |
canvasListener
|
protected int |
cur_height
|
protected int |
cur_width
|
protected int |
cur_x
|
protected int |
cur_y
|
protected boolean |
debug
|
protected java.awt.Color |
defaultColor
|
java.awt.Cursor |
defaultCursor
|
protected boolean |
enableRulerDragging
|
protected boolean |
enableTimingInfo
|
protected java.awt.Color |
gridColor
|
protected java.awt.Graphics |
gridGR
|
(package private) int |
gridMode
|
(package private) boolean |
gridVisible
|
protected boolean |
hasRulers
|
(package private) StatusMessage |
helper
|
(package private) int |
mouse_drag_x
|
(package private) int |
mouse_drag_y
|
(package private) int |
n_grid
|
(package private) int |
n_redraws
|
(package private) int |
n_trials_to_create_offscreenImage
|
(package private) int |
n_updates
|
protected FigDrawableEnumerator |
objectEnumerator
|
protected java.awt.Graphics |
objectGR
|
protected java.awt.Graphics |
offscreenGR
|
(package private) java.awt.Image |
offscreenImage
|
protected int |
old_x
|
protected int |
old_y
|
(package private) boolean |
pdbg
|
(package private) ConsoleMessage |
printer
|
(package private) java.awt.Point |
ptmp
|
protected int |
redrawMode
|
(package private) FigCanvasRubberband |
rubberband
|
protected int |
RULER_XL_OFFSET
|
protected int |
RULER_XR_OFFSET
|
protected int |
RULER_YB_OFFSET
|
protected int |
RULER_YT_OFFSET
|
(package private) static java.awt.Font |
rulerFont
|
(package private) long |
t_delay
|
(package private) long |
t_grid
|
(package private) long |
t_grid_mean
|
(package private) long |
t_redraw
|
(package private) long |
t_redraw_mean
|
(package private) java.awt.image.ImageObserver |
theObserver
|
(package private) java.awt.Point |
tmp_sc
|
(package private) java.awt.Point |
tmp_wc
|
protected FigTrafo2D |
trafo
|
java.awt.Cursor |
waitCursor
|
(package private) java.util.Vector |
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 | |
FigBasicCanvas()
The FigBasicCanvas public contructor. |
Method Summary | |
void |
addCanvasListener(FigCanvasListener listener)
|
void |
addZoomListener(ZoomListener zl)
|
void |
blitOffscreenBuffer(java.awt.Graphics g)
|
void |
blitOffscreenBufferClipped(java.awt.Graphics g)
|
boolean |
canvasSizeChanged()
|
void |
changeRubberbandMode(int new_mode)
changeRubberbandMode(): change the current mode of our rubberband |
void |
changeRubberbandMode(int mode,
FigTrafo2D t,
java.lang.Object b)
|
void |
changeRubberbandMode(int new_mode,
GeometryManager gm)
|
void |
clearBuffer(java.awt.Graphics g)
clear the Image before drawing the rulers and the grid itself. |
void |
clippedDrawTmpObject(java.awt.Graphics g)
|
void |
doFullRedraw_deadlocks(long millis)
|
void |
doFullRedraw()
doFullRedraw(): redraw everything... |
void |
doFullRedraw(long millis)
|
void |
doMotionRedraw()
|
void |
doObjectRedraw()
|
void |
doPanning(int direction,
boolean shift)
automatic panning of the visible viewport on the world-coordinate system. |
void |
doSimpleRedraw()
|
void |
doSyncRedraw()
method stub for synchronous repaints: FigBasicCanvas itself just provides a doSimpleRedraw(). |
void |
doSystemRedraw()
|
void |
doTextRedraw()
|
void |
doToggleRubberbandDebug()
|
void |
doZoom11()
restore to zoom-factor 1 and origin (0,0) |
void |
doZoomFit()
doZoomFit(): calculate the bounding box of all objects from our FigDrawableEnumerator, then set the zoom and panning so that all objects are visible. |
void |
doZoomFull()
restore to zoom factor 1 |
void |
doZoomIn()
zoom in by a factor of two. |
void |
doZoomOut()
try to halve the current zoom factor (if possible), then redraw all. |
void |
doZoomRegion(int wx,
int wy,
int wx2,
int wy2)
doZoomRegion(): zoom into the world coordinate region given by corners (wx,wy) and (wx2, wy2). |
void |
drawAllObjects(java.awt.Graphics g)
drawAllObjects(): This traverses the parent's object list and draws all objects found and visible. |
void |
drawGrid(java.awt.Graphics gridGR)
Actually draw the grid, assuming that the offscreenBuffers are already created and of the right size. |
void |
drawGridByHand(java.awt.Graphics gridGR)
variant of drawGrid |
void |
drawGridViaCopyArea(java.awt.Graphics gridGR)
An implementation of drawGrid. |
void |
drawObject(java.awt.Graphics g,
FigObject object)
|
void |
drawRulers(java.awt.Graphics g)
drawRulers: draw the scale rulers on top and the right side of the canvas. |
void |
drawSliders(java.awt.Graphics g,
boolean erase)
draw the sliders to mark the current position. |
void |
drawSlidersAndCursor(java.awt.Graphics g,
boolean erase)
|
void |
drawSlidersOnce(java.awt.Graphics g,
int x,
int y)
drawSlidersOnce: internal helper function to draw the sliders/cross-hatch at position (x,y). |
void |
drawTmpObjects(java.awt.Graphics g)
|
void |
drawTriangles(java.awt.Graphics g,
int xmax,
int ymax)
draw the 'scrollbar triangles' |
void |
eraseObject(java.awt.Graphics g,
FigObject object)
|
void |
err(java.lang.String msg)
print an error message to stderr (but never use the Console) |
void |
flush()
call flush() on any offscreen buffers this canvas might have used. |
void |
get_current_canvas_size()
|
java.awt.Color |
getBackground()
|
java.awt.Component |
getComponent()
return the AWT/Swing component that actually implements the canvas |
void |
getCurrentCanvasSize()
get the current FigBasicCanvas dimensions and store in our instance vars cur_width and cur_height. |
boolean |
getDebug()
|
java.awt.Color |
getGridColor()
|
java.awt.Point |
getMousePosition()
|
FigDrawableEnumerator |
getObjectEnumerator()
|
java.awt.Graphics |
getOffscreenGraphics()
return a reference to the offscreen Graphics when double-buffering |
FigBasicCanvas.Options2D |
getOptions2D()
|
java.lang.String |
getRedrawMode()
|
FigTrafo2D |
getTrafo()
return the current coordinate transformation used for this canvas. |
java.awt.Point |
getViewportWCmax()
return the world coordinates of the right-bottom corner of this canvas (depending on it's size and the zoom-factor). |
FigBbox |
getVisibleRegionBoundingBox_OLD()
|
FigBbox |
getVisibleRegionBoundingBox()
|
boolean |
gotFocus()
|
void |
handleRedraw(java.awt.Graphics g)
|
void |
initializeOffscreenBuffers()
update the offscreen buffer images. |
boolean |
isDoubleBuffered()
|
static void |
main(java.lang.String[] argv)
main(): simple self test of FigBasicCanvas inside a Frame. |
void |
mouseClicked(java.awt.event.MouseEvent evt)
|
void |
mouseDragged(java.awt.event.MouseEvent evt)
Handle MouseDrag events: Currently, mouseDrag events are used for canvas panning. |
void |
mouseEntered(java.awt.event.MouseEvent evt)
mouseEntered(): request the keyboard focus. |
void |
mouseExited(java.awt.event.MouseEvent evt)
|
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. |
void |
msg(java.lang.String msg)
print msgs to console window or stdout |
void |
notifyZoomListeners()
|
void |
paint(FigDrawable obj)
a method that allows animated objects to update their current state. |
void |
paint(FigDrawable obj,
int millis)
repaint an (animated) object within millis milliseconds. |
void |
paint(java.awt.Graphics g)
|
void |
print(java.awt.Graphics g)
|
void |
printAll(java.awt.Graphics g)
|
void |
printTimingStats()
|
void |
removeZoomListener(ZoomListener zl)
|
void |
repaint()
|
void |
repaint(int millis)
request a standard repaint after (at most) millis milliseconds. |
void |
repaint(int x,
int y,
int w,
int h)
|
void |
repaint(long millis,
int x,
int y,
int w,
int h)
|
void |
requestAntiAliasing(boolean b)
|
void |
requestRenderQuality(boolean b)
|
void |
setBackground(java.awt.Color c)
|
void |
setConsole(ConsoleMessage printer)
set the msg console |
void |
setDebug(boolean debug)
|
void |
setDefaultCursor(java.awt.Cursor c)
|
void |
setEnableRulerDragging(boolean b)
|
void |
setGrid(int gridMode)
set a new grid spacing. |
void |
setGridColor(java.awt.Color c)
set new grid color |
void |
setObjectEnumerator(FigDrawableEnumerator enumerator)
specify the object that will provide this canvas with the Enumeration of drawable objects. |
void |
setRubberbandAspect(double d)
|
void |
setRubberbandBasePoint(int sx,
int sy)
|
void |
setRubberbandBasePoint(java.awt.Point sp)
set a new base point for the rubberband |
void |
setRubberbandBasePoint2(int sx,
int sy)
|
void |
setRubberbandBasePoint2(java.awt.Point P)
|
void |
setRubberbandShowLineLengths(boolean b)
|
void |
setRulerOffsets()
calculate the offsets required when using rulers on this canvas. |
void |
setStatusMessage(StatusMessage helper)
|
void |
setTrafo(FigTrafo2D trafo)
set the coordinate transformation for this canvas. |
void |
showRulers(boolean b)
|
void |
statusMessage(java.lang.String msg)
show or print status msgs |
void |
synchronousRepaint()
request a synchronous repaint of all pending animation repaints. |
void |
update(java.awt.Graphics g)
|
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 |
protected FigDrawableEnumerator objectEnumerator
protected FigTrafo2D trafo
ConsoleMessage printer
StatusMessage helper
FigCanvasListener canvasListener
java.util.Vector zoomListenerVector
public java.awt.Cursor waitCursor
public java.awt.Cursor defaultCursor
FigCanvasRubberband rubberband
java.awt.Image offscreenImage
java.awt.image.ImageObserver theObserver
protected java.awt.Graphics gridGR
protected java.awt.Graphics offscreenGR
protected java.awt.Graphics objectGR
protected int cur_x
protected int cur_y
protected int old_x
protected int old_y
protected int cur_width
protected int cur_height
java.awt.Point ptmp
java.awt.Point tmp_sc
java.awt.Point tmp_wc
protected java.awt.Color backgroundColor
protected java.awt.Color gridColor
protected java.awt.Color defaultColor
static final java.awt.Font rulerFont
boolean pdbg
boolean gridVisible
int gridMode
protected int redrawMode
protected int BASE_ANCHOR_X
protected int BASE_ANCHOR_Y
protected int RULER_XL_OFFSET
protected int RULER_XR_OFFSET
protected int RULER_YT_OFFSET
protected int RULER_YB_OFFSET
int mouse_drag_x
int mouse_drag_y
protected boolean hasRulers
protected boolean enableRulerDragging
protected boolean debug
protected boolean enableTimingInfo
int n_updates
int n_redraws
long t_redraw
long t_redraw_mean
int n_grid
long t_grid
long t_grid_mean
long t_delay
int n_trials_to_create_offscreenImage
Constructor Detail |
public FigBasicCanvas()
Method Detail |
public java.lang.String getRedrawMode()
public boolean isDoubleBuffered()
public void setRulerOffsets()
FigCanvas
setRulerOffsets
in interface FigCanvas
public void setDebug(boolean debug)
setDebug
in interface FigCanvas
public boolean getDebug()
getDebug
in interface FigCanvas
public FigTrafo2D getTrafo()
FigCanvas
getTrafo
in interface FigCanvas
public void setTrafo(FigTrafo2D trafo)
FigCanvas
setTrafo
in interface FigCanvas
public java.awt.Component getComponent()
FigCanvas
getComponent
in interface FigCanvas
public java.awt.Graphics getOffscreenGraphics()
FigCanvas
getOffscreenGraphics
in interface FigCanvas
public void setDefaultCursor(java.awt.Cursor c)
setDefaultCursor
in interface FigCanvas
public void addCanvasListener(FigCanvasListener listener)
addCanvasListener
in interface FigCanvas
public void setObjectEnumerator(FigDrawableEnumerator enumerator)
setObjectEnumerator
in interface FigCanvas
public FigDrawableEnumerator getObjectEnumerator()
getObjectEnumerator
in interface FigCanvas
public void statusMessage(java.lang.String msg)
statusMessage
in interface FigCanvas
public void setStatusMessage(StatusMessage helper)
setStatusMessage
in interface FigCanvas
public void msg(java.lang.String msg)
msg
in interface FigCanvas
public void setConsole(ConsoleMessage printer)
setConsole
in interface FigCanvas
public void err(java.lang.String msg)
public void setBackground(java.awt.Color c)
setBackground
in interface FigCanvas
public void setGridColor(java.awt.Color c)
setGridColor
in interface FigCanvas
public java.awt.Color getBackground()
getBackground
in interface FigCanvas
public java.awt.Color getGridColor()
getGridColor
in interface FigCanvas
public java.awt.Point getMousePosition()
getMousePosition
in interface FigCanvas
public void showRulers(boolean b)
showRulers
in interface FigCanvas
public void setEnableRulerDragging(boolean b)
setEnableRulerDragging
in interface FigCanvas
public void mousePressed(java.awt.event.MouseEvent evt)
mousePressed
in interface FigCanvas
public void mouseReleased(java.awt.event.MouseEvent evt)
If 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 FigCanvas
public void mouseEntered(java.awt.event.MouseEvent evt)
mouseEntered
in interface FigCanvas
public void mouseExited(java.awt.event.MouseEvent evt)
mouseExited
in interface FigCanvas
public void mouseClicked(java.awt.event.MouseEvent evt)
mouseClicked
in interface FigCanvas
public void mouseMoved(java.awt.event.MouseEvent evt)
mouseMoved
in interface FigCanvas
public void mouseDragged(java.awt.event.MouseEvent evt)
However, 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 FigCanvas
public boolean gotFocus()
gotFocus
in interface FigCanvas
public void doPanning(int direction, boolean shift)
doPanning
in interface FigCanvas
public void paint(java.awt.Graphics g)
paint
in interface FigCanvas
public void print(java.awt.Graphics g)
public void printAll(java.awt.Graphics g)
public void paint(FigDrawable obj)
paint
in interface FigCanvas
public void paint(FigDrawable obj, int millis)
paint
in interface FigCanvas
public void repaint(int millis)
repaint
in interface FigCanvas
public void repaint()
public void repaint(int x, int y, int w, int h)
public void repaint(long millis, int x, int y, int w, int h)
public void synchronousRepaint()
synchronousRepaint
in interface FigCanvas
public void update(java.awt.Graphics g)
update
in interface FigCanvas
public void handleRedraw(java.awt.Graphics g)
handleRedraw
in interface FigCanvas
public void drawTmpObjects(java.awt.Graphics g)
drawTmpObjects
in interface FigCanvas
public void clippedDrawTmpObject(java.awt.Graphics g)
clippedDrawTmpObject
in interface FigCanvas
public void blitOffscreenBuffer(java.awt.Graphics g)
blitOffscreenBuffer
in interface FigCanvas
public void blitOffscreenBufferClipped(java.awt.Graphics g)
blitOffscreenBufferClipped
in interface FigCanvas
public void printTimingStats()
printTimingStats
in interface FigCanvas
public void doFullRedraw()
doFullRedraw
in interface FigCanvas
public void doFullRedraw(long millis)
doFullRedraw
in interface FigCanvas
public void doFullRedraw_deadlocks(long millis)
public void doSimpleRedraw()
doSimpleRedraw
in interface FigCanvas
public void doTextRedraw()
doTextRedraw
in interface FigCanvas
public void doObjectRedraw()
doObjectRedraw
in interface FigCanvas
public void doMotionRedraw()
doMotionRedraw
in interface FigCanvas
public void doSystemRedraw()
doSystemRedraw
in interface FigCanvas
public void doSyncRedraw()
This method should be overridden by subclasses as necessary.
doSyncRedraw
in interface FigCanvas
public void drawSlidersAndCursor(java.awt.Graphics g, boolean erase)
drawSlidersAndCursor
in interface FigCanvas
public void eraseObject(java.awt.Graphics g, FigObject object)
eraseObject
in interface FigCanvas
public void drawObject(java.awt.Graphics g, FigObject object)
drawObject
in interface FigCanvas
public void drawSlidersOnce(java.awt.Graphics g, int x, int y)
public void drawSliders(java.awt.Graphics g, boolean erase)
public final java.awt.Point getViewportWCmax()
getViewportWCmax
in interface FigCanvas
public FigBbox getVisibleRegionBoundingBox_OLD()
public FigBbox getVisibleRegionBoundingBox()
getVisibleRegionBoundingBox
in interface FigCanvas
public void drawAllObjects(java.awt.Graphics g)
drawAllObjects
in interface FigCanvas
g
- the graphics-context to draw into (e.g. the FigBasicCanvas
screen or the offscreenImage buffer).public void setGrid(int gridMode)
This function implies a full redraw, in order to generate the new grid.
setGrid
in interface FigCanvas
public void drawTriangles(java.awt.Graphics g, int xmax, int ymax)
public void drawRulers(java.awt.Graphics g)
public void getCurrentCanvasSize()
public void get_current_canvas_size()
public void initializeOffscreenBuffers()
In order to run jfig both as an applet or standalone application, we have to be a little cautious here: While the applet's browser will be visible, it will provide us with a working graphics context. The standalone application will only receive a graphics context, when its frame is fully constructed and finally visible. As we need some graphics context, before we can proceed to build the offscreen buffer images, this implies that we have to wait until the editor frame window is already show()ing.
I consider this to be a bad Java JDK-10 bug, but it may be a feature :-)
public boolean canvasSizeChanged()
public void flush()
FigCanvas
flush
in interface FigCanvas
public void clearBuffer(java.awt.Graphics g)
public void drawGrid(java.awt.Graphics gridGR)
gridGR
- the Graphics for drawing.public void drawGridViaCopyArea(java.awt.Graphics gridGR)
This method proved much faster than drawing all points on older JDKs, but has the SEVERE drawback of additional synchronisation issues, because copyArea() is not well documented and is implemented asynchronously by current JVMs.
public void drawGridByHand(java.awt.Graphics gridGR)
public static void main(java.lang.String[] argv)
public void doZoomFit()
FigCanvas
doZoomFit
in interface FigCanvas
public void doZoomOut()
doZoomOut
in interface FigCanvas
public void doZoomIn()
doZoomIn
in interface FigCanvas
public void doZoomFull()
doZoomFull
in interface FigCanvas
public void doZoom11()
doZoom11
in interface FigCanvas
public void doZoomRegion(int wx, int wy, int wx2, int wy2)
doZoomRegion
in interface FigCanvas
public void addZoomListener(ZoomListener zl)
addZoomListener
in interface FigCanvas
public void removeZoomListener(ZoomListener zl)
removeZoomListener
in interface FigCanvas
public void notifyZoomListeners()
notifyZoomListeners
in interface FigCanvas
public final void changeRubberbandMode(int new_mode)
changeRubberbandMode
in interface FigCanvas
public final void changeRubberbandMode(int new_mode, GeometryManager gm)
changeRubberbandMode
in interface FigCanvas
public final void changeRubberbandMode(int mode, FigTrafo2D t, java.lang.Object b)
changeRubberbandMode
in interface FigCanvas
public final void setRubberbandBasePoint(java.awt.Point sp)
setRubberbandBasePoint
in interface FigCanvas
public final void setRubberbandBasePoint(int sx, int sy)
setRubberbandBasePoint
in interface FigCanvas
public final void setRubberbandBasePoint2(java.awt.Point P)
setRubberbandBasePoint2
in interface FigCanvas
public final void setRubberbandBasePoint2(int sx, int sy)
setRubberbandBasePoint2
in interface FigCanvas
public final void setRubberbandAspect(double d)
setRubberbandAspect
in interface FigCanvas
public void doToggleRubberbandDebug()
doToggleRubberbandDebug
in interface FigCanvas
public void setRubberbandShowLineLengths(boolean b)
setRubberbandShowLineLengths
in interface FigCanvas
public void requestRenderQuality(boolean b)
requestRenderQuality
in interface FigCanvas
public void requestAntiAliasing(boolean b)
requestAntiAliasing
in interface FigCanvas
public FigBasicCanvas.Options2D getOptions2D()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |