1. Trang chủ
  2. » Công Nghệ Thông Tin

professional java user interfaces phần 8 doc

68 343 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 68
Dung lượng 2,89 MB

Nội dung

436 Java Tools and Technologies 4:0 PM 9 March 2006 c11.fm 1.0 JGoodies Looks JGoodies Looks is a family of look and feels that provides quality design to the pixel and multi-platform coherence. The Plastic L&F, for example, has been designed especially for Windows users (see Figure 11.18). Figure 11.17 Compiere Looks 1.2.0 (Continued) Table 11.12 JGoodies Looks details L&F name JGoodies Looks 1.3.1 Time to load L&F at startup (seconds) 0.05 Time to launch application (seconds) 1.37 Free memory (KB) Initial - after startup 1355.59 License BSD (OSS) Author / Company Karsten Lentzsch URL http://www.jgoodies.com/ c11.fm Page 436 Thursday, March 9, 2006 4:00 PM Presentation layer technologies 437 4:0 PM 9 March 2006 c11.fm 1.0 Liquid Liquid provides a Swing look and feel based on the Mosfet Liquid KDE 3.x theme (see Figure 11.19). Figure 11.18 JGoodies Looks, Plastic L&F c11.fm Page 437 Thursday, March 9, 2006 4:00 PM 438 Java Tools and Technologies 4:0 PM 9 March 2006 c11.fm 1.0 Table 11.13 Liquid details L&F name Liquid Time to load L&F at startup (seconds) 0.13 Time to launch application (seconds) 1.11 Free memory (KB) Initial - after startup 617.76 License (OSS) Author / Company M. Lazarevic and E. Vickroy URL https://liquidlnf.dev.java.net/ Figure 11.19 Liquid c11.fm Page 438 Thursday, March 9, 2006 4:00 PM Presentation layer technologies 439 4:0 PM 9 March 2006 c11.fm 1.0 Oyoaha Despite Oyoaha’s coherent design, some visual details, particularly the 3D effect of buttons and text fields, result in a cluttered ensemble when the L&F is employed in non-trivial forms. For an example, see Figure 11.20. Figure 11.19 Liquid (Continued) Tabl e 11.14 Oyoaha details L&F name Oyoaha 3.0 Time to load L&F at startup (seconds) 0.08 Time to launch application (seconds) 0.92 Free memory (KB) Initial - after startup 1017.26 License (OSS) Author / Company Philippe Blanc URL http://www.oyoaha.com/ lookandfeel/ c11.fm Page 439 Thursday, March 9, 2006 4:00 PM 440 Java Tools and Technologies 4:0 PM 9 March 2006 c11.fm 1.0 Napkin Napkin is a simple look and feel that provides an informal and provisional appearance to Swing GUIs. It is not intended to be used with a final product, but only in development and during demonstrations to users. This enables devel- opers to avoid committing to a given L&F until needed by highlighting the fact that the GUI is not ready. AS it is a L&F that is not used in production, Napkin’s performances lags behind other L&Fs, with a relatively large memory occupancy due to the many bitmap it Figure 11.20 Oyoaha 3.0 c11.fm Page 440 Thursday, March 9, 2006 4:00 PM Presentation layer technologies 441 4:0 PM 9 March 2006 c11.fm 1.0 uses, as well as long time to load and launch values. Given the intended use of this L&F, these are not problems, especially if the application is executed on powerful development machines. Napkin is a good example of the many possible uses of Swing L&F technology. See Figure 11.21. Table 11 .15 Napkin details L&F name Napkin Beta 0.07 Time to load L&F at startup (seconds) 0.95 Time to launch application (seconds) 1.85 Free memory (KB) Initial - after startup 2394.29 License BSD (OSS) Author / Company Ken Arnold URL http://napkinlaf.sourceforge.net/ Figure 11.21 Napkin L&F c11.fm Page 441 Thursday, March 9, 2006 4:00 PM 442 Java Tools and Technologies 4:0 PM 9 March 2006 c11.fm 1.0 SWT Presentation Although less flexible than Swing’s counterpart, SWT also allows for the custom- ization of the toolkit’s visual appearance via native OS themes. This option is still poorly supported as of Eclipse 3.0. To enable Windows XP themes in SWT, a special manifest file is included in the same directory that contains the JRE that launches the application. Figure 11.22 shows Eclipse on Windows with two different themes: XP (above) and Windows classic (below). Figure 11.21 Napkin L&F (Continued) Figure 11.22 Eclipse 3.0 with different themes c11.fm Page 442 Thursday, March 9, 2006 4:00 PM Declarative GUIs with Java 443 4:0 PM 9 March 2006 c11.fm 1.0 11.10 Declarative GUIs with Java Many projects aim to provide declarative capabilities to Java GUIs, mostly to express content, even if some projects also strive to provide a minimum amount of interaction and control behavior. XML-based formats Unsurprisingly, the largest family of declarative formats is based on XML. There are more than a dozen such XML schemas 20 , with projects like JDNC 21 , Mozilla XUL, Luxor, SwiXml, XUI, Beryl XML GUI, Purnama XUI, SwingML, Thinlet, jXUL, KoalaGML, WidgetServer, Gui4j, and XAMJ. The Thinlet project is an example of this family of formats, a LGPL-licensed, tiny- footprint (39 KB) interpreter of Thinlet XML files. Thinlets can run in a Java 1 JVM, the default shipped with Microsoft Internet Explorer, and other J2ME profiles, and don’t require Swing. Figure 11.23 shows a sample GUI demo using Thinlet. Figure 11.22 Eclipse 3.0 with different themes 20. For a quick comparison, can see: http://xul.sourceforge.net/counter.html. 21. JDNC is discussed briefly as an alternative implementation for the example application in Chapter 14. c11.fm Page 443 Thursday, March 9, 2006 4:00 PM 444 Java Tools and Technologies 4:0 PM 9 March 2006 c11.fm 1.0 An extract of the source file that generates the GUI in Figure 11.23 is shown in Listing 11.1 below. Listing 11.1 The demo.xml file <?xml version="1.0" encoding="ISO-8859-1"?> <panel columns="1" gap="4"> <menubar weightx="1"> <menu text="File" mnemonic="0"> <menuitem text="New" icon="/icon/new.gif" mnemonic="0" /> <menuitem text="Open " icon="/icon/open.gif" /> <menuitem text="Save" icon="/icon/save.gif" /> <menuitem text="Save As " icon="/icon/saveas.gif" /> <separator /> <menuitem text="Page Setup" icon="/icon/pagesetup.gif" /> <menuitem text="Print" icon="/icon/print.gif" /> <separator /> … </menubar> <tabbedpane selected="1" weightx="1" weighty="1"> <tab text="Texts"> <panel columns="5" top="4" left="4" bottom="4" right="4" gap="4"> <label text="Find in the text:" mnemonic="10" /> … <tab text="Lists" mnemonic="0"> <panel columns="1" top="4" left="4" bottom="4" right="4" gap="4"> <panel gap="4"> <label text="Update list:" /> … Another approach that avoids the use of Java on the client altogether is to take advantage of other presentation technologies, such as Macromedia Flash, that are installed on clients as Web browser plug-ins. SWF bytecode can be generated Figure 11.23 Thinlet demonstration c11.fm Page 444 Thursday, March 9, 2006 4:00 PM Summary 445 4:0 PM 9 March 2006 c11.fm 1.0 dynamically on the server side by tools such as OpenLaszlo, using servlet tech- nology, or Flex. Both these approaches make use of XML-based user interface languages in which the XML is generated and prepared on the server side, compiled, and send to the client’s Flash player. 11.11 Summary This chapter discussed some of the most popular technologies and products for developing Java GUIs. We introduced the issue of evaluating an OSS in general, and specifically for the purpose of creating Java GUIs. Major Java GUI technolo- gies and tools currently available were discussed and compared, including development aids, third-party components, utility libraries, and presentation technologies. c11.fm Page 445 Thursday, March 9, 2006 4:00 PM [...]... discusses how they translate to API design The term user and developer are used here as synonyms • Focus on your users: – Design for different types of users Usually you’ll have novice users, expert full-time developers, and possibly also knowledgeable, part-time developers as well Each class of users has its own needs and priorities – Provide a user- centered, task-oriented, and context-aware design... discusses various issues related to renewing and restructuring existing Java GUI code 12.4, Exploiting technology proposes alternative uses of some Java GUI technologies 12.5, Domain-specific and Little languages discusses the use of this technique for Java GUIs 12.6, The future of Java GUIs attempts to forecast the future of Java GUI technologies 12.1 Building on top of existing libraries A frequent... large Java applications We presented a practical example of porting a Java program to a new Java configuration, and we also discussed the use of little languages in our applications The chapter concluded with a brief discussion of upcoming innovations in Java GUI technology 1:25 PM 13 March 2006 c12.fm 1.0 13 Rich Client Platforms Rich Client Platforms This chapter discusses the practical use of Java. .. large Java applications is managing the memory needed during execution The situation can be complicated when such applications need to run for a long time, requiring more sophisticated memory policies The simplest solution for such a class of Java applications is to provide a means for the end user to control the JRE’s garbage collector directly Clearly this is feasible only when the typical user population... is a common theme that can be handled easily by following some simple steps The JNLP protocol is suited to the deployment of Java applications via Web browsers Rich Java clients usually take advantage of the Java Network Launching Protocol (JNLP) for launching and deploying Java application over the Web This protocol works by means of special XML files (.jnlp files) that instruct the JRE how to deploy... Unsurprisingly, GUI design and API design have many points in common Both have users of many types and levels of experience, API users being mainly developers Both design processes leverage devised metaphors and abstract concepts embodied in the design, be it a GUI design or an API, to solve user s needs effectively On the other hand the user experience of the product – the new API to be designed – is shaped... effectiveness – productivity: how easy is to achieve the required goal with the API? You might want to test also for flexibility – can expert users tweak any aspect of the framework – and future modifications – what are the unforeseen needs of our users? Developers are like GUI users: putting them in control of the GUI will make them feel better How can your API be modified to accommodate them without degrading... providing of course acknowledgements are given and license compliance is met Building GUI code for other developers instead of final users is a gratifying experience that need extra technical care in its details Two very useful documents on this perspective are Evolving Java- based APIs (Des Rivières 2000) and, specifically on the client side, How to Use the Eclipse API (Des Rivières 2001) There is much... techniques, Java- specific manipulations, or other processes, such as applying coding guidelines Nevertheless, some general principles apply – it’s important to: • Understand the legacy code, or at least enough of it to carry out what is required Getting a ‘grip’ on old code may be hard, even for circumscribed 1:25 PM 13 March 2006 c12.fm 1.0 4 58 Advanced Issues and specific pieces of software like Java GUIs... developers, such as too low-level code User interaction such as mouse dragging wasn’t working as expected in the Swing porting, and in-depth corrections were needed to make things work We will get back to this point in a later section that discusses tips for ensuring greater longevity for Java GUIs Applets are still among us Even if they didn’t fulfill the triumphant vision of Java s early days, there are still . they translate to API design. The term user and developer are used here as synonyms. • Focus on your users: – Design for different types of users. Usually you’ll have novice users, expert full-time developers,. 4:00 PM Declarative GUIs with Java 443 4:0 PM 9 March 2006 c11.fm 1.0 11.10 Declarative GUIs with Java Many projects aim to provide declarative capabilities to Java GUIs, mostly to express content,. technologies and products for developing Java GUIs. We introduced the issue of evaluating an OSS in general, and specifically for the purpose of creating Java GUIs. Major Java GUI technolo- gies and tools

Ngày đăng: 12/08/2014, 23:22