MICAPS中天气图交互制作子系统

Subsystem for Interactively Drawing Synoptic Chart in MICAPS

  • 摘要: 该文详细讨论了MICAPS中天气图交互制作子系统主要功能的实现技术与方法,包括使用组合设计模式定义图形对象,得到的类结构体现了图形对象之间的联系,不仅使代码可复用性较高,而且便于新类型图形对象的加入;使用状态设计模式设计了图形对象交互绘制过程的程序结构,既为用户提供了自定义手势事件功能,又增加了程序代码的可读性和可维护性;提出了修改曲线型图形对象的算法;使用命令设计模式实现了编辑图形对象的撤销/重做功能和软件系统运行日志,提高了软件系统的易用性和可靠性;讨论了编辑文档的自动保存功能的实现方法。通过以上功能的实现,天气图交互制作子系统方便用户操作,具有较高的运行效率和可靠性。

     

    Abstract: A subsystem is developed for interactively drawing synoptic chart to solve issues in previous versions of MICAPS and meet new user requirements. First of all, the composite design pattern is used to define the class hierarchy that describes graphical objects. This class hierarchy fits well with the relation among different graphical objects and therefore reduces the spatial complexity of the program, making manipulations to graphical objects much easier to implement. Thanks to the polymorphism feature provided by modern object-oriented programming languages, clients manipulating the graphical objects can treat all objects in this composite structure uniformly. The consequential benefit of this design advantage in practice is that the client code does not need to be modified when new types of graphical objects are introduced. This is especially useful for developers to define customized graphical object in their own applications. Above all, the proposed class hierarchy not only promotes code reusability, but also makes it easy to add new types of graphical objects. The code that draws rubber band graphical objects is constructed using the state design pattern, in which the behavior of drawing a particular type of graphical object is implemented in the corresponding class. The advantage of this approach is that introducing new types of graphical objects only require deriving new subclass and does not affect existing code. In addition, the gesture event class is proposed to represent the start, continue and end gestures in the rubber band drawing. In this way, the gestures can be customized at runtime by users. On the contrary, if the conventional code structure using large conditional statements is employed for rubber band drawing as in the previous implementation, the code complexity will increase dramatically when new types of graphical objects are introduced and the code defining the gestures has to be modified when user changes these gestures. The disadvantage makes it difficult to extend, debug and maintain the code. An algorithm to modify linestrip-type graphical objects, in particular isolines, is proposed. By taking advantage of the smoothness constraint, the proposed algorithm is able to solve the ambiguity in isolines modification and make the modified result meet the user expectation. The command design pattern is employed to implement undo/redo and runtime logging. The former feature facilitates users manipulation and the latter feature can restore the program session to the last successful state after the program quits abnormally. These two features enhance usability and reliability of the program. The implementation of automatically saving edited document which ensures the integrity of the documents is discussed. With all these features implemented, the proposed system not only facilitates users manipulation but provides good performance and reliability as well.

     

/

返回文章
返回