用于 Adobe® Flash® Platform 的 ActionScript® 3.0 参考
主页  |  隐藏包列表和类列表 |   |   |  新增内容  |  索引  |  附录  |  为什么显示为英语?
过滤条件: 正在从服务器检索数据...
正在从服务器检索数据...
spark.primitives 

Ellipse  - AS3 Flex

spark.primitives
public class Ellipse
继承Ellipse Inheritance FilledElement Inheritance StrokedElement Inheritance GraphicElement Inheritance EventDispatcher Inheritance Object

语言版本: ActionScript 3.0
产品版本: Flex 4
运行时版本: Flash Player 10, AIR 1.5

Ellipse 类是绘制椭圆的填充图形元素。为了绘制椭圆,此类会调用 Graphics.drawEllipse() 方法。

查看示例

相关 API 元素



公共属性
 属性由以下参数定义
 Inheritedalpha : Number
图形元素的透明度级别。
GraphicElement
 InheritedalwaysCreateDisplayObject : Boolean
指定此 GraphicElement 是否与其 DisplayObject 相关联,并呈示于 DisplayObject。
GraphicElement
 Inheritedbaseline : Object
从锚点目标到控件的基线位置的垂直距离(以像素为单位)。
GraphicElement
 InheritedbaselinePosition : Number
[只读] 组件第一行文本的基线的 y 坐标。
GraphicElement
 InheritedblendMode : String
BlendMode 类中的一个值,用于指定要使用的混合模式。
GraphicElement
 Inheritedbottom : Object
从组件的下边缘到锚点目标的下边缘的垂直距离(以像素为单位)。
GraphicElement
 Inheritedconstructor : Object
对类对象或给定对象实例的构造函数的引用。
Object
 Inheriteddepth : Number
确定容器内各项目的呈示顺序。
GraphicElement
 InheriteddesignLayer : DesignLayer
指定与该可视元素关联的可选 DesignLayer 实例。
GraphicElement
 InheriteddisplayObject : DisplayObject
[只读] 绘制此 IGraphicElement 所在的共享 DisplayObject。
GraphicElement
 InheriteddisplayObjectSharingMode : String
指示此 IGraphicElement 与其显示对象之间的关联。
GraphicElement
 InheritedexplicitHeight : Number
指定该组件在组件坐标中显式高度(以像素为单位)的数字。
GraphicElement
 InheritedexplicitMaxHeight : Number
布局过程中父级要考虑的组件最大建议高度。
GraphicElement
 InheritedexplicitMaxWidth : Number
布局过程中父级要考虑的组件最大建议宽度。
GraphicElement
 InheritedexplicitMinHeight : Number
布局过程中父级要考虑的组件最小建议高度。
GraphicElement
 InheritedexplicitMinWidth : Number
布局过程中父级要考虑的组件最小建议宽度。
GraphicElement
 InheritedexplicitWidth : Number
指定该组件在组件坐标中显式宽度(以像素为单位)的数字。
GraphicElement
 Inheritedfill : IFill
定义填充的属性的对象。
FilledElement
 Inheritedfilters : Array
包含当前与图形元素关联的每个滤镜对象的索引数组。
GraphicElement
 InheritedhasLayoutMatrix3D : Boolean
[只读] 如果元素具有 3D 矩阵,则为 true。
GraphicElement
 Inheritedheight : Number
图形元素的高度。
GraphicElement
 InheritedhorizontalCenter : Object
从组件中心到锚点目标的内容区域中心的水平距离(以像素为单位)。
GraphicElement
 Inheritedid : String
组件的标识。
GraphicElement
 InheritedincludeInLayout : Boolean
指定此元素是否包含在父代的布局中。
GraphicElement
 Inheritedis3D : Boolean
[只读] 当元素为 3D 时,则为 true。
GraphicElement
 InheritedlayoutDirection : String
指定元素的所需布局方向:LayoutDirection.LTR(从左到右)、LayoutDirection.RTL(从右到左)或 null(继承)。
GraphicElement
 Inheritedleft : Object
从组件的左边缘到锚点目标的左边缘的水平距离(以像素为单位)。
GraphicElement
 InheritedluminosityClip : Boolean
控制发光度遮罩是否剪辑设置了遮罩的内容的属性。
GraphicElement
 InheritedluminosityInvert : Boolean
控制计算由发光度遮罩设置遮罩的图形元素的 RGB 颜色值的属性。
GraphicElement
 Inheritedmask : DisplayObject
调用显示对象被指定的 mask 对象遮罩。
GraphicElement
 InheritedmaskType : String
定义将遮罩应用到 GraphicElement 的方式。可能的值为 MaskType.CLIP、MaskType.ALPHA 和 MaskType.LUMINOSITY。剪辑遮罩 - 遮罩处于剪辑模式下时,会将剪辑遮罩减少至 1 位。
GraphicElement
 InheritedmaxHeight : Number
布局过程中父级要考虑的组件最大建议高度。
GraphicElement
 InheritedmaxWidth : Number
布局过程中父级要考虑的组件最大建议宽度。
GraphicElement
 InheritedmeasuredHeight : Number
组件的默认高度(以像素为单位)。
GraphicElement
 InheritedmeasuredWidth : Number
组件的默认宽度(以像素为单位)。
GraphicElement
 InheritedmeasuredX : Number
相对于元素的原点的默认测量界限左上角。
GraphicElement
 InheritedmeasuredY : Number
相对于元素的原点的默认测量界限左上角。
GraphicElement
 InheritedminHeight : Number
布局过程中父级要考虑的组件最小建议高度。
GraphicElement
 InheritedminWidth : Number
布局过程中父级要考虑的组件最小建议宽度。
GraphicElement
 Inheritedowner : DisplayObjectContainer
此 IVisualElement 对象的所有者。
GraphicElement
 Inheritedparent : DisplayObjectContainer
[只读] 此组件的父容器或组件。
GraphicElement
 InheritedpercentHeight : Number
以组件父代大小百分比的方式指定组件高度。
GraphicElement
 InheritedpercentWidth : Number
以组件父代大小百分比的方式指定组件宽度。
GraphicElement
 InheritedpostLayoutTransformOffsets : mx.geom:TransformOffsets
定义能够应用于对象转换且在一定程度上对其父布局不可视的一组调整。
GraphicElement
 Inheritedright : Object
从组件的右边缘到锚点目标的右边缘的水平距离(以像素为单位)。
GraphicElement
 Inheritedrotation : Number
指示元素从转换点的旋转(以度为单位)。
GraphicElement
 InheritedrotationX : Number
指示 element 实例相对于 3D 父容器距离其原始方向的 x 轴旋转(以度为单位)。
GraphicElement
 InheritedrotationY : Number
表示 DisplayObject 实例相对于 3D 父容器距离其原始方向的 y 轴旋转(以度为单位)。
GraphicElement
 InheritedrotationZ : Number
指示元素从转换点的旋转(以度为单位)。
GraphicElement
 InheritedscaleX : Number
从转换点开始应用的元素的水平缩放比例(百分比)。
GraphicElement
 InheritedscaleY : Number
从转换点开始应用的元素的垂直缩放比例(百分比)。
GraphicElement
 InheritedscaleZ : Number
从转换点开始应用的元素的 z 缩放比例(百分比)。
GraphicElement
 Inheritedstroke : IStroke
此元素所用的笔触。
StrokedElement
 Inheritedtop : Object
从组件的上边缘到锚点目标的上边缘的垂直距离(以像素为单位)。
GraphicElement
 Inheritedtransform : flash.geom:Transform
一个对象,具有与显示对象的矩阵、颜色转换和像素范围有关的属性。
GraphicElement
 InheritedtransformX : Number
元素的 x 位置转换点。
GraphicElement
 InheritedtransformY : Number
元素的 y 位置转换点。
GraphicElement
 InheritedtransformZ : Number
元素的 z 位置转换点。
GraphicElement
 InheritedverticalCenter : Object
从组件中心到锚点目标的内容区域中心的垂直距离(以像素为单位)。
GraphicElement
 Inheritedvisible : Boolean
控制此可视元素的可见性。
GraphicElement
 Inheritedwidth : Number
图形元素的宽度。
GraphicElement
 Inheritedx : Number
图形元素的 x 位置。
GraphicElement
 Inheritedy : Number
图形元素的 y 位置。
GraphicElement
 Inheritedz : Number
图形元素的 z 位置。
GraphicElement
受保护的属性
 属性由以下参数定义
 InheriteddrawnDisplayObject : DisplayObject
[只读] GraphicElement 在其中绘制的实际 DisplayObject。
GraphicElement
 InheriteddrawX : Number
[只读] 应该绘制元素的 x 位置。
GraphicElement
 InheriteddrawY : Number
