tailieunhanh - professional java user interfaces phần 10
Một tương tác ví dụ Giả sử người dùng đã thực hiện một số thao tác trên các đối tượng được hiển thị trong Hình . Đầu tiên hoàn tác luân chuyển trên bitmap bằng cách sử dụng menu ngữ cảnh, như trong Hình ví dụ phần Ad-Hoc Hãy thử mở các tập tin thực thi, và vui chơi với các chương trình thực tế. | 572 An Example Ad-Hoc Component Try launching the executable file and have fun with the actual program. An example interaction Suppose the user has already performed some manipulations on the objects shown in Figure . First undo the rotation on the bitmap using the contextual menu as in Figure . Figure Undoing a rotation Liquid Note that in the interaction example the clipboard is not used - that is nothing was cut or copied so the paste command remains disabled. New lines are added just like objects of the type image by clicking on the relevant tool button then clicking in the sandbox area where the new line is to be placed. Double-clicking on a line allows its control points to be edited as shown in Figure . Control points are moved by dragging them with the mouse. Line editing mode is disabled by selecting another object or by clicking somewhere else on the sandbox area. To add new control points to a line when in edit mode the mouse right button and the control key are used together. The Sandbox architecture 573 Figure Modifying the control points of a poly-line Liquid The Sandbox architecture Now we can look at the implementation of the Sandbox component. Chapter 2 introduced the OOUI approach mentioning its usefulness both as a means for designing the GUI as well as a way to organize the resulting implementation. The OOUI approach can be used as a fully-fledged composable unit strategy2. The software design discussed here is arranged around the development of the ad-hoc component using a top down functional partition. Figure shows an initial high-level division of the software design. A common approach in many architectures is to separate the domain definition from the application logic - that is the functionalities made up of simpler low-level features that expose the domain to users3. An e-mail inbox for example represents the generic domain of an archive of e-mails. Possible actions in such a domain depend on the
đang nạp các trang xem trước