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引入個(gè)具有革命性的用戶界面設(shè)計(jì),你可以用表格輕易的創(chuàng)建和維護(hù)那些不管是簡單的還是復(fù)雜的用戶界面布局。由于首創(chuàng) byte-code instrumentation 技術(shù)的引入,使你的程序中再也沒有臃腫拖沓的界面構(gòu)造代碼。
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.
一個(gè)功能強(qiáng)大的GUI Designer被集成于編輯器中,由于可以直接看到用戶界面的結(jié)果你可以用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. 即使是復(fù)雜的界面也可以被輕易的構(gòu)造出來 當(dāng)你需要改變一個(gè)已經(jīng)設(shè)計(jì)好的Form時(shí),你不需要打亂目前的整個(gè)Form的Layout,只需要簡單的重新布局一下就可以了,不論是插入還是刪除GUI components 都可以輕松搞定!(譯者注:這樣的界面布局設(shè)計(jì),已經(jīng)可以接近VB、Delphi的RAD了!)
GUI layout is separated from code(界面布局與代碼向獨(dú)立,互不影響!) 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 的數(shù)據(jù)信息和你的Java代碼相分離,它儲(chǔ)存在一個(gè)XML格式的文件中。他們之間是綁定起來的,當(dāng)然,代碼可以訪問你的form components的 獨(dú)創(chuàng)的Byte-code instrumentation 技術(shù)允許你從你得Java代碼中脫離掉臃腫的Swing構(gòu)建代碼,IDEA的 GUI-compiler 使你創(chuàng)建的界面代碼對于你是完全透明的。GUI-compiler 的引入增強(qiáng)了IDEA的功能,他作為一個(gè)Ant task和IDEA一起發(fā)布。當(dāng)然,你也可以用最原始的方法去開發(fā)你的Java程序,而不用byte-code instrumentation技術(shù)
(譯者注:用GUI-Designer設(shè)計(jì)界面,然后GUI-compiler會(huì)幫你將這界面所保存成的XML文件和你得Java代碼綁定在一起,這個(gè)技術(shù)就是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 和一個(gè)已存在的class綁定起來,如果這個(gè)class不存在,GUI Designer會(huì)根據(jù)你的GUI form來創(chuàng)建一個(gè)class,只需要輸入一個(gè)class名——小燈泡會(huì)醒目的出現(xiàn)在將要新創(chuàng)建的class上
Binding particular GUI components to class fields is exactly as easy as binding the form to the class.
綁定一些控件到 class 的 fields 也和這個(gè)步驟一樣簡單
Ant task supplied for compiling GUI forms into your builds(可視化的GUI設(shè)計(jì)在你的程序里以Ant task的方式出現(xiàn))
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)點(diǎn):
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). 快速的與你的工程文件結(jié)合 這種GUI設(shè)計(jì)不一定只針對IDEA,尤其在你的同事在用其他IDE時(shí)。I18N support(支持I18N)
Text values on GUI components can be specified either by constant strings, or be obtained from the specified resource bundle.
出現(xiàn)在 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設(shè)定的選項(xiàng)里的 Additional Component Palette 可以讓你添加額外的Swing components的palette,包括你自己的或第三方的 UI beans 。
(譯者注:如果還不太了解的話,可以看看那三個(gè)演示文件。說實(shí)話,若說以前我對Java的GUI設(shè)計(jì)還憤憤不滿的話,那么IntelliJ IDEA 4 讓我徹底的閉嘴了。)