[只读] 应该绘制元素的 y 位置。
GraphicElement
 InheritedhasComplexLayoutMatrix : Boolean
[只读] 如果 GraphicElement 具有任何非平移 (x,y) 转换属性,则返回 true。
GraphicElement
 InheritedlayoutFeatures : AdvancedLayoutFeatures
包含 GraphicElement 实现转换和分层支持的方法的所有实现细节。
GraphicElement
 InheritedneedsDisplayObject : Boolean
[只读] 如果元素需要一个独占 DisplayObject,则为 true。
GraphicElement
公共方法
 方法由以下参数定义
  
构造函数。
Ellipse
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
使用 EventDispatcher 对象注册事件侦听器对象,以使侦听器能够接收事件通知。
EventDispatcher
 Inherited
如果此 IGraphicElement 是兼容的且可以与序列中下一个 IGraphicElement 共享显示对象,则返回 true。
GraphicElement
 Inherited
如果此 IGraphicElement 是兼容的且可以与序列中上一个 IGraphicElement 共享显示对象,则返回 true。
GraphicElement
 Inherited
创建一个新 DisplayObject 以用于绘制此 IGraphicElement。
GraphicElement
 Inherited
将事件调度到事件流中。
EventDispatcher
  
getBoundsXAtSize(width:Number, height:Number, postLayoutTransform:Boolean = true):Number
[覆盖] 按指定的元素大小,返回元素边界的 x 坐标。
Ellipse
  
getBoundsYAtSize(width:Number, height:Number, postLayoutTransform:Boolean = true):Number
[覆盖] 按指定的元素大小,返回元素边界的 y 坐标。
Ellipse
 Inherited
getLayoutBoundsHeight(postLayoutTransform:Boolean = true):Number
返回元素的布局高度。
GraphicElement
 Inherited
getLayoutBoundsWidth(postLayoutTransform:Boolean = true):Number
返回元素的布局宽度。
GraphicElement
 Inherited
getLayoutBoundsX(postLayoutTransform:Boolean = true):Number
返回元素在屏幕上进行绘制时所用的 x 坐标。
GraphicElement
 Inherited
getLayoutBoundsY(postLayoutTransform:Boolean = true):Number
返回元素在屏幕上进行绘制时所用的 y 坐标。
GraphicElement
 Inherited
返回用于相对于其同级组件计算组件的布局的转换矩阵。
GraphicElement
 Inherited
返回此元素的布局转换 Matrix3D。
GraphicElement
 Inherited
getMaxBoundsHeight(postLayoutTransform:Boolean = true):Number
返回元素的最大高度。
GraphicElement
 Inherited
getMaxBoundsWidth(postLayoutTransform:Boolean = true):Number
返回元素的最大宽度。
GraphicElement
 Inherited
getMinBoundsHeight(postLayoutTransform:Boolean = true):Number
返回元素的最小高度。
GraphicElement
 Inherited
getMinBoundsWidth(postLayoutTransform:Boolean = true):Number
返回元素的最小宽度。
GraphicElement
 Inherited
getPreferredBoundsHeight(postLayoutTransform:Boolean = true):Number
返回元素的首选高度。
GraphicElement
 Inherited
getPreferredBoundsWidth(postLayoutTransform:Boolean = true):Number
返回元素的首选宽度。
GraphicElement
 Inherited
检查 EventDispatcher 对象是否为特定事件类型注册了任何侦听器。
EventDispatcher
 Inherited
表示对象是否已经定义了指定的属性。
Object
 Inherited
如果 GraphicElement 是使用 MXML 标签创建的,则由 MXML 编译器自动调用。
GraphicElement
 Inherited
调用此方法将导致在呈示显示列表前调用元素的 validateDisplayList() 方法。
GraphicElement
 Inherited
当某元素的 layoutDirection 更改或其父代的 layoutDirection 更改时,该元素必须调用该方法。
GraphicElement
 Inherited
调用此方法将导致在呈示显示列表前调用元素的 validateProperties() 方法。
GraphicElement
 Inherited
调用此方法将导致在呈示显示列表前调用元素的 validateSize() 方法。
GraphicElement
 Inherited
表示 Object 类的实例是否在指定为参数的对象的原型链中。
Object
 Inherited
将 Point 对象从对象的(局部)坐标转换为舞台(全局)坐标。
GraphicElement
 Inherited
将 IGraphicElement 添加到主机组件或从主机组件将其删除时由 IGraphicElementContainer 调用。
GraphicElement
 Inherited
表示指定的属性是否存在、是否可枚举。
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
从 EventDispatcher 对象中删除侦听器。
EventDispatcher
 Inherited
setLayoutBoundsPosition(newBoundsX:Number, newBoundsY:Number, postLayoutTransform:Boolean = true):void
设置元素在屏幕上进行绘制时所用的坐标。
GraphicElement
 Inherited
setLayoutBoundsSize(width:Number, height:Number, postLayoutTransform:Boolean = true):void
设置元素的布局大小。
GraphicElement
 Inherited
setLayoutMatrix(value:Matrix, invalidateLayout:Boolean):void
设置用于相对于其同级组件计算组件的布局大小和位置的转换 Matrix。
GraphicElement
 Inherited
setLayoutMatrix3D(value:Matrix3D, invalidateLayout:Boolean):void
设置用于计算组件相对于其同级组件的布局大小和位置的转换 Matrix3D。
GraphicElement
 Inherited
设置循环操作动态属性的可用性。
Object
 Inherited
确定此元素是否可以将它自己绘制到该序列的 sharedDisplayObject。
GraphicElement
 Inherited
返回此对象的字符串表示形式,其格式设置遵守区域设置特定的约定。
Object
 Inherited
返回指定对象的字符串表示形式。
Object
 Inherited
transformAround(transformCenter:Vector3D, scale:Vector3D = null, rotation:Vector3D = null, translation:Vector3D = null, postLayoutScale:Vector3D = null, postLayoutRotation:Vector3D = null, postLayoutTranslation:Vector3D = null, invalidateLayout:Boolean = true):void
用于更新转换的旋转、缩放和平移的一种实用程序方法,同时保留某个特定点,该点是在组件自己的坐标空间中指定的,且在父项的坐标空间中是固定的。
GraphicElement
 Inherited
transformPointToParent(localPosition:Vector3D, position:Vector3D, postLayoutPosition:Vector3D):void
一种实用程序方法,用于将以该对象的本地坐标指定的点转换为在该对象父坐标中的相应位置。
GraphicElement
 Inherited
由 IGraphicElementContainer 调用以在其 displayObject 属性中重新绘制此元素。
GraphicElement
 Inherited
根据需要,通过立即调用 validateProperties()、validateSize() 和 validateDisplayList() 来验证并更新此对象的属性和布局。
GraphicElement
 Inherited
由布局逻辑用于通过调用 commitProperties() 方法来验证组件的属性。
GraphicElement
 Inherited
由 IGraphicElementContainer 调用以验证此元素的大小。
GraphicElement
 Inherited
返回指定对象的原始值。
Object
 Inherited
检查是否用此 EventDispatcher 对象或其任何祖代为指定事件类型注册了事件侦听器。
EventDispatcher
受保护的方法
 方法由以下参数定义
 Inherited
[覆盖] 为此元素设置绘制。
FilledElement
 Inherited
确定是否可以跳过对 measure() 方法的调用。
GraphicElement
 Inherited
处理在元素上设置的属性。
GraphicElement
  
[覆盖] 绘制元素。
Ellipse
 Inherited
[覆盖] 完成此元素的绘制。
FilledElement
 Inherited
getStrokeExtents(postLayoutTransform:Boolean = true):Rectangle
返回元素界限每一侧上的笔触所占据的像素数。
GraphicElement
 Inherited
通知主机此元素已更改且需要更新其图层的实用程序方法。
GraphicElement
 Inherited
此对象影响其布局时(includeInLayout 为 true),使父代大小和显示列表失效的 Helper 方法。
GraphicElement
 Inherited
计算元素的默认大小。
GraphicElement
 Inherited
用于 ILayoutElement 接口的实现,返回显式度量的高度预转换。
GraphicElement
 Inherited
用于 ILayoutElement 接口的实现,返回测量宽度预转换的显式。
GraphicElement
 Inherited
transformHeightForLayout(width:Number, height:Number, postLayoutTransform:Boolean = true):Number
转换元素的大小。
GraphicElement
 Inherited
