节点文献

基于Java Synth的可视化组件风格定制的研究与实现

Research and Implementation on Visual Customization of Java Componnent Look and Feel

【作者】 钟娟

【导师】 王余旺;

【作者基本信息】 安徽理工大学 , 计算机应用技术, 2007, 硕士

【摘要】 Java是一种解释型的,完全面向对象的编程语言,成功地应用在网络及移动计算等应用领域。Sun公司推出的J2SE5.0版本引入了Swing Synth,提供了一种新的Look And Feel“皮肤”外观切换技术,使Java在用户界面(UI)领域迈上一个新台阶。但是,开发人员利用Synth进行外观设计时,需要在XML文件中描述数量繁多的组件属性,可定义的特定于组件的属性有100多种,对程序员来说比较繁琐。本文利用Java与XML技术,按照UML的建模过程,实现了基于Java Synth的可视化组件风格定制系统。其核心是通过设置组件的属性来定制组件风格,生成相应的XML文件。系统主要由三大模块构成:画板功能模块、组件属性编辑器功能模块、图像预览和图像边界设置功能模块。利用本系统,用户可根据自己的要求设置属性编辑器中不同组件的各个属性,通过预览查看是否满足所需要的组件风格,若满意则保存,系统会自动生成相应组件风格的XML文件。如果用户对系统提供的图像不满意,可利用系统提供的多功能画板进行绘制,图像最终被保存为可以在本系统预览的PNG文件,再用于上述的组件风格的设置。本文分析了基于Java Synth的可视化组件风格定制系统的原理及结构,明确了可视化组件风格系统定制的设计目标,最后给出了系统主要部分的实现。

【Abstract】 Java is an interpretive and totally object-oriented language. It has been successfully applied in many fields, such as network and mobile computing. From J2SE5.0 published by Sun Microsystems, Inc., a new Swing package called Synth has offered a new Look-and-Feel (L&F) "skin" appearance, making Java much improved in the field of UI (User interface).But, when a programmer utilizes Synth to design L&F, he needs describe lots of component properties, with over 100 components specific properties defined. That is troublesome for programmers. This paper designs and implements a visual component L&F customization toolkit via UML modeling and XML processing. The key is to visually customize component L&F through setting component properties and creates corresponding XML file. The system is mainly composed of three modules: drawing board, component properties editor, image preview and image border editor. By this toolkit user may set component properties in the property editor, according to one’s own requirement, and preview the effect. If satisfied, the XML file with the record of component L&F properties will be automatically created and saved. If the user is not satisfied with image offered by the system, he can edit it or draw new one in the drawing board and save it as .png file and use it again in the mentioned process.This paper analyzes the principle and structure of the visual customization of component L&F based on Java Synth, specify the goal of the toolkit and implements the main functions of the toolkit.

  • 【分类号】TP311.52
  • 【被引频次】3
  • 【下载频次】98
节点文献中: