Morph在Morphic和NSView在Cocoa之间的区别是什么? [英] What is the difference between a Morph in Morphic and a NSView in Cocoa?

查看:169
本文介绍了Morph在Morphic和NSView在Cocoa之间的区别是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道使Morphic特别的东西。

I'd like to know about the things that make Morphic special.

推荐答案

Morphic比NSView其他图形类,只需允许重新实现有限的功能集。 Morphic是一个极具延展性的UI构建工具包。 Morphic背后的一些设计理念使这个意图清楚:

Morphic is much more than NSView or any other graphics class that simply allow the re-implementation of a limited set of features. Morphic is an extremely malleable UI construction kit. Some design ideas behind Morphic makes this intention clear:


  • 包括2D坐标系统的综合层次。它们不限于笛卡尔或线性。有用的非线性坐标系包括极坐标,对数坐标,双曲线和地理(映射)投影。

  • 坐标系统与变形本身的处理分离。变形应该只需要选择其首选坐标系,而不需要将其绘制的每个点转换为世界坐标本身。 #drawOn:方法和其子变形的位置在其自己的坐标系中表示。

  • 完全独立于显示属性例如尺寸或分辨率。没有像素的概念。 GUI被认为在更高的层次。所有的GUI是独立的像素分辨率。所有渲染均为消除锯齿。

  • 分隔坐标系统简化了变形的移动,缩放和旋转。

  • 所有坐标都是浮点数。这对于允许完全任意的缩放而没有明显的舍入误差是有好处的。

  • Morph层次结构不是形状的层次结构。变形没有边框或颜色的概念。没有一般的亚基准则的概念。

  • 变形事件处理是灵活的,允许您将事件发送到任意对象。该对象不需要子类化Morph。

  • A comprehensive hierarchy of 2D coordinate systems is included. They are not restricted to Cartesian or linear. Useful nonlinear coordinate systems include polar, logarithmic,hyperbolic and geographic (map like) projections.
  • Separation of the handling of coordinate systems from the morphs themselves. A morph should only need to select its preferred coordinate system, instead of needing to convert every point it draws to World coordinates by itself. Its #drawOn: method and the location of its sub-morphs are expressed in its own coordinate system.
  • Complete independency of Display properties such as size or resolution. There is no concept of pixel. The GUI is thought at a higher level. All the GUI is independent of pixel resolution. All the rendering is anti aliased.
  • Separating the coordinate system eases the moving, zooming and rotation of morphs.
  • All coordinates are Float numbers. This is good for allowing completely arbitrary scales without significant rounding errors.
  • The Morph hierarchy is not a hierarchy of shapes. Morphs don't have a concept of a border or color. There is no general concept of submorph aligning. A particular morph may implement these in any way that makes sense for itself.
  • Morphic event handling is flexible and allows you to send events to arbitrary objects. That object need not subclass Morph.

这篇关于Morph在Morphic和NSView在Cocoa之间的区别是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