官术网_书友最值得收藏!

Chapter 4. Working with Shapes and Figures

In this chapter, we develop a program capable of drawing lines, arrows, rectangles, and ellipses. The application can be viewed as a more advanced version of the circle application. Similar to the circle application, we have a list of figures and we catch the user's mouse actions. However, there are four different kinds of figures: lines, arrows, rectangles, and ellipses. They are defined in a class hierarchy that is similar to but more advanced than the hierarchy in the Tetris game. Moreover, we also introduce cut, copy, paste, cursor control, and registry handling:

The user can add new figures, move one or several figures, modify figures by grabbing their endpoints, mark and unmark figures by pressing the mouse button and the Ctrl key, and mark several figures by enclosing them by a rectangle. When a figure is marked, it becomes annotated with small black squares. The user can modify the shape of a figure by grabbing one of the squares. The user can also move a figure by grabbing some other part of the figure.

主站蜘蛛池模板: 临漳县| 东兰县| 伊吾县| 长岛县| 扶沟县| 中牟县| 永新县| 广灵县| 五华县| 宁国市| 鲜城| 周宁县| 阳朔县| 宁明县| 邢台市| 施甸县| 南和县| 柘荣县| 耒阳市| 玉环县| 扎赉特旗| 尚义县| 黄梅县| 德惠市| 昭平县| 和平县| 乐平市| 沾益县| 深水埗区| 天镇县| 长宁区| 大同县| 兰西县| 藁城市| 富蕴县| 邛崃市| 鸡东县| 河西区| 福海县| 日照市| 澎湖县|