简体   繁体   English

设计模式以预览命令模式的效果

[英]Design pattern to preview the effect of the Command pattern

What are the existing patterns that allow to preview the effect of the Command pattern on the Model, with acceptable performance (ie no lag in a traditional WIMP GUI) in case of continuous changes of the Command ? 在连续更改Command的情况下,可以使用哪些现有模式来预览Command模式对模型的影响,并具有可接受的性能(即,在传统WIMP GUI中没有滞后)? For instance in the case of an actualisation of the Command every time a mouse event is received. 例如,在每次接收到鼠标事件时都实现命令的情况。

original post : We are designing and prototyping a multimedia edition software, and we are facing a problem : we use the command pattern for undo - redo, but we cannot find a way that seems efficient for having a real-time feedback when the user changes something in the GUI. 原始文章: 我们正在设计和制作多媒体版软件的原型,并且我们面临一个问题:我们使用命令模式进行撤消-重做,但是当用户更改时,我们找不到一种能够实时获得实时反馈的有效方法GUI中的某些内容。 For instance, let's say that you have a box that contains some data, which can be resized. 例如,假设您有一个包含一些数据的框,这些框可以调整大小。 However, the resizing of the Box might imply more that a simple image scaling : a bigger Box could imply apparitions of new elements inside. 但是,调整Box的大小可能意味着更简单的图像缩放:更大的Box可能暗示了内部新元素的出现。 But this cannot be known before asking the Box model to perform the effective change of its size, since it will in turn call for an update of its underlying components. 但这在要求Box模型执行有效更改其大小之前是未知的,因为它将依次要求更新其基础组件。 How, in this case, can we make a "fluid" user interface where the user can resize the Box and see how it changes inside in real time, with only a single Command applied at the end ? 在这种情况下,我们如何制作一个“流体”用户界面,使用户可以调整Box的大小并实时查看其内部变化,而最后只应用一个Command呢?

Edit (2015-09-05) : I found another possible design in the book Object-Oriented Programming for Graphics ( http://www.springer.com/us/book/9783642791949 ), especially in the chapter 14 (An Object-Oriented Architecture for Constraint-Based Graphical Editing). 编辑(2015-09-05):我在《 面向对象的图形编程》http://www.springer.com/us/book/9783642791949 )一书中找到了另一种可能的设计,尤其是在第14章中面向基于约束的图形编辑的面向架构)。

Original : I found an answer (which may not be the best, hence I'm not accepting it since it is an open question) in the following french research paper : 原文:我在以下法国研究论文中找到了一个答案(可能不是最好的答案,因为它是一个开放性问题,所以我不接受它):

Blouin, Arnaud, and Olivier Beaudoux. 
"Malai: un modèle conceptuel d'interaction pour les systèmes interactifs." 
Proceedings of the 21st International Conference on Association Francophone d'Interaction Homme-Machine. 
ACM, 2009.

The relevant part is "Feedback intérimaire de l'action" on page 7; 相关的部分是第7页的“反馈行动”。 a state machine is used to represent the running state of the interaction with the software. 状态机用于表示与软件交互的运行状态。

However it involves a big departure from an MVP + Command pattern model. 但是,它与MVP + Command模式模型有很大的出入。

English version : 英文版 :

Blouin, Arnaud, and Olivier Beaudoux. 
"Improving modularity and usability of interactive systems with Malai." 
Proceedings of the 2nd ACM SIGCHI symposium on Engineering interactive computing systems. 
ACM, 2010.

Link : https://hal.archives-ouvertes.fr/file/index/docid/477627/filename/BLOUIN10a.pdf 链接: https : //hal.archives-ouvertes.fr/file/index/docid/477627/filename/BLOUIN10a.pdf

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM