BMP平台MVC的设计模式

这是高通BMP平台上的MVC设计模式,这个框架的核心就是以数据来驱动界面,对于做UI的朋友们来说,很有借鉴意义。

Design Patterns

  • BUIW is built using common software engineering design patterns.
  • Model-View-Controller (MVC) pattern is important to understand.
  • Other patterns used in BUIW are decorator and observer patterns.

 

 MVC模式框架图

Containers

  • A container is a collection of widgets, decorators and further sub-containers.
  • Containers keep track of relative order of widgets, their position and layout.
  • A container will handle clipping as required.
  • The top level container is called the root container.
  • Lots of different types of containers – CardContainer, GridContainer, ConstraintContainer, PropContainer, XYContainer.

 

 

Models

  • The data that drives a widget is stored within a model
  • The following models are available
  • IValueModel: A model for data that can be represented in an arbitrarily complex form
  • IListModel: A base class for IArrayModel and IVectorModel
  • IArrayModel: A model for a collection of objects of equal fixed size
  • IVectorModel: A model for a collection of objects that might be of a variable size
  • IFrameModel: Base class for IMediaFrameModel and ICameraFrameModel
  • IMediaFrameModel: Provides image frames from a video
  • ICameraFrameModel: Provides image frames from a camera
  • IInterfaceModel: Provides a model interface for objects that model their data in an interface that does not have a query interface, for example, bitmap and image widgets
  • ITextModel: Model for text strings such as in text entry
  • IMenuModel: Derived from IListModel

 

Widget View

  • Responsible for rendering the model‟s data to the display
  • Listens for model notifications
  • Sends invalidation request to parent container, so only redraws when directed
  • By letting root container redraw multiple requests can be grouped together
  • The size of the content area of the view is known as the extent
  • Be sure to set the extent
  • The full extent of widget doesn‟t have to be redrawn when the widget is invalidated

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值