Flex组件的继承关系

组件与控件的区别:

组件:component指任何可复用的、可以与其他对象交互的对象,如Flex中的validators、formatters、effects、managers、controls、containers等等。控件:control则指能够在界面上看到的组件,也称可视化组件,如Flex中的controls、containers、borders等等。所有的控件都是组件,反之,则不一定。Flex中的所有类都可以称为组件,其中能够在界面上看到的组件都可以被称为控件。

 

 

Flex是以多个AS类层次结构的形式来实现的。这些类层次结构中定义了组件类(各种控件)、管理类(Manager类)、数据服务类(HttpService、WebService等)以及实现Flex其他特性的类。通过继承类层次结构中相应的类,我们可以扩展现有的组件或者创建新的组件来是实现自定义组件。

Flex中,所有的可视化组件都继承UIComponent类。

通过继承,会了某一个组件的用法,与它有同样的继承关系的组件也就了解了

FLEX组件继承关系:

Object->EventDispather->DisplayObject->InteractiveObject->DisplayObjectContainer->Sprite->UIcomponet->All components

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>容器类组件

Application继承关系

UIComponent->Container->LayoutContainer->Application

ApplicationControlBar继承关系

UIcomponent->Container->Box->ControlBar->ApplicationControlBar

其主要用于全局导航,其是ControlBar的子类,后者用于Panel及itleWindow

Canvas继承关系

UIcomponent->Container->Canvas

其只有absolute布局

Box,HBox,VBox继承关系

UIcomponent->Container->Box,然后HBox,VBox是Box的子类,实际上Box有个属性direction,可以使其显示为HBox或HBox

DividedBox,HDividedBox,VDividedBox继承关系

UIcomponent->Container->Box->DividedBox ,然后HDividedBox,VDividedBox是其子类,三者之间的关系同Box与HBox,Vbox的关系一样

Panel继承关系

UIcomponent->Container->Panel

Panel可以在下部包含一个ControlBar

Panel的布局方式为absolute时,相当于Canvas

               为vertical时,相当于VBox

               为horizontal时,相当于HBox

TitleWindow继承关系

UIcomponent->Container->Panel->TitleWindow,其与Panel基本一样,

它可以在右上角显示一个关闭按钮,其一般当做弹出窗口使用,当做弹出窗口时,用PopUpManager类来管理

在Flex自带的帮助TitleWindow layout container中有大量的例子及教程,关于用PopUpManager来操作TitleWindow的

Form继承关系

UIcomponent->Container->Form

Form内部可以有

UIComponent->FormHeading

UIcomponent->Container->FormItem

这里看下Flex自带的帮助中的Form, FormHeading, and FormItem layout containers,里边有如何设置

各部分的间隔等教程

Title继承关系

UIcomponent->Container->Title

Grid继承关系UIcomponent->Container->Box->Grid

其内部可以有

UIcomponent->Container->Box->HBox->GridRow

UIcomponent->Container->Box->HBox->GridItem

Accordion继承关系

UIcomponent->Container->Accordion

ViewStack继承关系

UIcomponent->Container->ViewStack

ViewStack没有内建的切换内部容器的机制,其必须和一组按钮或

LinkBar,ButtonBar,ToggleButtonBar,TabBar配合使用,这些都是NavBar的子类或子子类

TabNavigator继承关系

UIcomponent->Container->ViewStack->TabNavigator

TabNavigato是ViewStack加TabBar的效果

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>常规组件

Alert继承关系

UIcomponent->Container->Panel->Alert

ColorPicker继承关系

UIcomponent->ComboBase->ColorPicker

其有个dataProvider属性,可以指定提供哪些颜色供选择

ComboBox继承关系

UIcomponent->ComboBase->ComboBox

HorizontalList继承关系

UIcomponent->ScrollControlBase->ListBase->TileBase->HorizontalList

TileList继承关系

UIcomponent->ScrollControlBase->ListBase->TileBase->TitleList

List继承关系

UIcomponent->ScrollControlBase->ListBase->List

Tree继承关系

UIcomponent->ScrollControlBase->ListBase->List->Tree

DataGrid继承关系

UIComponent->ScrollControlBase->ListBase->DataGridBase->DataGrid

TabBar继承关系

UIcomponent->Container->Box->NavBar->ButtonBar->ToggleButtonBar->TabBar

ButtonBar与ToggleButtonBar类似,后者放开鼠标后能显示按下的状态,TabBar也是显示按下状态,但外观不一样

LinkBar继承关系

UIcomponent->Container->Box->NavBar->LinkBar

其在内部根据数据源产生LinkButton

几个简单的组件:

UIcomponent->ProgressBar进度条

UIcomponent->Spacer 空生空白的空间

UIComponent->HRule及VRule 创建水平或坚直的线

UIComponent->NumericStepper 提供数据供选择,类似于ComboBox,但不产生下拉列表

UIComponent->Slider->HSlider及VSlider 通过拖到选择数据

UIComponent->ScrollBar->HScrollBar及VScrollBar,通常不单独使用,空间不够时自动产生

UIComponent->Button

UIComponent->Button->CheckBox

UIComponent->Button->RadioButton

Object->EventDispatcher->RadioButtonGroup 这个比较特别

UIComponent->Button->LinkButton

UIComponent->Button->PopUpButton 弹出一个菜单

UIComponent->Button->PopUpButton->PopUpMenuButton 数据源自动转成一个菜单

PopUpButton比Button多了一个pop-up button可以弹出Menu或List,通过属性Popup指定

UIComponent->DateChooser

UIcomponent->ComboBase->DateField

UIComponent->MenuBar 横向菜单

UIComponent->Label->Text Lable显示单行字,Text可以显示多行

UIComponent->ScrollControlBase->TextArea

UIComponent->TextInput   

UIcomponent->Container->Panel-> RichTextEditor 这个控件的外观不是固定的,可以添加删除其它组件,具体看下帮助

补充:

一:集合

ArrayCollection,XMLListCollection 继承了

mx.collections.ListCollectionView ,其实现了mx.collections.ICollectionView 和mx.collections.IList接口. 这两个接口提供了查看和

修改数据的基本方法,ArrayCollection用一个数组做数据源. XMLListCollection用XMLLIST做数据源对象

总的来说集特征如下:当数据源发生改变生,组件即时更新显示,可以查看,修改,排序源数据

有两种数据源类型

线性的

层级的,一般用于Tree,Menu,MenuBar,PopUpMenuButton

定义数据源的方法

用<mx:dataProvider>标签

在AS中定义

二:层级数据对象

可以是XML相关格式或Objects

三:使用条目逞现器和编辑器,用于ListBase下相关的控件

四:Menu,这个只能通过AS来创建

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值