?? readme.cursor4vport
字號:
/* * (C) 2001 by Argonne National Laboratory * See COPYRIGHT in top-level directory. *//* * @author Anthony Chan */The containment hierarchy of a zoomable winodw, e.g. TimelineFrame. Containment Hierarchy setCursor() TimelineFrame Wait Normal | +-----------------+--------------+------------+ | | | | ViewportTimePanel ScrollbarTime ViewportTimePanel ... Wait Normal | | ViewportTimeYaxis ViewportTime Wait ZoomPlus | | HandOpen | | CanvasTimeline RulerTime null null- Both CanvasTimeline and RulerTime are ScrollableObject.- ViewportTimeYaxis is subclass of ViewportTime.Since the goal of changing the cursor in TimelineFrame is to show userthe current status of the program and also what each component in theFrame can do. ViewportTime has 4 different statuses that indicate what it can do bytheir corresponding cursors which are ZoomPlus/ZoomMinus/HandOpen/HandClose.In no case, Viewport uses default cursor, i.e. Normal. These 4 cursors areonly valid in the ViewportTime's and their view objects, but not in anyother components in TimelineFrame. Since JViewport has only one child inits containment hierarchy (its only child is its view object), so thecursor set in view object affects that of JViewport, and vice versa.The default cursor for the other components in TimelineFrame exceptViewportTime's is always the system default, i.e. Normal.The view object needs to do some pretty time consuming operations likereading data from the disk, and rendering of numerous drawables. Soview object need to have its cursor turned to hourly glass, i.e Wait cursor,to indicate it is doing some expensive operation. Since there are severalcomponents in the zoomable window that can cause these expensive operationslike zoom in/out buttons in TimelineToolBar, ScrollbarTime and even scrollingof the RulerTime. So turning to Wait cursor needs to be on all childrencomponents under TimelineFrame including ViewportTime and its view object.In order to achieve all of the above, we override the Component.setCursor()in ScrollableObject, i.e. RulerTime and CanvasTimeline, so the cursor ofScrollableObject is always null. This allows the cursor of theScrollableObject's parent, ViewportTime, to be used as the cursor ofScrollableObject. We also override the Component.setCursor() inViewportTime, so when the new cursor is Normal, Viewport's cursor shouldbe either ZoomOpen or HandOpen depending on the LeftMouse mode. That waysubclass of ScrollableObject, i.e. RulerTime/CanvasTimeline, can usesetCursor(Wait) and setCursor(Normal) recursively decending from the topcontainer, TimelineFrame, to set appropriate cursors on all the components.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -