com.supermap.web.core
public class Element
继承 Element Inheritance Object

Flex 元素类.

用来定义一个可视组件元素,以元素图层 ElementLayer 为平台进行显示。该类由可视组件 DisplayObject 、DisplayObject 在元素图层 ElementLayer 中的显示区域及标识ID三部分组成。



公共属性
  属性 定义方
    bounds : Rectangle2D
获取或设置可视组件在元素图层 ElementLayer 中的显示区域,Rectangle2D 类型.
Element
    component : DisplayObject
获取或设置可视组件。
Element
    id : String
获取或设置可视组件的 ID, 如果未设置,在Element实例化时由系统自动生成默认ID。
Element
    offset : Point
获取或设置元素的偏移量Point(x,y),x(y)为正,代表向下(右)偏移x(y)像素,为负代表向上(左)偏移x(y)像素,为0代表不偏移。
Element
    originalBounds : Rectangle2D
获取或设置元素的原始bounds,当元素为标签并开启自动避让的时候,其bounds会发生变化,通过该属性能够获取标签原始bounds。.
Element
公共方法
  方法 定义方
   
Element(component:DisplayObject = null, bounds:Rectangle2D = null)
初始化 Element 类的新实例。
Element
属性详细信息
bounds 属性
bounds:Rectangle2D

获取或设置可视组件在元素图层 ElementLayer 中的显示区域,Rectangle2D 类型.

若该显示区域表示一个点,如:Rectangle2D(30,20,20,30)表示点(20,30),则以组件中心点为中心,按组件原大小将其显示于该点上;若该显示区域表示一条线,如:Rectangle2D(30,20,40,30)表示点(30,20)和点(40,30)之间的连线,则取该线段的中点作为组件的显示位置;若该显示区域表示一个区域范围,则组件将拉伸显示于该区域内。


Implementation
    public function get bounds():Rectangle2D
    public function set bounds(value:Rectangle2D):void
component 属性  
component:DisplayObject

获取或设置可视组件。


Implementation
    public function get component():DisplayObject
    public function set component(value:DisplayObject):void
id 属性  
id:String

获取或设置可视组件的 ID, 如果未设置,在Element实例化时由系统自动生成默认ID。


Implementation
    public function get id():String
    public function set id(value:String):void
offset 属性  
offset:Point

获取或设置元素的偏移量Point(x,y),x(y)为正,代表向下(右)偏移x(y)像素,为负代表向上(左)偏移x(y)像素,为0代表不偏移。


Implementation
    public function get offset():Point
    public function set offset(value:Point):void
originalBounds 属性  
originalBounds:Rectangle2D

获取或设置元素的原始bounds,当元素为标签并开启自动避让的时候,其bounds会发生变化,通过该属性能够获取标签原始bounds。.


Implementation
    public function get originalBounds():Rectangle2D
    public function set originalBounds(value:Rectangle2D):void
构造函数详细信息
Element () 构造函数
public function Element(component:DisplayObject = null, bounds:Rectangle2D = null)

初始化 Element 类的新实例。

参数
component:DisplayObject (default = null) — 可视组件。
 
bounds:Rectangle2D (default = null) — 可视组件在元素图层 ElementLayer 中的显示区域。