IntelliJ IDEA 4 新特性 之 GUI Designer(圖形界面 RAD)
(譯者注:在看下面的翻譯前最好下載一下視頻DEMO??? 推薦!)
http://www.jetbrains.com/idea/training/demos/UI_Designer1_Deploy.zip
http://www.jetbrains.com/idea/training/demos/UI_Designer2_Deploy.zip
http://www.jetbrains.com/idea/training/demos/UI_Designer3_Deploy.zip
IDEA’s new innovative GUI designer uses a grid paradigm for the quick and easy creation and maintenance of both complex and simple component layouts. Due to unique byte-code instrumentation techniques your sources will no longer be cluttered with tons of hard-to-maintain GUI-constructing code.
IDEA引入個具有革命性的用戶界面設計,你可以用表格輕易的創(chuàng)建和維護那些不管是簡單的還是復雜的用戶界面布局。由于首創(chuàng) byte-code instrumentation 技術的引入,使你的程序中再也沒有臃腫拖沓的界面構造代碼。
Visual form creation and modification(可視化的表單創(chuàng)建與修改)
A rich set of visual form-building tools is incorporated into a convenient editor pane. With the help of an intuitive user interface, you can quickly learn and start using the GUI Designer.
一個功能強大的GUI Designer被集成于編輯器中,由于可以直接看到用戶界面的結果你可以用GUI Designer快速開發(fā)出界面。
Even complex GUI forms can be easily created from scratch. When you need to introduce structural changes into existing GUI forms, you do not need to break the entire form layout. Re-arranging, adding or deleting GUI components can be made locally, in a quick and easy way. 即使是復雜的界面也可以被輕易的構造出來 當你需要改變一個已經設計好的Form時,你不需要打亂目前的整個Form的Layout,只需要簡單的重新布局一下就可以了,不論是插入還是刪除GUI components 都可以輕松搞定!(譯者注:這樣的界面布局設計,已經可以接近VB、Delphi的RAD了?。?/p>
GUI layout is separated from code(界面布局與代碼向獨立,互不影響?。?GUI layout information is separated from your Java code, and is stored in devoted XML-based form files. Each GUI form is bound to a Java class, and form components are referred by class fields. Unique Byte-code instrumentation technics allow you to get rid of complicated Swing code in your Java sources. IDEA’s GUI-compiler transparently generates all code necessary to create and lay out form components. The GUI-compiler has been integrated into IDEA’s make functionality, and is also available as a separate Ant task delivered together with the IDEA distribution.
There is also an option to generate Java source code instead of using the byte-code instrumentation approach. GUI layout 的數據信息和你的Java代碼相分離,它儲存在一個XML格式的文件中。他們之間是綁定起來的,當然,代碼可以訪問你的form components的 獨創(chuàng)的Byte-code instrumentation 技術允許你從你得Java代碼中脫離掉臃腫的Swing構建代碼,IDEA的 GUI-compiler 使你創(chuàng)建的界面代碼對于你是完全透明的。GUI-compiler 的引入增強了IDEA的功能,他作為一個Ant task和IDEA一起發(fā)布。當然,你也可以用最原始的方法去開發(fā)你的Java程序,而不用byte-code instrumentation技術
(譯者注:用GUI-Designer設計界面,然后GUI-compiler會幫你將這界面所保存成的XML文件和你得Java代碼綁定在一起,這個技術就是byte-code instrumentation)
Binding of GUI form components to class and class fields(表單控件與class之間的綁定)
You can quickly bind your GUI form to an existing class. If there is no class, to bind with the form, you can create it right from the GUI Designer. Just enter a desired class name - the lightbulb will appear with an intention action to create a new class.
你可以快速的將你的GUI form 和一個已存在的class綁定起來,如果這個class不存在,GUI Designer會根據你的GUI form來創(chuàng)建一個class,只需要輸入一個class名——小燈泡會醒目的出現在將要新創(chuàng)建的class上
Binding particular GUI components to class fields is exactly as easy as binding the form to the class.
綁定一些控件到 class 的 fields 也和這個步驟一樣簡單
Ant task supplied for compiling GUI forms into your builds(可視化的GUI設計在你的程序里以Ant task的方式出現)
The bundled Ant task supports byte-code instrumentation technics for compiling IDEA GUI forms. It provides the following benefits:
被綁定的 Ant task 完全支持byte-code instrumentation technics ,有以下優(yōu)點:
You can quickly integrate the generated GUI forms into your project build Use of GUI designer doesn’t force you to keep all of your coding in IDEA (especially useful when team members work with different IDEs). 快速的與你的工程文件結合 這種GUI設計不一定只針對IDEA,尤其在你的同事在用其他IDE時。I18N support(支持I18N)
Text values on GUI components can be specified either by constant strings, or be obtained from the specified resource bundle.
出現在 GUI components 上的文字能以常量或資源(XML)的方式記錄下來。
Ability to create custom palettes(可以創(chuàng)建自己的palettes)
The Additional Component Palette option (available in IDEA settings) enables you to add an additional palette of Swing components, containing your own custom UI beans and/or beans from one or more third-party libraries, to the GUI Designer’s component palette.
在IDEA設定的選項里的 Additional Component Palette 可以讓你添加額外的Swing components的palette,包括你自己的或第三方的 UI beans 。
(譯者注:如果還不太了解的話,可以看看那三個演示文件。說實話,若說以前我對Java的GUI設計還憤憤不滿的話,那么IntelliJ IDEA 4 讓我徹底的閉嘴了。)