已阅读5页,还剩11页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
内蒙古工业大学本科毕业设计外文文献翻译学校代码: 10128学 号:040201068 本科毕业设计外文文献翻译(学生姓名:张志鑫学 院:信息工程学院系 别:计算机系专 业:计算机科学与技术班 级:计算机04-4指导教师:苏依拉 副教授钱庭荣 工程师二 八 年 六 月the java 2 user interfacegraphical and user interface capabilities have progressed in leaps and bounds since the early days of the java language. the java 2 platform contains a sophisticated cross-platform user interface architecture that consists of numerous high-level components, an advanced feature-rich device-independent graphics system, and a host of multimedia extensions. in this article, well explore this progression, examine the capabilities of the current version 1.3 in detail, and finish by looking to the future to see what release 1.4 will offer.prior to the release of the java 2 platform, the abstract window toolkit (awt) was the extent of the java platforms graphical capabilities. various technologies, such as swing, were introduced as optional extensions. with the java 2 platform, most of these extensions have found their way into the core as part of the java foundation classes (jfc). jfc refers to the entire set of graphical and user interface technologies included in the java 2 platform, including awt and swing. in this article, well explore each of the major components of the jfc and then discuss some of the optional extensions.the heart of the jfc: swingswing, a gui toolkit with a rich set of components, forms the heart of the jfcs user interface capabilities. it is both a replacement for the components the awt provides and also a big step forward.when integration was the priorityin the first releases of the jdk, integration with the native platform was considered a priority and so the awt provided components that were implemented using the native components of each platform (in the java programming vernacular, these are now known as heavyweight components). for example, on unix platforms the java.awt.button class was implemented with a motif pushbutton widget. the same java application had a different appearance on each platform, but the intention was that the different implementations were functionally equivalent. of course, this is where the problems start. for simple interfaces, the equivalence is true, but the model breaks down as complexity increases simply because the components are different, and they will always behave slightly differently in some situations no matter how many bugs are fixed and how many times parts of the awt are rewritten.the other problem that cropped up by placing a priority on integration was functionality. the awt provided only a limited set of components because of the lowest common denominator approach - a particular component or function can only be provided if it is available on every platform. a classic example is mouse buttons. back in jdk 1.0.2, there was no way to distinguish between mouse button presses because the macintosh had only one mouse button, and so every other platform had to behave as if it too supported only one mouse button.as the language became more of a platform in its own right, the approach to guis moved toward identical appearance and behavior across all platforms. to achieve this goal, the native components have to be abandoned as much as possible. but, clearly, some native code is still required. you cant make a window appear on unix without x system window calls being involved.enter swing, which achieved this goal by making use of a subset of the awt, including the basic drawing operations and the certain classes in the java.awt package: container, window, panel, dialog, and frame. best of all possible approachesswing does not completely follow the java language as a platform route. instead, it combines the best of both approaches by offering a bridge back to the native platforms.the mechanism for establishing this bridge is referred to as pluggable look-and-feels (which is pretty close to the concept of themes, popular in the linux community). each swing component has a model of its functionality and a separate appearance (the look-and-feel), which can be set in advance or changed on the fly.swing provides a java look-and-feel (previously known as metal), separate ones for the windows and motif platforms, and one for the macintosh platform (as an extra option). the platform look-and-feels dont use the native components of the platform like the awt does. instead, they use lightweight components that are drawn to have the same appearance as the native components. this is good for functionality, but there are always some differences in look or behavior, so complex interfaces will never be identical to ones that use native components.furthermore, you can roll your own look-and-feel, which is a great ability to have when crafting one for highly specialized applications or when providing a corporate look-and-feel across a range of applications.platform-independent drag and dropjdk 1.1 added a general mechanism, found in the java.awt.datatransfer package, that enabled the transferring of data between and within applications, as well as the ability to manipulate the system clipboard.the java.awt.dnd package was introduced in the java 2 version. this package builds on the data-transfer mechanism by providing drag-and-drop facilities that can operate in a platform-independent manner within a single java application or between two java applications. it can also behave in a platform-dependent manner in order to integrate with the drag-and-drop facilities of the native platform.the drag and drop (dnd) api is quite challenging to use because it operates at a high level of abstraction to support the different ways in which it can work and because it is designed to operate on arbitrary datatypes, as specified by the java.awt.datatransfer.transferable interface. lets take a look at an example.enabling the disabled: accessibilitythe jfc accessibility api equips java applications so they can be accessed by users of all abilities, including people with sight-, hearing-, or dexterity-related difficulties. these might include the inability to discern visible or auditory cues or to operate a pointing device.two of the most important features of accessibility support are screen readers and magnifiers. screen readers allow users to interact with a gui by creating an off-screen representation of the interface and passing this to a speech synthesizer or a braille terminal. screen magnifiers provide an enlarged window of the screen, typically from 2 to 16 times the normal size. they generally keep track of pointer movements and changes in input focus and adjust the enlarged view accordingly. in addition, techniques such as font smoothing may be used to create a clearer picture.the java accessibility bridgesome host systems, such as microsoft windows, provide their own accessibility features. by default, java applications do not fully support them. for example, with native applications the screen magnifier detects when the input focus is switched to a different user interface component, such as by using the tab key, and it adjusts the portion of the screen that is being magnified to show the component that now has the input focus.however, swing applications use lightweight components, which are treated as images by the operating system, instead of discrete components. this means the screen magnifier cannot track changes in input focus in the same way as with native applications.this is exactly the problem the java accessibility bridge for windows solves. it creates a map between events relating to lightweight components and native system events. by using the bridge, java applications that support the accessibility api are then fully integrated with the windows accessibility support.from primitive to advanced: java 2dbefore the java 2 platform, graphical capabilities in the language were rather primitive, limited to solid lines of single-pixel thickness; a few geometric shapes such as ovals, arcs, and polygons; and basic image-drawing functionality. all that changed with the introduction of the java 2d api, which contains a substantial feature set.the core of this api is provided by the java.awt.graphics2d class, which is a subclass of java.awt.graphics. the remainder of the api is provided by other packages within the java.awt hierarchy, including java.awt.color, java.awt.font, and java.awt.geom.the java.awt.graphics2d classthis class is a subclass of java.awt.graphics, the class that provided graphical capabilities prior to the java 2 release. the reason for this arrangement: backwards compatibility. components are still rendered by calling their paint() method, which takes a graphics object.in the current version of the language, though, the object is really a graphics2d object. this means that a paint() method can either use the graphics object as a graphics object (using the old drawing methods) or cast it to a graphics2d object. if it uses the second option, then any of the additional capabilities of the 2d api can be used.the java.awt.geom packagethe java.awt.geom package provides a number of classes relating to two-dimensional geometry, such as arc2d, line2d, rectangle2d, ellipse2d, and cubiccurve2d. each of these is an abstract class, complete with two non-abstract inner classes called double and float (which are subclasses of the abstract outer class).these classes allow the various geometric shapes to be constructed with coordinates of either double or float precision. for example, newellipse2d.float(x,y,w,h) will construct an ellipse bounded by a rectangle of width w and height h, at position (x,y), in which x, y, w, and h are all floating-point values.also in this package is the affinetransform class, which forms a core element of the 2d api. an affine transformation is one in which parallel lines remain parallel after the transformation. examples of this type of transformation include such actions as translation, rotation, scaling, shearing, or any combination of these. each transformation can be represented by a 3x3 matrix that specifies the mapping between source and destination points for the transformation.instances of the affinetransform class can be created directly from a matrix of floating-point values, although they are more usually created by specifying one or more translation, rotation, scaling, or shearing operations. mostly double-precision values are used, and angles are measured in radians (not degrees as used by the arc2d class).text renderingthe text capabilities of the java 2d api are impressive. they include:anti-aliasing and hinting for improved output qualitythe ability to use all the system-installed fontsthe ability to apply the same operations (rotation, scaling, painting, clipping, and so on) to text as to graphic objectssupport for adding embedded attributes to strings (such as font, size, weight, and even images)support for bi-directional text (to enable right-to-left character runs like you would encounter in arabic and hebrew)primary and secondary cursors that can navigate through text containing both right-to-left and left-to-right character runsadvanced font-measurement capabilities, surpassing those of the old java.awt.fontmetrics classlayout capabilities to word-wrap and justify multi-line text multimedia options: java media apisthe java media apis are a set of resources covering an extensive range of multimedia technologies. some of them, such as the 2d and sound apis, are part of the core j2se platform; the rest are currently optional extensions, but some of them will no doubt find their way into the core in the future. the other apis in this area are java 3d, advanced imaging, image i/o, the java media framework (jmf), and speech.java 3dthe java 3d api provides a set of object-oriented interfaces that support a simple, high-level programming model, enabling developers to build, render, and control the behavior of 3d objects and visual environments.the api includes a detailed specification document and implementation for packages javax.media.j3d and javax.vecmath.advanced imagingoperations covered by this specification enhance a users ability to manipulate images. it includes such operations as contrast enhancement, cropping, scaling, geometric warping, and frequency domain processing.this type of functionality is applicable to various fields, such as astronomy, medical imaging, scientific visualization, meteorology, and photography.image i/othis api defines a pluggable framework for reading and writing images of various formats. this new api is being designed through the java community process.java media framework (jmf)the jmf is an api for incorporating audio, video, and other time-based media into java applications and applets. this optional package extends the multimedia capabilities of the j2se platform.speechthe java speech api allows developers to incorporate speech technology into user interfaces for java applets and applications. the api specifies a cross-platform interface to support command-and-control recognizers, dictation systems, and speech synthesizers.this blanket api is divided into several specifications:java speech api specification (jsapi) java speech api programmers guide java speech api grammar format specification (jsgf) java speech api markup language specification (jsml) there is no sun reference implementation for this api, but there are numerous third-party implementations, including speech for java (available from ibm alphaworks), which uses viavoice to support voice-command recognition, dictation, and text-to-speech synthesis.gui changes in store in 1.4the upcoming release, version 1.4, code-named merlin, is going to present many new features along with the obligatory bug fixes. well highlight some of those changes.whats new with swingthe merlin release will bring extensive improvements to the swing toolkit. the new functionality includes:an indeterminate progress bar that will indicate action to the user without quantifying the degree of completeness. these components will be useful when you dont know in advance how long something is going to take (establishing a network connection, for example).a jspinner component that lets the user select from an ordered list using arrow buttons to scroll through the list.a jformattedtextfield component that lets developers restrict the set of characters allowed in a text component. this function is great for inputting dates and numbers.new jtabbedpanes, which are enhanced to allow for scrollable tabs. currently the tabs spill over onto multiple rows if they cannot all fit onto one row, which can be very awkward for the user because the pane has to rearrange the tabs when one on another row is selected. the alternative used here is to keep all the tabs on one row, but provide arrow buttons to scroll along the row.enhancements to the windows look-and-feel to make it match the native platform more closely. these enhancements include cosmetic changes to match windows 2000, such as gradient fills in title bars, and better integration with the windows desktop to respond to changes the user makes to the desktop settings.a large number of bug fixes and minor enhancements, including the capability of attaching sounds to swing events. awt gets a new focus modelin release 1.4 the awt is being given a completely new focus model, which has long been a problem area. the existing focus model has been plagued by countless bugs and greatly lacks functionality, such as not being able to query which component currently has the focus. the problems are generally caused by the differences in the way different platforms handle input focus, as well as by the complication of new lightweight components that require separate focus handling.as much of the new model as possible has been implemented with shared code; the platform-dependent code has been minimized. the heart of the new model is the class java.awt.keyboardfocusmanager. this class will provide the public api calls to query and set numerous aspects of the focus state, such as which component currently has the focus and the order of components in a focus traversal cycle.one final note: the new focus model is not completely backwards-compatible with current versions, so existing applications will need to be thoroughly tested.other awt featuresmice with a scroll wheel as a middle mouse button are fairly popular, so support is being added. it takes the form of a new mousewheelevent class, a mousewheellistener interface, and a new addmousewheellistener() method to the java.awt.component class (and the corresponding removemousewheellistener() method).support is being added for headless java. this addition means that java applications running on a server without a gui environment will still be able to use the awt, for example, to create images in memory for sending out over the network.finally, other changes include enhancements to the drag-and-drop functionality, the ability to create frames without decorations, and numerous bug fixes.15java 2 用户界面自从java语言出现的早期到现在,图形和用户界面功能已取得了飞跃式的发展。java2平台包含一个复杂的跨平台的用户界面体系结构,它的组成包括众多的高级组件、一个先进的,功能丰富的,独立于设备的图形系统和许多的多媒体扩展。在本文中,我们将探究这个进步,详细审视当前1.3版本的功能,最后展望一下未来,看看发行版1.4会提供些什么。请点击文章顶部或底部的讨论,在论坛与本文作者和其他读者分享您对本文的看法。在java2平台发行之前,抽象窗口工具包(abstract window toolkit,awt)是java平台的图形功能的范围。例如swing等各种技术都是作为可选的扩展被引入的。在java2平台上,这些扩展中的大部分都可以在平台的核心中找到它们的一席之地,成为java基础类(java foundation classes,jfc)的一部分。jfc指的是包含在java2平台内的一整套图形和用户界面技术,包括awt和swing等。在本文中,我们将讨论jfc的每个主要组件,并讨论一些可选的扩展。jfc的核心:swingswing是一个带有一套丰富组件的gui工具包,它组成了jfc的用户界面功能的核心部分。它不仅是awt所提供的组件的替代品,并且在这些组件的基础上有了很大进步。当集成有优先权时在jdk首次发行时,与本机平台的集成被认为具有优先权,于是awt提供了一些组件,这些组件使用各平台的本机组件(在java编程术语中,这些被称为重量级组件)来实现。例如,在unix平台上,java.awt.button类是用窗口小部件motif pushbutton
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年金华经济技术开发区基层医疗卫生单位招聘编外合同制工作人员22人历年真题汇编及答案解析(夺冠)
- 2025江西吉安市青原区两山人力资源服务有限公司招聘项目制人员2人笔试备考试卷带答案解析
- 2025山东东营市河口区引进第二批急需紧缺卫生专业技术人才15人笔试备考试卷附答案解析
- 2025北京石景山区卫生健康委所属事业单位面向应届毕业生和社会人员招聘工作人员29人备考题库附答案解析
- 2025黑龙江大庆市人力资源和社会保障局所属事业单位选调1人历年真题汇编带答案解析
- 2025年黄山市徽城投资集团有限公司招聘11人历年真题库附答案解析
- 2025年11月江西赣江新区建昌资产运营集团有限公司面向社会猎聘管理人员1人备考题库附答案解析
- 2025广西南宁市马山县人力资源和社会保障局招聘外聘人员1人笔试模拟试卷带答案解析
- 2025四川成都市武侯区玉林社区卫生服务中心第三次社会招聘编外人员2人历年真题库附答案解析
- 2025四川省公安厅所属事业单位考核招聘工作人员8人备考公基题库带答案解析
- 2025年11月广东深圳北理莫斯科大学附属实验中学面向2026年应届毕业生招聘教师15人笔试考试参考试题及答案解析
- 学术论文标准格式规范
- 2025年国家工作人员学法用法试题库及参考答案
- 低氘水对3D皮肤模型抗衰老效果的机制研究
- 重性精神病家庭护理知识
- 2025贵州贵安商业资产运营管理有限公司招聘11人考试笔试参考题库附答案解析
- 循证护理教学20章
- 2025年山东颐养健康产业发展集团有限公司权属企业社会招聘考试笔试模拟试题及答案解析
- 试验员安全生产责任制内容
- 用电安全教育主题班会课件
- 2025年广东公务员笔试考试《行测》试题及参考答案
评论
0/150
提交评论