GLG Extended API是GLG工具包的一款可選控件,它可提供在運(yùn)行時(shí)的高級(jí)動(dòng)態(tài)配置與編輯功能。
GLG Extended API為應(yīng)用程序提供了基于當(dāng)前配置數(shù)據(jù)制作繪畫的功能。它同樣可用來在運(yùn)行時(shí)動(dòng)態(tài)地為繪畫添加圖片對(duì)象,該對(duì)象對(duì)于能顯示不同動(dòng)態(tài)圖標(biāo)(如在地圖上移動(dòng)飛機(jī)圖標(biāo))的應(yīng)用程序具有非常重要的作用。使用Extended API的另一個(gè)例子是能基于用戶輸入而創(chuàng)建對(duì)象的自定義圖表應(yīng)用程序。
除了創(chuàng)建與刪除對(duì)象的功能外,Extended API同樣能提供可用于在運(yùn)行時(shí)在圖形繪制中遍歷對(duì)象以及動(dòng)態(tài)決定繪制內(nèi)容的高級(jí)內(nèi)窺功能。Extended API能使您訪問圖片創(chuàng)建程序中的所有操作,不管您選擇的部署選項(xiàng)是C/C++、Java還是ActiveX
GLG Extended API is an optional component of the GLG Toolkit, which provides advanced dynamic configuration and editing features at run time.
The GLG Extended API provides an application with capabilities to create drawings on the fly based on the current configuration data. It may be also used to add graphical objects to the drawing dynamically at run time, which is important for applications that display variable number of dynamic icons, such as moving airplane icons on the map. Another example of using the Extended API is a custom diagramming application that creates objects?interactively based on user input.
In addition to the methods for creating and deleting objects, the Extended API also provides advanced introspection capabilities, which can be used to traverse objects in the drawing and dynamically determine the drawing's content at run time. The Extended API provides programming access to all operations available in the Graphics Builder, regardless of the chosen deployment option: C/C++, Java or ActiveX.
動(dòng)態(tài)配置與編輯應(yīng)用程序編程接口(API)
GLG 擴(kuò)展應(yīng)用程序編程接口(API)是 GLG 工具包的一個(gè)可選組件,它在運(yùn)行時(shí)提供高級(jí)的動(dòng)態(tài)配置和編輯功能。
GLG 擴(kuò)展 API 使應(yīng)用程序能夠根據(jù)當(dāng)前配置數(shù)據(jù)即時(shí)創(chuàng)建圖形。它還可用于在運(yùn)行時(shí)動(dòng)態(tài)地向圖形中添加圖形對(duì)象,這對(duì)于顯示數(shù)量可變的動(dòng)態(tài)圖標(biāo)(例如地圖上移動(dòng)的飛機(jī)圖標(biāo))的應(yīng)用程序來說非常重要。使用擴(kuò)展 API 的另一個(gè)例子是自定義圖表繪制應(yīng)用程序,它可以根據(jù)用戶輸入以交互方式創(chuàng)建對(duì)象。
除了用于創(chuàng)建和刪除對(duì)象的方法外,擴(kuò)展 API 還提供高級(jí)的內(nèi)省功能,可用于遍歷圖形中的對(duì)象,并在運(yùn)行時(shí)動(dòng)態(tài)確定圖形的內(nèi)容。無論選擇哪種部署選項(xiàng)(C/C++、Java 或 ActiveX),擴(kuò)展 API 都提供對(duì)圖形構(gòu)建器中所有可用操作的編程訪問權(quán)限。
以下列出了需要擴(kuò)展應(yīng)用程序編程接口(API)的應(yīng)用程序類型。
這是一個(gè)圖表編輯器,用戶在運(yùn)行時(shí)通過從選項(xiàng)板中選擇一個(gè)節(jié)點(diǎn)并將其放置在繪圖中,來創(chuàng)建圖表節(jié)點(diǎn)。
這是一個(gè)基于地理信息系統(tǒng)的應(yīng)用程序,它需要在運(yùn)行時(shí)創(chuàng)建動(dòng)態(tài)圖標(biāo)來表示需要可視化的移動(dòng)物體的位置。由于在設(shè)計(jì)時(shí)圖標(biāo)數(shù)量是未知的,因此這些圖標(biāo)是在運(yùn)行時(shí)通過復(fù)制一個(gè)或多個(gè)圖標(biāo)模板來創(chuàng)建的。可以使用幾個(gè)模板來表示不同類型的被監(jiān)測(cè)對(duì)象。
這是一個(gè)網(wǎng)絡(luò)監(jiān)測(cè)或可視化應(yīng)用程序,它需要根據(jù)其數(shù)據(jù)庫(kù)中的信息在運(yùn)行時(shí)創(chuàng)建一些節(jié)點(diǎn)和連接。擴(kuò)展 API 用于根據(jù)數(shù)據(jù)庫(kù)查詢創(chuàng)建節(jié)點(diǎn),并根據(jù)接收到的連接信息用連接將它們連接起來。
一個(gè)過程控制應(yīng)用程序可以讀取一個(gè)描述特定工廠設(shè)備的配置文件,并在運(yùn)行時(shí)通過復(fù)制代表各種過程控制設(shè)備的預(yù)構(gòu)建模板并將它們放置在繪圖中來生成圖形。
如果可以使用圖形構(gòu)建器提前構(gòu)建圖形,那么 GLG 標(biāo)準(zhǔn) API 就足以顯示該圖形并用實(shí)時(shí)數(shù)據(jù)對(duì)其進(jìn)行更新。
Programming API
While the Graphics Builder is used for interactive design of drawings, the Programming API provides a way for the program to interact with the drawing from a program. The API is the second crucial element of the Toolkit, and provides programming access to objects created in the Builder when the drawing is embedded into an application.
The Toolkit provides a number of native programming containers for deploying the Toolkit's graphics in an application, both C/C++ and Java, Unix, Linux and Windows: a Motif/Gtk/Qt widget, an MFC class, Windows custom control, a Java bean and class library, an ActiveX Control and more. Click here for more information on available programming containers and deployment options.
A developer will only need to use a single SetResource function call or method to set any of the drawing's resources, which is a result of the resource based Programming API. The programmer needs to know only the name of a given resource, either an intuitive default such as FillColor, or any custom name given to the resource.
The Programming API may be used to modify resources of the drawing at run-time and supply dynamic data for real-time updates. The application needs to concern itself only with supplying new resource values, and the Toolkit's engine handles all details of the low-level graphics and damage repair. The updates are data-driven, so no CPU time is consumed if the data does not change. Click here for more information.
The API may also be used to handle user interaction, such as object selection or interaction with buttons, sliders and other controls. The object selection is handled transparently by the Toolkit, regardless of the screen size or zooming state, and the program's callback is invoked with all selection information every time an object of interest is selected. Click here for more information.