Difference between revisions of "Zh/Documentation/DevGuide/GUI/Graphical User Interfaces"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (New page: {{Documentation/DevGuide/GUITOC/Zh |ShowPrevNext=block |PrevPage=Zh/Documentation/DevGuide/Scripting/Integration with Extension Manager |NextPage=Zh/Documentation/DevGuide/GUI/Exception Ha...)
 
m
 
(2 intermediate revisions by the same user not shown)
Line 7: Line 7:
 
{{DISPLAYTITLE:图形用户接口}}
 
{{DISPLAYTITLE:图形用户接口}}
  
The <idlmodule>com.sun.star.awt</idlmodule> API-module is used to access and design user interface features. The concepts that this module are based on are similar to java.awt. This module provides services and interfaces to create and handle the large set of GUI elements that are demanded by today's modern components. This chapter is directed to extension developers who want to add functionality to their {{PRODUCTNAME}} application and want to create a consistent user interface.
+
 
 +
<idlmodule>com.sun.star.awt</idlmodule> 接口模块用于设计和访问用户接口功能。这个模块是基于 java.awt 的,提供能创建和处理大量 GUI 元素的服务和接口,以适应如今现代组件的需求。本章指导扩展开发者们添加 {{PRODUCTNAME}} 功能,并使他们创建的用户接口保持一致性。
  
 
=== 实现细节 ===
 
=== 实现细节 ===
  
You can use the UNO module Abstract Window Toolkit (UNO-AWT) to create a graphical user interface. The concept of UNO-AWT is based on Java/AWT. Java provides the AWT and Swing user interface design packages within its Java Foundation Classes class library. The implementation of java.awt components is based on the implementation of the peer components of the operating system. This is known as a "heavyweight" implementation. <idlmodule>com.sun.star.awt</idlmodule> components are lightweight controls because their implementation is based solely on {{PRODUCTNAME}}. This gives you platform independence. The functionality of heavyweight controls may only be as high as the lowest common denominator of all involved operating systems, however, OpenOffice UI components are meant to emulate the design of the corresponding components of the operating system. The layer responsible for this is called VCL or Visual Class Library. The layer on top of the VCL is the Toolkit layer. This layer maps all interfaces of <idlmodule>com.sun.star.awt</idlmodule> to VCL.
+
 
 +
 
 +
UNO-AWT (Abstract Window Toolkit,抽象窗口工具) 模块可用于创建图形用户接口。UNO-AWT 的设计思路基于 JAVA/AWT 之上的。Java 在 Java Foundation Classes (JAVA 基本库)中提供了 AWT Swing 用户接口设计包。Java.awt 组件的实现是依赖于操作系统的 peer 组件实现,这又称为重量级实现。
 +
 
 +
<idlmodule>com.sun.star.awt</idlmodule> 组件是轻量级控件,因为他们的实现只用于 {{PRODUCTNAME}}。这使得它具有平台独立性。重量级控件的功能或许可以达到与其相关的所有操作系统的“最小公分母”一样的高度(即所有相关操作系统的共同的基本特性), 不过,OpenOffice UI 组件想要的是模拟操作系统中相应的组件的设计。与之对应的层称为 VCL (视图类库-Visual Class Library)。VCL 之上是 Toolkit(工具)层,它将 <idlmodule>com.sun.star.awt</idlmodule> 所有接口映射到 VCL 层。
  
 
=== 基本概念 ===
 
=== 基本概念 ===
  
The basic concepts that are used in <idlmodule>com.sun.star.awt</idlmodule> are described in previous chapters:
+
<idlmodule>com.sun.star.awt</idlmodule> 中使用的基本概念已在前面的章节中介绍了:
  
* [[Documentation/DevGuide/ProUNO/Event Model|Event Model]] describes how to use event listeners at controls. With Event-Listeners at controls you can determine how a window reacts to mouse or keyboard driven events.
+
* [[Zh/Documentation/DevGuide/ProUNO/Event Model|专业 UNO - 事件模型]] 介绍如何在控件中使用事件侦听器。使用控件的事件侦听器可获知 window 如何响应鼠标或键盘事件。
* [[Documentation/DevGuide/ProUNO/Exceptions|Exceptions]] explains how to handle errors as Exceptions.
+
* [[Zh/Documentation/DevGuide/ProUNO/Exceptions|专业 UNO - 异常]] 介绍如何处理错误异常。
* [[Documentation/DevGuide/ProUNO/Introduction|Introduction]] describes factories.
+
* [[Zh/Documentation/DevGuide/ProUNO/Introduction|专业 UNO - 概述]] 介绍工厂机制。
* [[Documentation/DevGuide/ProUNO/Data Types|Data Types]] describes the basic UNO types, and provides information about how to convert these types to and from various target languages.
+
* [[Zh/Documentation/DevGuide/ProUNO/Data Types|专业 UNO - 数据类型]] 介绍基本 UNO 类型,和提供如何从其他目标语言类型转换的信息。
* [[Documentation/DevGuide/Basic/OpenOffice.org Basic and Dialogs|OpenOffice.org Basic and Dialogs]] provides information for developers who want to implement Basic macros.
+
* [[Zh/Documentation/DevGuide/Basic/OpenOffice.org Basic and Dialogs|OpenOffice.org Basic 和对话框]] 介绍如何编写 OpenOffice.org Basic 宏。
* [[Documentation/DevGuide/WritingUNO/Accessing Dialogs|Accessing Dialogs]] explains how dialogs created with the dialog engine can be embedded within {{PRODUCTNAME}} extensions.
+
* [[Zh/Documentation/DevGuide/WritingUNO/Accessing Dialogs|编写 UNO 组件 - 访问对话框]] 解释对话框是如何被创建的,以及对话框引擎如何被嵌入 {{PRODUCTNAME}} 扩展中。
  
 
{{PDL1}}
 
{{PDL1}}
  
 
[[Category:文档/开发者指南/图形用户接口]]
 
[[Category:文档/开发者指南/图形用户接口]]

Latest revision as of 09:20, 17 June 2008


com.sun.star.awt 接口模块用于设计和访问用户接口功能。这个模块是基于 java.awt 的,提供能创建和处理大量 GUI 元素的服务和接口,以适应如今现代组件的需求。本章指导扩展开发者们添加 OpenOffice.org 功能,并使他们创建的用户接口保持一致性。

实现细节

UNO-AWT (Abstract Window Toolkit,抽象窗口工具) 模块可用于创建图形用户接口。UNO-AWT 的设计思路基于 JAVA/AWT 之上的。Java 在 Java Foundation Classes (JAVA 基本库)中提供了 AWT 与 Swing 用户接口设计包。Java.awt 组件的实现是依赖于操作系统的 peer 组件实现,这又称为重量级实现。

com.sun.star.awt 组件是轻量级控件,因为他们的实现只用于 OpenOffice.org。这使得它具有平台独立性。重量级控件的功能或许可以达到与其相关的所有操作系统的“最小公分母”一样的高度(即所有相关操作系统的共同的基本特性), 不过,OpenOffice UI 组件想要的是模拟操作系统中相应的组件的设计。与之对应的层称为 VCL (视图类库-Visual Class Library)。VCL 之上是 Toolkit(工具)层,它将 com.sun.star.awt 所有接口映射到 VCL 层。

基本概念

com.sun.star.awt 中使用的基本概念已在前面的章节中介绍了:

Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages