mx.graphics
public class Stroke
继承Stroke Inheritance EventDispatcher Inheritance Object
实现 IStroke

Stroke 类定义线条的属性。您可以使用 MXML 定义 Stroke 对象,但是必须将该 Stroke 附加到其它对象上,才能在应用程序中显示出来。以下示例首先定义了两个 Stroke 对象,然后将其应用于 LineChart 控件的 horizontalAxisRenderer 中:
...
  <mx:Stroke id="ticks" color="0xFF0000" weight="1"/>
  <mx:Stroke id="mticks" color="0x0000FF" weight="1"/>
  
  <mx:LineChart id="mychart" dataProvider="{ndxa}">
   <mx:horizontalAxisRenderer>
    <mx:AxisRenderer placement="bottom" canDropLabels="true">
     <mx:tickStroke>{ticks}</mx:tickStroke>
     <mx:minorTickStroke>{mticks}</mx:minorTickStroke>
    </mx:AxisRenderer>
   </mx:horizontalAxisRenderer>
  </LineChart>
  ...

MXML 语法expanded隐藏 MXML 语法

The <mx:Stroke> tag inherits all the tag attributes of its superclass, and adds the following tag attributes:

  <mx:Stroke
    Properties
    alpha="1.0"
    caps="null|none|round|square"
    color="0x000000"
    joints="null|bevel|miter|round"
    miterLimit="0"
    pixelHinting="false|true"
    scaleMode="normal|none|noScale|vertical"
    weight="1 (in most cases)"
  />
  

另请参见

flash.display.Graphics
Using strokes with chart controls


公共属性
 属性定义方
  alpha : Number
线条的透明度。
Stroke
  caps : String
指定线条末端处端点类型。
Stroke
  color : uint
线条颜色。
Stroke
 Inheritedconstructor : Object
对类对象或给定对象实例的构造函数的引用。
Object
  joints : String
指定用于拐角的连接外观的类型。
Stroke
  miterLimit : Number
指示将在哪个限制位置切断尖角。
Stroke
  pixelHinting : Boolean
指定是否提示笔触采用完整像素。
Stroke
 Inheritedprototype : Object
[静态] 对类或函数对象的原型对象的引用。
Object
  scaleMode : String
指定如何缩放笔触。
Stroke
  weight : Number
线条粗细(以像素为单位)。
Stroke
公共方法
 方法定义方
  
Stroke(color:uint = 0x000000, weight:Number = 0, alpha:Number = 1.0, pixelHinting:Boolean = false, scaleMode:String = "normal", caps:String = null, joints:String = null, miterLimit:Number = 0)
构造函数。
Stroke
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
使用 EventDispatcher 对象注册事件侦听器对象,以使侦听器能够接收事件通知。
EventDispatcher
  
对指定的 Graphics 对象应用属性。
Stroke
 Inherited
将事件调度到事件流中。
EventDispatcher
 Inherited
检查 EventDispatcher 对象是否为特定事件类型注册了任何侦听器。
EventDispatcher
 Inherited
指示对象是否已经定义了指定的属性。
Object
 Inherited
指示 Object 类的实例是否在指定为参数的对象的原型链中。
Object
 Inherited
指示指定的属性是否存在、是否可枚举。
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
从 EventDispatcher 对象中删除侦听器。
EventDispatcher
 Inherited
设置循环操作动态属性的可用性。
Object
 Inherited
返回指定对象的字符串表示形式。
Object
 Inherited
返回指定对象的原始值。
Object
 Inherited
检查是否用此 EventDispatcher 对象或其任何始祖为指定事件类型注册了事件侦听器。
EventDispatcher
事件
 事件 摘要 定义方
 Inherited[广播事件] Flash Player 或 AIR 应用程序获得操作系统焦点并变为活动状态时将调度此事件。EventDispatcher
 Inherited[广播事件] Flash Player 或 AIR 应用程序失去操作系统焦点并变为非活动状态时将调度此事件。EventDispatcher
属性详细信息
alpha属性
alpha:Number  [读写]

线条的透明度。可能的值为 0.0(不可见)到 1.0(不透明)。

默认值为 1.0..

此属性可用作数据绑定的源。修改此属性后,将调度 propertyChange 事件。



实现
    public function get alpha():Number
    public function set alpha(value:Number):void
caps属性 
caps:String  [读写]

指定线条末端处端点类型。有效值为:"round""square""none"

此属性可用作数据绑定的源。修改此属性后,将调度 propertyChange 事件。



实现
    public function get caps():String
    public function set caps(value:String):void
color属性 
color:uint  [读写]

线条颜色。

默认值为 0x000000 (black)..

此属性可用作数据绑定的源。修改此属性后,将调度 propertyChange 事件。



实现
    public function get color():uint
    public function set color(value:uint):void
joints属性 
joints:String  [读写]

指定用于拐角的连接外观的类型。有效值为 "round""miter""bevel"

此属性可用作数据绑定的源。修改此属性后,将调度 propertyChange 事件。



实现
    public function get joints():String
    public function set joints(value:String):void
miterLimit属性 
miterLimit:Number  [读写]

指示将在哪个限制位置切断尖角。有效值范围是 0 到 255。

默认值为 0.

此属性可用作数据绑定的源。修改此属性后,将调度 propertyChange 事件。



实现
    public function get miterLimit():Number
    public function set miterLimit(value:Number):void
pixelHinting属性 
pixelHinting:Boolean  [读写]

指定是否提示笔触采用完整像素。此值同时影响曲线锚点的位置以及线条笔触大小本身。

默认值为 false.

此属性可用作数据绑定的源。修改此属性后,将调度 propertyChange 事件。



实现
    public function get pixelHinting():Boolean
    public function set pixelHinting(value:Boolean):void
scaleMode属性 
scaleMode:String  [读写]

指定如何缩放笔触。有效值为 "normal""none""vertical""noScale"

默认值为 "normal".

此属性可用作数据绑定的源。修改此属性后,将调度 propertyChange 事件。



实现
    public function get scaleMode():String
    public function set scaleMode(value:String):void
weight属性 
weight:Number  [读写]

线条粗细(以像素为单位)。对于很多图表,默认值都为 1 个像素。

此属性可用作数据绑定的源。修改此属性后,将调度 propertyChange 事件。



实现
    public function get weight():Number
    public function set weight(value:Number):void
构造函数详细信息
Stroke()构造函数
public function Stroke(color:uint = 0x000000, weight:Number = 0, alpha:Number = 1.0, pixelHinting:Boolean = false, scaleMode:String = "normal", caps:String = null, joints:String = null, miterLimit:Number = 0)

构造函数。

参数
color:uint (default = 0x000000) — 指定线条颜色。默认值为 0x000000(黑色)。
 
weight:Number (default = 0) — 指定线条的粗细(以像素为单位)。默认值为 0。
 
alpha:Number (default = 1.0) — 指定 alpha 值,介于 0.0 到 1.0 之间。默认值为 1.0(不透明)。
 
pixelHinting:Boolean (default = false) — 指定是否提示笔触采用完整像素。此值同时影响曲线锚点的位置以及线条笔触大小本身。默认值是 false。
 
scaleMode:String (default = "normal") — 指定如何缩放笔触。有效值为 "normal""none""vertical""noScale"。默认值为 "normal"
 
caps:String (default = null) — 指定线条末端处端点类型。有效值为 "round""square""none"。默认值为 null
 
joints:String (default = null) — 指定用于拐角的连接外观的类型。有效值为 "round""miter""bevel"。默认值为 null
 
miterLimit:Number (default = 0) — 指示将在哪个限制位置切断尖角。有效值范围是 0 到 255。默认值为 0。
方法详细信息
apply()方法
public function apply(g:Graphics):void

对指定的 Graphics 对象应用属性。

参数

g:Graphics — 要对其应用 Stroke 的样式的 Graphics 对象。