transformWidthForLayout(width:Number, height:Number, postLayoutTransform:Boolean = true):Number
转换元素的大小。
GraphicElement
 Inherited
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
[覆盖] 绘制元素和/或调整其内容的大小并定位该内容。
StrokedElement
事件
 事件 摘要 由以下参数定义
 Inherited[广播事件] Flash Player 或 AIR 应用程序获得操作系统焦点并变为活动状态时将调度此事件。EventDispatcher
 Inherited[广播事件] Flash Player 或 AIR 应用程序失去操作系统焦点并变为非活动状态时将调度此事件。EventDispatcher
构造函数详细信息

Ellipse

()构造函数
public function Ellipse()

语言版本: ActionScript 3.0
产品版本: Flex 4
运行时版本: Flash Player 10, AIR 1.5

构造函数。

方法详细信息

draw

()方法
override protected function draw(g:Graphics):void

语言版本: ActionScript 3.0
产品版本: Flex 4
运行时版本: Flash Player 10, AIR 1.5

绘制元素。这是在绘制过程中采取的三个步骤中的第二步。覆盖此方法以实现绘图。已在 beginDraw() 方法中设置笔触(和填充,如果有)。您的覆盖仅应包含对诸如 moveTo()curveTo()drawRect() 等绘制方法的调用。

参数

g:Graphics — 要绘制的图形元素。

getBoundsXAtSize

()方法 
override public function getBoundsXAtSize(width:Number, height:Number, postLayoutTransform:Boolean = true):Number

语言版本: ActionScript 3.0
产品版本: Flex 4
运行时版本: Flash Player 10, AIR 1.5

按指定的元素大小,返回元素边界的 x 坐标。

如果将元素大小调整为特定尺寸,则此方法通常在调用 measure() 方法期间由布局使用,以预测该元素将来的位置。

参数

width:Number — 元素的界限宽度,或要使用首选宽度的 NaN。
 
height:Number — 元素的界限高度,或要使用首选高度的 NaN。
 
postLayoutTransform:Boolean (default = true) — 当 postLayoutTransform 为 true 时,该方法会返回元素边框左上角的 x 坐标。边框位于元素的父坐标空间中,并基于指定的边界大小、布局位置和布局转换矩阵进行计算。

返回
Number — 按指定的元素大小,元素边界的 x 坐标。

getBoundsYAtSize

()方法 
override public function getBoundsYAtSize(width:Number, height:Number, postLayoutTransform:Boolean = true):Number

语言版本: ActionScript 3.0
产品版本: Flex 4
运行时版本: Flash Player 10, AIR 1.5

按指定的元素大小,返回元素边界的 y 坐标。如果将元素大小调整为特定尺寸,则此方法通常在调用 measure() 期间由布局使用,以预测该元素将来的位置。

参数

width:Number — 元素的界限宽度,或要使用首选宽度的 NaN。
 
height:Number — 元素的界限高度,或要使用首选高度的 NaN。
 
postLayoutTransform:Boolean (default = true) — 当 postLayoutTransform 为 true 时,该方法会返回元素边框左上角的 y 坐标。边框位于元素的父坐标空间中,并基于指定的边界大小、布局位置和布局转换矩阵进行计算。

返回
Number — 按指定的元素大小,元素边界的 y 坐标。
EllipseExample.mxml
<?xml version="1.0" encoding="utf-8"?>
<!-- EllipseExample.mxml -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark">

    <s:Panel title="Ellipse Graphic Example"
            width="75%" height="75%"
            horizontalCenter="0" verticalCenter="0">
        <s:Graphic horizontalCenter="0" verticalCenter="0">
            <s:Ellipse height="100" width="250">
                <s:stroke>
                    <s:SolidColorStroke color="0x000000" weight="2"/>
                </s:stroke>
                <s:fill>
                    <s:RadialGradient>
                        <s:entries>
                            <s:GradientEntry color="0x0056FF" ratio="0.00" alpha="0.5"/>
                            <s:GradientEntry color="0x00CC99" ratio="0.33" alpha="0.5"/>
                            <s:GradientEntry color="0xECEC21" ratio="0.66" alpha="0.5"/>
                        </s:entries>
                    </s:RadialGradient>
                </s:fill>
            </s:Ellipse>
        </s:Graphic>
    </s:Panel>

</s:Application>




[ X ]为什么显示为英语?
《ActionScript 3.0 参考》中的内容以英语显示

《ActionScript 3.0 参考》中的部分内容未翻译成所有语言。当某个语言元素未翻译时,将显示为英语。例如,ga.controls.HelpBox 类未翻译成任何语言。因此在简体中文版的参考中,ga.controls.HelpBox 类显示为英语。