欢迎来到第壹文秘! | 帮助中心 分享价值,成长自我!
第壹文秘
全部分类
  • 幼儿/小学教育>
  • 中学教育>
  • 高等教育>
  • 研究生考试>
  • 外语学习>
  • 资格/认证考试>
  • 论文>
  • IT计算机>
  • 法律/法学>
  • 建筑/环境>
  • 通信/电子>
  • 医学/心理学>
  • ImageVerifierCode 换一换
    首页 第壹文秘 > 资源分类 > PPT文档下载
    分享到微信 分享到微博 分享到QQ空间

    lexi设计案例分析.ppt

    • 资源ID:171646       资源大小:966.50KB        全文页数:76页
    • 资源格式: PPT        下载积分:10金币
    快捷下载 游客一键下载
    账号登录下载
    三方登录下载: 微信开放平台登录 QQ登录
    下载资源需要10金币
    邮箱/手机:
    温馨提示:
    快捷下载时,如果您不填写信息,系统将为您自动创建临时账号,适用于临时下载。
    如果您填写信息,用户名和密码都是您填写的【邮箱或者手机号】(系统自动生成),方便查询和重复下载。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP,免费下载
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    lexi设计案例分析.ppt

    1第2章 实例研究:Lexi 文档编辑器 A WYSIWYG document editor. Mix text and graphics freely in various formatting styles. The usual Pull-down menus Scroll bars Page icons for jumping around the document. 通过本实例设计,学习设计模式的实际应用22.1 设计问题 Lexi设计的7个问题 1 文档结构:对文档内部表示的选择几乎影响Lexi设计的每个方面。 2 格式化 3 修饰用户界面 4 支持多种视感标准 5 支持多种窗口系统 6 用户操作 7 拼写检查 上述每个问题都有一组相关联的目标集合和限制条件集合。32.2 文档结构 目标 保持文档的物理结构。即将文本和图形安排到行、列和表等。 可视化生成和显示文档。 根据显示位置来映射文档内部表示的元素。 限制条件 应该一致地对待文本和图形。 应该一致地对待简单元素和复合元素。 但文本分析依赖于被分析对象的类型。4解决方案:递归组合递归组合:Building more complex elements out of simpler ones. 行列(段落)页 (P24 第2段第2行)第5行第2列的第10个元素 The tenth element in line five of column two,隐含: Each object type needs a corresponding class All must have compatible interfaces (inheritance)图2 包含正文和图形的递归组合图3 递归组合的对象结构5Glyph (图元类)Base class for composable graphical objectsAn Abstract class for all objects that can appear in a document. Both primitive and composed.void insert(Glyph)void remove(Glyph)Glyph child(int)Glyph parent()管理子图元的接口boolean intersects(Coord, Coord)判断一个指定的点是否与图元相交void draw(Window*)Void Bounds(Rect)在窗口上表示自己返回图元占用的矩形面积操作任务基本接口:子类: Character, Image, Space, Row, Column 6图元类层次Note the inherent recursion in this hierarchywi.e., a Row is a Glyph & a Row also has Glyphs!7Glyph Interface and responsibilitiesGlyphs know how to draw themselvesGlyphs know what space they occupyGlyphs know their children and parentspublic abstract class Glyph / appearance public abstract void draw(Window w); public abstract Rect getBounds(); / hit detection public abstract boolean intersects(Point); / structure public abstract void insert(Glyph g, int i); public abstract void remove(Glyph g); public abstract Glyph child(int i); public abstract Glyph parent();8COMPOSITE 模式 object structural意图treat individual objects & multiple, recursively-composed objects uniformly适用objects must be composed recursively,and no distinction between individual & composed elements,and objects in structure can be treated uniformlyStructure9COMPOSITE 模式(contd) object structural效果+uniformity: treat components the same regardless of complexity+extensibility: new Component subclasses work wherever old ones do实现do Components know their parents?保持从子部件到父部件的引用能简化组合结构的遍历和管理uniform interface for both leaves & composites?最大化Component接口dont allocate storage for children in Component base classresponsibility for deleting children由Composite负责删除其子节点102.3 格式化 格式化:将一个图元集合分解为若干行 目标:自动换行 Breaking up a document into lines. Many different algorithms trade off quality for speed Complex algorithms 限制条件 Want to keep the formatting algorithm well-encapsulated. independent of the document structure can add formatting algorithm without modifying Glyphs can add Glyphs without modifying the formatting algorithm. Want to make it dynamically changeable.11Composition & CompositorCompositor base class abstracts linebreaking algorithm subclasses for specialized algorithms, e.g., SimpleCompositor, TeXCompositor 接口接口 格式化内容:格式化内容:void SetComposition(Composition*) 格式化:格式化:virtual void Compose()()Composition composite glyph supplied a compositor & leaf glyphs creates row-column structure as directed by compositor12Composition & Compositor一个未格式化的Composition对象只包含组成文档基本内容的可见图元,它并不包含像行和列这样决定文档物理结构的图元。 Composite对象只在刚被创建并以待格式化的图元进行初始化后的状态当Composition对象需要格式化时,调用它的Compositor的Compose操作。Compositor依次遍历Composition的各个图元,根据分行算法插入新的行和列图元。Generated in accordance with compositor strategies & do not affect contents of leaf glyphs13Compositor & CompositionCompositor class will encapsulate a formatting algorithm.14Compositor & Composition 分行算法封装 能增加新的Compositor子类而不触及Glyph类 可在运行时刻改变分行算法 在Composition接口中增加一个SetCompositor操作15STRATEGY模式 object behavioral意图define a family of algorithms, encapsulate each one, & make them interchangeable to let clients & algorithms vary independently适用性when an object should be configurable with one of many algorithms,and all algorithms can be encapsulated,and one interface covers all encapsulations 结构16STRATEGY模式 (contd) object behavioral效果+greater flexibility, reuse+can change algorithms dynamicallystrategy creation & communication overheadinflexible Strategy interfacesemantic incompatibility of multiple strategies used together实现exchanging information between a Strategy & its contextstatic strategy selection via templates172.4 修饰用户界面 Wish to add visible borders and scroll-bars around pages. Inheritance is one way to do it. leads to class proliferation BorderedComposition, ScrollableComposition, BorderedScrollableComposition inflexible at run-time Will have classes Border Scroller They will be Glyphs they are visible clients shouldnt care if a page has a border or not They will be composed. but in what order?182.4 修饰用户界面目标: add a frame around text composition add scrolling capability限制条件: embellishments should be reusable without subclassing, i.e., so they can be added dynamically at runtime should go unnoticed by clients19解决方案: “Transparent” Enclosure(透明围栏)Monoglyph:起修饰作用的图元的抽象类:起修饰作用的图元的抽象类 base class for glyphs having one child operations on MonoGlyph pass t

    注意事项

    本文(lexi设计案例分析.ppt)为本站会员(p**)主动上传,第壹文秘仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知第壹文秘(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

    copyright@ 2008-2023 1wenmi网站版权所有

    经营许可证编号:宁ICP备2022001189号-1

    本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。第壹文秘仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知第壹文秘网,我们立即给予删除!

    收起
    展开