Morphic 中的 Morph 和 Cocoa 中的 NSView 有什么区别?

发布于 2024-09-30 07:09:51 字数 26 浏览 7 评论 0 原文

我想了解 Morphic 的独特之处。

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

太阳男子 2024-10-07 07:09:51

Morphic 远比 NSView 或任何其他图形类简单地允许重新实现一组有限的功能要重要得多。 Morphic 是一个可塑性极强的 UI 构建工具包。 Morphic 背后的一些设计思想明确了这一意图:

  • 包含了 2D 坐标系的综合层次结构。它们不限于笛卡尔或线性。有用的非线性坐标系包括极坐标、对数、双曲和地理(类似地图)投影。
  • 将坐标系的处理与变形本身分开。变形应该只需要选择它的首选坐标系,而不需要将它绘制的每个点本身转换为世界坐标。它的#drawOn:方法及其子变形的位置都在它自己的坐标系中表示。
  • 完全独立于显示属性,例如尺寸或分辨率。没有像素的概念。 GUI 被认为是更高层次的。所有 GUI 都与像素分辨率无关。所有渲染都是抗锯齿的。
  • 分离坐标系可以简化变形的移动、缩放和旋转。
  • 所有坐标都是浮点数。这有利于允许完全任意的比例而没有显着的舍入误差。
  • Morph 层次结构不是形状的层次结构。变形没有边界或颜色的概念。子变形对齐没有一般概念。特定的变形可以以任何对其自身有意义的方式实现这些。
  • Morphic 事件处理非常灵活,允许您将事件发送到任意对象。该对象不需要 Morph 的子类。

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:

  • 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.
深海夜未眠 2024-10-07 07:09:51

警告:Smalltalk 的实时动态环境是一个红色药丸。静态、冻结的语言对您来说永远不会一样;-)

简而言之:Morphic 是一个虚拟世界,您可以在其中直接探索活动对象(只需就像现实世界一样)。您是否曾经在查看用户界面时......

  • 想知道“哇,这真的很酷!他们是怎么做到的?”
  • kvetch“我希望他们已经做了X!”

虽然这些想法在任何其他环境中都会导致痛苦和沮丧,但在 Morphic 中却并非如此。

如果您想大吃一惊,成为 Morphic 世界中的神:

  1. 启动 Pharo 图像,然后单击背景(实际上是“世界”)以调出世界菜单:

    alt text

  2. 在菜单选项之一上调出“光环” (在我的 Mac 上按住 Shift+Alt+单击):
    alt text

  3. 拖动“拾取”光环(中上)并将其放在世界的某个地方:
    alt text

  4. 享受您的菜单项,现在您可以在任何想要的地方使用它:
    alt text

说真的,单击它并观看浏览器打开!

您是否曾经有过一个总是使用的选项,供应商已经深埋了三级菜单?这能有用吗?!这是像 Morphic 这样的实时直接 GUI 环境的强大功能的一瞥​​。

如果您感兴趣,请阅读约翰·马洛尼和约翰·马洛尼的著作。兰德尔·史密斯 (Randall Smith) 的论文 直接性和形态用户界面构建环境中的活跃度< /a>

Warning: Smalltalk's live dynamic environment is a red pill. Static, frozen languages will never be the same for you ;-)

In a nutshell: Morphic is a virtual world where you can directly explore live objects (just like the real world). Did you ever look at a UI and...

  • wonder "wow, that's really cool! How did they do that?"
  • kvetch "I wish they had done X instead!"

While these thoughts would lead to pain and frustration in any other environment, not so in Morphic.

If you want to blow your mind, become a god in a Morphic world:

  1. Launch a Pharo image, and click on the background (which is actually the "World") to bring up the world menu:

    alt text

  2. Bring up the "halos" on one of the menu options (shift-alt-click on my Mac):
    alt text

  3. Drag the "Pick Up" halo (top-middle) and drop it somewhere in the world:
    alt text

  4. Enjoy your menu item which is now available wherever you want it:
    alt text

