|
||||||||||
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.TopLeftRulerCanvas
hades.gui.AWTObjectCanvas
AWTObjectCanvas - the main display/edit canvas for the HADS schematic editor, constructed from an JavaFIG drawing canvas with additional popup-menu and redraw functions.
AWTObjectCanvas also provides a mechanism for synchronous repaints of all objects that have registered themselves by calling the paint( FigObject) method.
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 | |
static int |
MAX_REPAINT_INDEX
|
protected int |
n_repaintOverflows
|
protected int |
n_repaintTableEntries
|
protected int |
n_repaintTables
|
(package private) static java.lang.String |
versionString
|
Fields inherited from class jfig.canvas.FigBasicCanvas |
backgroundColor, BASE_ANCHOR_X, BASE_ANCHOR_Y, cur_height, cur_width, cur_x, cur_y, debug, defaultColor, defaultCursor, enableRulerDragging, enableTimingInfo, gridColor, gridGR, hasRulers, objectEnumerator, objectGR, offscreenGR, old_x, old_y, redrawMode, RULER_XL_OFFSET, RULER_XR_OFFSET, RULER_YB_OFFSET, RULER_YT_OFFSET, trafo, waitCursor |
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 | |
AWTObjectCanvas(Editor _editor)
create an empty AWTObjectCanvas, that is without objects so far. |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
|
void |
bufferedSyncRedraw()
|
void |
clearRepaintArray()
|
int |
countExecutedSyncRepaints()
|
int |
countPendingRepaints()
|
int |
countRepaintTableEntries()
|
int |
countSyncRepaintOverflows()
|
void |
createMenuShortcuts()
|
void |
doPanning(int direction,
boolean shift)
automatic panning of the visible viewport on the world-coordinate system. |
void |
doSyncRedraw()
method stub for synchronous repaints: FigCanvas itself just provides a doSimpleRedraw(). |
void |
doZoomIn14()
zoom in by a factor of two. |
void |
doZoomLandscapeA4(FigBbox bbox)
fit all objects to "Landscape A4 paper". |
void |
doZoomOut07()
|
void |
doZoomRegion(FigBbox bbox)
fit objects to this AWTObjectCanvas. |
void |
doZoomRegionBroken(FigBbox bbox)
|
java.awt.Menu |
findMenu(java.awt.Menu parent,
java.lang.String menuname)
|
java.awt.Menu |
findMenuSlow(java.awt.Menu parent,
java.lang.String menuname)
find a top-level submenu of our popup menu |
boolean |
getEnablePopup()
|
java.awt.Point |
getPopupPosition()
return the screen-coordinate position of the last popup-menus invocation |
java.awt.Point |
getPopupPositionWC()
return the world-coordinate position corresponding to the last popup-menus invocation |
java.awt.Point |
getPopupPositionWCsnapped()
|
SyncRedrawTimer |
getSyncRedrawTimer()
|
java.lang.String |
getToken(java.util.StringTokenizer st)
|
boolean |
isPopupShowing()
|
boolean |
isToolTipsEnabled()
|
static void |
main(java.lang.String[] argv)
main(): simple self test of FigBasicCanvas inside a Frame. |
void |
mouseMoved(java.awt.event.MouseEvent mme)
Handle mouseMove events: update sliders/cross hatch, provide rubberbanding |
void |
mousePressed(java.awt.event.MouseEvent e)
mousePressed(): intercept mouse clicks and show the context-Popup Menu, if triggered. |
void |
mouseReleased(java.awt.event.MouseEvent e)
mouseReleased(): intercept mouse release events. |
void |
paint(FigDrawable obj)
add a paint-request from an animated object the the repaintStack. |
void |
paint(FigDrawable obj,
int millis)
repaint an (animated) object within millis milliseconds. |
java.lang.String |
printRepaintStatus()
|
void |
setEnablePopup(boolean b)
|
void |
setEnablePopupOnNextMouseRelease()
re-enable the popup-menu on the next mouseReleased() event. |
void |
setPopupPosition(java.awt.Point sp,
java.awt.Point wp)
NOTE: do not call this method. |
void |
setToolTipsEnabled(boolean b)
|
void |
sleep(int millis)
|
Methods inherited from class jfig.canvas.TopLeftRulerCanvas |
drawGrid, drawRulers, drawSlidersOnce, setRulerOffsets |
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 |
Field Detail |
static final java.lang.String versionString
public static final int MAX_REPAINT_INDEX
protected int n_repaintTables
protected int n_repaintTableEntries
protected int n_repaintOverflows
Constructor Detail |
public AWTObjectCanvas(Editor _editor)
The popup menu is created dynamically from an external text file, whose location is taken from the SetupManager property "Hades.Editor.PopupMenuResource". The default location is "/hades/gui/PopupMenu.txt".
Method Detail |
public SyncRedrawTimer getSyncRedrawTimer()
getSyncRedrawTimer
in interface ObjectCanvas
public java.lang.String getToken(java.util.StringTokenizer st) throws java.lang.Exception
java.lang.Exception
public java.awt.Menu findMenu(java.awt.Menu parent, java.lang.String menuname)
public java.awt.Menu findMenuSlow(java.awt.Menu parent, java.lang.String menuname)
public void createMenuShortcuts()
public boolean isPopupShowing()
isPopupShowing
in interface ObjectCanvas
public java.awt.Point getPopupPosition()
getPopupPosition
in interface ObjectCanvas
public java.awt.Point getPopupPositionWC()
getPopupPositionWC
in interface ObjectCanvas
public java.awt.Point getPopupPositionWCsnapped()
getPopupPositionWCsnapped
in interface ObjectCanvas
public void setPopupPosition(java.awt.Point sp, java.awt.Point wp)
setPopupPosition
in interface ObjectCanvas
public void setEnablePopup(boolean b)
setEnablePopup
in interface ObjectCanvas
public boolean getEnablePopup()
getEnablePopup
in interface ObjectCanvas
public void setEnablePopupOnNextMouseRelease()
This method is a quick fix and workaround for the different popup-menu trigger semantics on X11/Unix and Windows platforms. In a few Hades editor commands (like create object or move object), a right mouse button is used to cancel the command - on the mousePressed event. After canceling the command, we have to re-enable the popup menu. However, doing this right away from the mousePressed callback would instantly display the popup menu on the next mouseReleased event, which is annoying on Windows.
The workaround is to call this method instead of setEnablePopup(true) from the mousePressed callback. We just set our internal enablePopupOnNextMouseRelease flag and check for it in our own mouseRelease handler.
setEnablePopupOnNextMouseRelease
in interface ObjectCanvas
public boolean isToolTipsEnabled()
isToolTipsEnabled
in interface ObjectCanvas
public void setToolTipsEnabled(boolean b)
setToolTipsEnabled
in interface ObjectCanvas
public void mouseMoved(java.awt.event.MouseEvent mme)
FigBasicCanvas
mouseMoved
in interface FigCanvas
mouseMoved
in class FigBasicCanvas
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface FigCanvas
mousePressed
in class TopLeftRulerCanvas
public void mouseReleased(java.awt.event.MouseEvent e)
If the enablePopupOnNextMouseRelease flag is set, we just set the enablePopup flag and return right away. This extra complication is necessary to handle the "editor command canceled by right mouse button click" situation on Windows. If the enablePopupOnNextMouseRelease flag is not set, we just check the value of the enablePopup flag and check whether the current MouseEvent is a popup trigger event. If it is not, we dispatch to our superclass mouseReleased handler.
mouseReleased
in interface FigCanvas
mouseReleased
in class TopLeftRulerCanvas
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
public void doPanning(int direction, boolean shift)
doPanning
in interface FigCanvas
doPanning
in class FigBasicCanvas
public void doZoomIn14()
public void doZoomOut07()
public void doZoomRegionBroken(FigBbox bbox)
public void doZoomRegion(FigBbox bbox)
public void doZoomLandscapeA4(FigBbox bbox)
doZoomLandscapeA4
in interface ObjectCanvas
public void paint(FigDrawable obj)
paint
in interface FigCanvas
paint
in class FigBasicCanvas
public void paint(FigDrawable obj, int millis)
paint
in interface FigCanvas
paint
in class FigBasicCanvas
public void clearRepaintArray()
clearRepaintArray
in interface ObjectCanvas
public int countPendingRepaints()
countPendingRepaints
in interface ObjectCanvas
public int countRepaintTableEntries()
public int countSyncRepaintOverflows()
countSyncRepaintOverflows
in interface ObjectCanvas
public int countExecutedSyncRepaints()
countExecutedSyncRepaints
in interface ObjectCanvas
public void bufferedSyncRedraw()
public java.lang.String printRepaintStatus()
public void doSyncRedraw()
FigCanvas
This method should be overridden by subclasses as necessary.
doSyncRedraw
in interface FigCanvas
doSyncRedraw
in class FigBasicCanvas
public void sleep(int millis)
public static void main(java.lang.String[] argv)
FigBasicCanvas
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |