- 浏览: 489211 次
- 性别:
- 来自: 深圳
文章分类
- 全部博客 (185)
- job (15)
- linux/windows/unix/bash/shell (31)
- JAVA/J2EE/spring/hibernate/struts (30)
- VC/C++ (48)
- mysql/postgresql (6)
- php/jsp/asp/pear (1)
- FMS/flex/openlaszlo/red5/openmeetings (34)
- apache/tomcat/ftp/svn (6)
- xen/vm/Hadoop/cloudcompute (6)
- visual studio/eclipse/zendstudi/ant (8)
- others (1)
- windows异常处理 __try __except (1)
- (1)
- matlab (4)
- android (0)
最新评论
-
hongzhounlfd:
很透彻,很详细
依赖注入和控制反转 -
jefferyqjy:
谢谢~言简意赅~很明了!
依赖注入和控制反转 -
elderbrother:
太好了,谢谢
依赖注入和控制反转 -
east_zyd_zhao:
终于搞明白了
依赖注入和控制反转 -
Dremeng:
完美,一看就懂理解透彻
依赖注入和控制反转
event是建立在对象之间通信的机制。比如当鼠标点击的时候,从服务器接受数据的时候,或者当view建立的时候。Events are the mechanism by which objects communicate with each other when something changes. For example, an event might be generated when a mouse button is clicked, or when data arrives from a server, or when a view has been constructed.
在LZX中,events不是广播,是使用delegates的点对点的通信。当事件发生的时候这些点是基本的功能点。
In LZX programs, events are not broadcast, but rather they are communicated in a point-to-point fashion using delegates
, which are basically function pointers that are referenced when events happen.
这种措施增加了灵活性和减少了使用events的负担。
This implementation increases flexibility and reduces the overhead of using events. However, for the purposes of the discussion in this chapter we're going to ignore delegates and speak of events in a slightly less 严密的方式, saying, for example when such-and-such an event occurs, thus and such happens, leaving aside for now an explanation of how it happens.
Views have 大约two dozen defined events, as listed on the entry for <view>
in the LZX Reference Manual. Many of these events that deal with user input, such as onblur
, onclick
, onkeydown
, will be familiar to JavaScript programmers. Other events, such as onheight
and onopacity
, pertain to views' visible attributes. Finally, the oninit
and onconstruct
events are related to the creation of the instances of view objects. Similarly, other system-defined LZX objects such as Datasets (see below) have events associated with them.
Events and attributes often 成对出现, and in fact, the default behavior of the setAttribute()
method is to set the named property and send the event called "on
" + property. For instance, when a view changes its x
(horizontal) position, it sends the event onx
with the new value for its x
property. This means that in addition to system-defined events, there exists an event for each attribute you define.
When an event happens, control is transferred to its associated event-handler (if one is defined). Events can be sent with a single argument, which usually conveys information about the property that changed.
Elsewhere in this Guide we discuss how events are implemented in LZX, and how the event architecture bears upon program design. In particular, Chapter 30, Delegates discusses the relationship between events and delegates.
In LZX, a method is a JavaScript function associated with a particular object.
Functions are invoked using the ()
operator. Thus,
<view name="dog"> <method name="bark"> <!-- some JavaScript code --> </method> </view>
Defines a function that is executed when invoked by name, as in
dog.bark();
In JavaScript, the this
keyword is used to refer to the object through which the function was invoked.
A handler is like a method. But whereas a method is invoked by its name, a handler must be associated with a particular event. The handler script will be executed when the referenced view receives an event with this name. For example,
<view> <handler name="onclick"> <!-- some JavaScript code --> </handler> </view>
defines a function that is executed when the view is clicked on. Consider
<view>
<method name="bark">
<!-- some JavaScript code -->
</method>
<handler name="onclick">
this.bark()
</handler >
</view>
When the view is clicked on, the onclick
event causes the execution of the handler()
which in turn invokes the method named bark()
. Event handlers are often identified in an opening tag, as in
<view onclick="clickHandler()"> <method name="clickHandler"> <!-- some JavaScript code --> </method> </view>
There are three general categories of methods and handler:
-
"On init" methods that are invoked when their parent object is created;
-
handlers that are invoked when their parent object receives a specified event;
-
named methods that are explicitly invoked by other methods.
Note that you can define a method using conventional JavaScript syntax, but in LZX the preferred way to declare a method is with the <method>
tag.
Also note that in LZX, unlike many other object-oriented systems, you can override a method in an instance of an object. This topic is covered in Chapter 33, Extending Classes.
发表评论
-
Red5安装和配置
2011-02-24 10:23 4013Red5安装和配置参考网页:http://www.cahblo ... -
基于Moodle平台的网站调查报告
2011-02-24 10:18 2533基于Moodle平台的网站调查报告 网站举例: ² 西南 ... -
moodle插件模块功能汇总
2011-02-24 10:03 4946Moodle官方提供654种插件或者模块moodle.org ... -
moodle 一体包安装手册(window)
2011-02-24 09:55 1252见附件 -
moodle中上传文件大小控制
2011-02-24 09:51 1804第一步:修改在php4下POST文件大小的限制1.编修php. ... -
linux下面安装moodle
2011-02-24 09:50 20531. 安装moodle运行 ... -
OpenMeetings安装文档
2011-02-15 11:09 2568OpenMeetings 是一个多语言可定制的视频会议和协作系 ... -
Compilation and Execution (openlaszlo)
2010-11-22 11:02 10227. Compilation and Exe ... -
Combining Tags and Script in LZX Programs (openlaszlo)
2010-11-22 11:01 12756. Combining Tags and ... -
Data Access, Manipulation, and Binding (openlaszlo)
2010-11-22 10:33 11615. Data Access, Manipu ... -
Constraints(openlaszlo)
2010-11-22 10:18 1095constraint 表示可变的变量赋值形式 In LZX, ... -
Dimdim&Moodle安装配置文档节选
2010-11-09 17:40 2514Dimdim&Moodle安装配置文档节选 ... -
Red5如何响应rmpt的请求,中间涉及哪些关键类?
2010-11-01 15:35 1507Red5如何响应rmpt的请求,中间涉及哪些关键类? 响应请 ... -
red5的eclipse插件和用法
2010-10-30 20:56 1105参见http://www.red5.org/wiki/Red5 ... -
red5集群分析
2010-10-28 19:42 49901. 边(Edge ): 1. 边的主要作用是管理连接,并可以 ... -
red5源代码分析
2010-10-26 08:59 3827Red5如何响应rmpt的请求 ... -
创建第一个red5程序
2010-10-25 15:33 21111.下载最新版本的RED5 http://osflash.or ... -
openlaszlo中多媒体组件介绍
2010-10-14 15:50 1095在openlaszlo中我们可以处理图像,音视频等媒体文件。详 ... -
openlaszlo组件的简单介绍
2010-10-14 15:50 1258openlaszlo组件的简单介绍 收藏 在写laszlo ... -
创建一个简单的openlaszlo程序
2010-10-14 15:49 1030前面说到过openlaszlo程序是一组xml格式和javas ...
相关推荐
OpenLaszlo is the leading open source platform for the development and delivery of rich Internet applications on the World Wide Web.
英文版的openlaszlo的使用手册,html格式的。 哪位如果能做成chm或者pdf的就更好了。 openlaszlo是RIA的一种实现,个人感觉比Flex要灵活的多。
OpenLaszlo —— 一个快速构建和部署富 Internet 应用程序的平台 -- Linux,C,C++,Java,Ajax,XML,perl,php,python,ruby,MySQL,Gnome,KDE,Qt,Gtk,bash,shell,嵌入式,网络,信息安全,操作系统,数据结构,编译原理
openlaszlo应用程序开发使用的是基于XML的LZX语言,它可以被编译成DHMTL,SWF等格式。 openlaszlo可作为openmeetings客户端的编译。 因安装程序90+MB,所以切分为两个压缩包。 openlaszlo-4.9.0-windows-dev-install....
Applet与Openlaszlo的通信。 采用此方式可以做相关的软件在线安装,上传,下载的FLASH效果。
openlaszlo应用程序开发使用的是基于XML的LZX语言,它可以被编译成DHMTL,SWF等格式。 openlaszlo可作为openmeetings客户端的编译。 因安装程序90+MB,所以切分为两个压缩包。 openlaszlo-4.9.0-windows-dev-install....
openlaszlo应用程序开发使用的是基于XML的LZX语言,它可以被编译成DHMTL,SWF等格式。 是openmeetings视频会议系统的默认开发编译工具。
这是用Openlaszlo开发的计算器程序,可以实现基本的计算操作。 我是刚学openlaszlo,欢迎朋友们提出宝贵意见!
使用OpenLaszlo构建J2EE中的RIA程序,高春阳,龚群侃,当前,Web 应用程序就要进入了一个新的时期,富互联网客户端(RIA ,Rich Internet Application) 以其极大地用户交互性、优秀的外观设计、良好��
OpenLaszlo is an increasingly popular open-source platform for the development and delivery of rich internet applications across multiple platforms: Flash, DHTML, and J2ME. The dramatic emergence of ...
Geoar - WMS/WFS OpenLaszlo 客户端GeoAr 是 WMS 和 WFS 服务的富客户端实现。 它是在 LZX (OpenLaszlo) 上开发的,因此它向用户的浏览器提供 dhtml 或 flash,从而提供在它们之间进行选择的机会,但只有一个服务器...
OpenLaszlo是一个开放源代码平台,用于创建单页应用程序,这些应用程序可以编译为Flash或HTML5进行Web部署。 该项目的站点位于http://openlaszlo.org。
这是Laszlo与web的PPT! 希望对希望让laszlo与web结合的朋友有所帮助!
js openlaszlo智能提示,很好用的工具,这是eclipse的插件
PhMeetings是基于开源WEB视频会议系统OpenMeetings开发的一个实验性...由于资料的缺乏以及对OpenLaszlo编程的陌生,其中艰辛不足为外人道。今日发一声感慨:如果你想折磨一个程序员,那就让他去干开源软件的二次开发!
api c++ 火焰效果 绚丽的效果,而openlaszlo最终也是编译成swf来运行
FlashBuilder开发工具,是开发java网页及OpenLaszlo,Laszlo富客户端必备工具。本人安装在电脑运行正常。
FlashBuilder开发工具,是开发java网页及OpenLaszlo,Laszlo富客户端必备工具。本人安装在电脑运行正常。
FlashBuilder开发工具,是开发java网页及OpenLaszlo,Laszlo富客户端必备工具。本人安装在电脑运行正常。
FlashBuilder开发工具,是开发java网页及OpenLaszlo,Laszlo富客户端必备工具。本人安装在电脑运行正常。