Seriously, click it and watch the Browser open!!

Ever have an option you always use that a vendor has buried three-menu-levels deep? Could this be useful?! This is a glimpse of the power of a live direct GUI environment like Morphic.

If you're intrigued, read John Maloney & Randall Smith's paper Directness and Liveness in the Morphic User Interface Construction Environment

初见你 2024-10-07 07:09:51

标题没有反映您的问题,因此我回答您的问题而不是标题。
过去两天我阅读了有关 Morphic 的内容,并以我认为 Morphic 的特殊之处作为结束语。

Morphic 非常适合实时编码。这是一种直接映射,当代码更改时,屏幕上的输出也会更改。和/或如果屏幕上的变形发生更改(拖动),则代码中的值也会发生更改。这在艺术表演中真是太酷了!

但 Morphic 的目标是更高的抽象。变形的属性是从代码中抽象出来的。对文件或 SoC 执行操作mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch" rel="nofollow noreferrer">获取服务器端数据库。

我认为 WebStorage 和 JavaScript 文件是存储交互更改的 Morph 属性的活跃状态的不错选择。你看,编程是通过每个 Morph 完成的。然后代码只需要处理来自单击和拖动的事件。

研究的目标甚至已经将代码抽象化了。可以通过变形来完成编码,以定义单击或拖动时发生的情况。变形可以像 Scratch 中的拼图一样。

程序必须备份到某个地方的文件中。我认为在云上进行编码并不安全。因此 JS 文件是唯一的选择(如果不设置服务器是一个选项),因为本地不允许数据文件,甚至不允许与 Web 应用程序位于同一文件夹中。同源策略意味着同一服务器 - 不是同一文件夹。

当应用启动 Javascript 文件(或 Web Storage 时第一名)将建立变形世界。用户与那个世界互动。新状态可以存储在 WebStorage 中并通过下载进行备份。

您可以使用 Lively Kernel 作为文件中的语言或存储变形对象中的数据或任何您认为最容易生成为要下载的文件的数据。

那么这有什么特别之处呢?我不会重复已接受的答案,但这是我的结论:

  • 您在 Morphic 屏幕上看到的所有内容都是变形。
  • 变形树称为世界
  • 每个变形的坐标、尺寸和属性都从代码中抽象到树中。
  • 该研究的目的还在于抽象出代码。

The title do not map your question, so I answer your question and not the title.
I have read about Morphic the last two days and conclude with what I think makes morphic special.

Morphic is perfect for live coding. That is a direct mapping such that when code is changed the output on the screen change. And/or if morphs on screen is changed (draged) the values in the code is changed. That is cool in art performance!

But Morphic aims for higher abstractions than that. The properties of the morphs is abstracted away from the code. Do the SoC to a file or fetch a server-side database.

I suppose WebStorage and JavaScript file is a good option to store the liveness state of the Morph properties changed interactively. You see - programming is done through each Morph. Then the code need only to handle events from click and drag.

The aim for research has even abstracted the code away. Coding can be done through the Morph to define what happen with click or drag. Morphs can be puzzle pieces as in Scratch.

A program has to be backed up into a file somewhere. I don't consider to do coding on a cloud as safe. So a JS-file is the only alternative (if not setting up a server is an option), because datafiles is not allowed locally, not even in same folder as the web app. The Same Origin policy means same server - not same folder.

When the app starts the Javascript file (or Web Storage in first place) will set up the world of morphs. User interacts with that world. The new state can be stored in WebStorage and bacuped by a download.

You can use Lively Kernel as the language in the file or store the morph data in an object or whatever you find simplest to generate as a file to download.

So what is special with this? I am not repeat the accepted answer, but this is my conclusion:

  • Everything you see on the Morphic screen is a morph.
  • The tree of morphs is called a world.
  • The coordinate, dimension and properties of each morph is abstracted away from the code into the tree.
  • The research aims for abstract away the code too.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文