国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 學(xué)院 > 開(kāi)發(fā)設(shè)計(jì) > 正文

The Model-View-Controller Architecture

2019-11-18 11:26:13
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

Swing uses the model-view-controller architecture (MVC) as the fundamental design behind each of its components. Essentially, MVC breaks GUI components into three elements. Each of these elements plays a crUCial role in how the component behaves.

Model

The model encompasses the state data for each component. There are different models for different types of components. For example, the model of a scrollbar component might contain information about the current position of its adjustable "thumb," its minimum and maximum values, and the thumb's width (relative to the range of values). A menu, on the other hand, may simply contain a list of the menu items the user can select from. This information remains the same no matter how the component is painted on the screen; model data is always independent of the component's visual rePResentation.

View

The view refers to how you see the component on the screen. For a good example of how views can differ, look at an application window on two different GUI platforms. Almost all window frames have a title bar spanning the top of the window. However, the title bar may have a close box on the left side (like the Mac OS platform), or it may have the close box on the right side (as in the Windows platform). These are examples of different types of views for the same window object.

Controller

The controller is the portion of the user interface that dictates how the component interacts with events. Events come in many forms ?e.g., a mouse click, gaining or losing focus, a keyboard event that triggers a specific menu command, or even a directive to repaint part of the screen. The controller decides how each component reacts to the event if it reacts at all.



發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 岑巩县| 苍溪县| 赤壁市| 崇州市| 宜春市| 克东县| 临夏县| 金昌市| 凤翔县| 三穗县| 阳谷县| 刚察县| 沙田区| 崇州市| 天镇县| 湾仔区| 杨浦区| 丽江市| 海林市| 麻栗坡县| 新龙县| 唐山市| 阿拉尔市| 汉寿县| 景洪市| 桂平市| 瑞丽市| 庆云县| 兴隆县| 安泽县| 繁峙县| 化德县| 湘潭县| 宁海县| 台东市| 西城区| 永吉县| 沂水县| 临高县| 连州市| 大英县|