Packagecom.degrafa.geometry.command
Classpublic final class CommandStack

The CommandStack manages and stores the render process. All geometry goes through this process at draw time. The command stack provides convenient access to all commands that make up the drawing of the Geometry and helper methods.



Public Properties
 PropertyDefined by
  bounds : Rectangle
[read-only]
CommandStack
  currentAlpha : Number
[static][read-only] The current contextual alpha value that represents nested alpha values during render.
CommandStack
  currentContext : Graphics
[static]
CommandStack
  currentFill : IGraphicsFill
[static]
CommandStack
  currentLayoutMatrix : Matrix
[static]
CommandStack
  currentStroke : IGraphicsStroke
[static]
CommandStack
  currentTransformMatrix : Matrix
[static]
CommandStack
  cursor : DegrafaCursor
[read-only] Returns a working cursor for this command stack
CommandStack
  firstNonCommandStackItem : CommandStackItem
[read-only] Get the first none commandstack type (CommandStackItem.COMMAND_STACK) item in this command stack.
CommandStack
  firstSegmentWithLength : CommandStackItem
[read-only] Returns the first commandStackItem objetc that has length
CommandStack
  globalRenderDelegateEnd : Array
CommandStack
  globalRenderDelegateStart : Array
CommandStack
  invalidated : Boolean
Specifies whether bounds for this object is to be re calculated.
CommandStack
  lastNonCommandStackItem : CommandStackItem
[read-only] get the last none commandstack type (CommandStackItem.COMMAND_STACK) item in this command stack.
CommandStack
  lastSegmentWithLength : CommandStackItem
[read-only] Returns the last commandStackItem objetc that has length
CommandStack
  length : int
The current length(count) of the internal array of command stack items.
CommandStack
  lengthInvalidated : Boolean
Specifies whether the path length for this object is to be re calculated.
CommandStack
  owner : Geometry
CommandStack
  parent : CommandStackItem
CommandStack
  pathLength : Number
[read-only] Returns the length of the combined path elements.
CommandStack
  source : Array
CommandStack
  transformBounds : Rectangle
[read-only] Returns a transformed version of this objects bounds.
CommandStack
  transformedPathLength : Number
[read-only] Returns the transformed length of the combined path elements.
CommandStack
  transMatrix : Matrix
[static]
CommandStack
Public Methods
 MethodDefined by
  
CommandStack(geometry:Geometry = null)
CommandStack
  
Adds a new COMMAND_STACK type item to be processed.
CommandStack
  
addCubicBezierTo(x0:Number, y0:Number, cx:Number, cy:Number, cx1:Number, cy1:Number, x1:Number, y1:Number, tolerance:int = 1):void
Accepts a cubic bezier and adds the CURVE_TO type items requiered to render it.
CommandStack
  
addCurveTo(cx:Number, cy:Number, x1:Number, y1:Number):CommandStackItem
Adds a new CURVE_TO type item to be processed.
CommandStack
  
addDelegate(delegate:Function):CommandStackItem
Adds a new DELEGATE_TO type item to be processed.
CommandStack
  
Adds a new command stack item to be processed.
CommandStack
  
Addes a commandStackItem at the specific location in the source.
CommandStack
  
addLineTo(x:Number, y:Number):CommandStackItem
Adds a new LINE_TO type item to be processed.
CommandStack
  
addMoveTo(x:Number, y:Number):CommandStackItem
Adds a new MOVE_TO type item to be processed.
CommandStack
  
Applies the current layout and transform to a point.
CommandStack
  
draw(graphics:Graphics, rc:Rectangle):Boolean
Initiates the render phase.
CommandStack
  
Return the item at the given index
CommandStack
  
[static] Helper function to permit caching values before nested calls inside a draw/endDraw phase dev: this and related methods may change in the future.
CommandStack
  
pathAngleAt(t:Number):Number
Returns the angle of a point t(0-1) on the path.
CommandStack
  
pathPointAt(t:Number):Point
Returns the point at t(0-1) on the path.
CommandStack
  
[static] Helper function to reset a the rendering context to its default state dev: this and related methods may change in the future.
CommandStack
  
resetBounds():void
Resets the bounds for this command stack.
CommandStack
  
resetCacheValues(values:Object):void
[static] Helper function to reapply a set of cached settings to reset the context dev: this and related methods may change in the future.
CommandStack
  
simpleRender(graphics:Graphics, rc:Rectangle):void
CommandStack
  
stackAlpha(alpha:Number):void
[static] called internally by Geometry during a draw loop to create a nested alpha 'context' dev: this and related methods may change in the future.
CommandStack
  
unstackAlpha():void
[static] called internally during endDraw from Geometry to remove the local alpha 'context' after any children have rendered dev: this and related methods may change in the future.
CommandStack
Public Constants
 ConstantDefined by
  IS_REGISTERED : Boolean
[static]
CommandStack
Property detail
boundsproperty
bounds:Rectangle  [read-only]Implementation
    public function get bounds():Rectangle
currentAlphaproperty 
currentAlpha:Number  [read-only]

The current contextual alpha value that represents nested alpha values during render. This is used during requests from paint objects.

Implementation
    public static function get currentAlpha():Number
currentContextproperty 
public static var currentContext:Graphics
currentFillproperty 
public static var currentFill:IGraphicsFill
currentLayoutMatrixproperty 
public static var currentLayoutMatrix:Matrix
currentStrokeproperty 
public static var currentStroke:IGraphicsStroke
currentTransformMatrixproperty 
public static var currentTransformMatrix:Matrix
cursorproperty 
cursor:DegrafaCursor  [read-only]

Returns a working cursor for this command stack

Implementation
    public function get cursor():DegrafaCursor
firstNonCommandStackItemproperty 
firstNonCommandStackItem:CommandStackItem  [read-only]

Get the first none commandstack type (CommandStackItem.COMMAND_STACK) item in this command stack.

Implementation
    public function get firstNonCommandStackItem():CommandStackItem
firstSegmentWithLengthproperty 
firstSegmentWithLength:CommandStackItem  [read-only]

Returns the first commandStackItem objetc that has length

Implementation
    public function get firstSegmentWithLength():CommandStackItem
globalRenderDelegateEndproperty 
globalRenderDelegateEnd:Array  [read-write]Implementation
    public function get globalRenderDelegateEnd():Array
    public function set globalRenderDelegateEnd(value:Array):void
globalRenderDelegateStartproperty 
globalRenderDelegateStart:Array  [read-write]Implementation
    public function get globalRenderDelegateStart():Array
    public function set globalRenderDelegateStart(value:Array):void
invalidatedproperty 
invalidated:Boolean  [read-write]

Specifies whether bounds for this object is to be re calculated. It will only get recalculated when bounds is requested.

Implementation
    public function get invalidated():Boolean
    public function set invalidated(value:Boolean):void
lastNonCommandStackItemproperty 
lastNonCommandStackItem:CommandStackItem  [read-only]

get the last none commandstack type (CommandStackItem.COMMAND_STACK) item in this command stack.

Implementation
    public function get lastNonCommandStackItem():CommandStackItem
lastSegmentWithLengthproperty 
lastSegmentWithLength:CommandStackItem  [read-only]

Returns the last commandStackItem objetc that has length

Implementation
    public function get lastSegmentWithLength():CommandStackItem
lengthproperty 
length:int  [read-write]

The current length(count) of the internal array of command stack items. Setting the length to 0 will clear all items in the command stack.

Implementation
    public function get length():int
    public function set length(value:int):void
lengthInvalidatedproperty 
lengthInvalidated:Boolean  [read-write]

Specifies whether the path length for this object is to be re calculated. It will only get recalculated when pathLength is requested.

Implementation
    public function get lengthInvalidated():Boolean
    public function set lengthInvalidated(value:Boolean):void
ownerproperty 
public var owner:Geometry
parentproperty 
public var parent:CommandStackItem
pathLengthproperty 
pathLength:Number  [read-only]

Returns the length of the combined path elements.

Implementation
    public function get pathLength():Number
sourceproperty 
public var source:Array
transformBoundsproperty 
transformBounds:Rectangle  [read-only]

Returns a transformed version of this objects bounds. If no transform is specified bounds is returned.

Implementation
    public function get transformBounds():Rectangle
transformedPathLengthproperty 
transformedPathLength:Number  [read-only]

Returns the transformed length of the combined path elements. This is a preliminary implementation and requires optimization.

Implementation
    public function get transformedPathLength():Number
transMatrixproperty 
public static var transMatrix:Matrix
Constructor detail
CommandStack()constructor
public function CommandStack(geometry:Geometry = null)Parameters
geometry:Geometry (default = null)
Method detail
addCommandStack()method
public function addCommandStack(commandStack:CommandStack):CommandStackItem

Adds a new COMMAND_STACK type item to be processed.

Parameters
commandStack:CommandStack

Returns
CommandStackItem
addCubicBezierTo()method 
public function addCubicBezierTo(x0:Number, y0:Number, cx:Number, cy:Number, cx1:Number, cy1:Number, x1:Number, y1:Number, tolerance:int = 1):void

Accepts a cubic bezier and adds the CURVE_TO type items requiered to render it. And returns the array of added CURVE_TO objects.

Parameters
x0:Number
 
y0:Number
 
cx:Number
 
cy:Number
 
cx1:Number
 
cy1:Number
 
x1:Number
 
y1:Number
 
tolerance:int (default = 1)
addCurveTo()method 
public function addCurveTo(cx:Number, cy:Number, x1:Number, y1:Number):CommandStackItem

Adds a new CURVE_TO type item to be processed.

Parameters
cx:Number
 
cy:Number
 
x1:Number
 
y1:Number

Returns
CommandStackItem
addDelegate()method 
public function addDelegate(delegate:Function):CommandStackItem

Adds a new DELEGATE_TO type item to be processed.

Parameters
delegate:Function

Returns
CommandStackItem
addItem()method 
public function addItem(value:CommandStackItem):CommandStackItem

Adds a new command stack item to be processed.

Parameters
value:CommandStackItem

Returns
CommandStackItem
addItemAt()method 
public function addItemAt(value:CommandStackItem, index:int = -1):CommandStackItem

Addes a commandStackItem at the specific location in the source. if index is not specified then the item is appended to the end.

Parameters
value:CommandStackItem
 
index:int (default = -1)

Returns
CommandStackItem
addLineTo()method 
public function addLineTo(x:Number, y:Number):CommandStackItem

Adds a new LINE_TO type item to be processed.

Parameters
x:Number
 
y:Number

Returns
CommandStackItem
addMoveTo()method 
public function addMoveTo(x:Number, y:Number):CommandStackItem

Adds a new MOVE_TO type item to be processed.

Parameters
x:Number
 
y:Number

Returns
CommandStackItem
adjustPointToLayoutAndTransform()method 
public function adjustPointToLayoutAndTransform(point:Point):Point

Applies the current layout and transform to a point.

Parameters
point:Point

Returns
Point
draw()method 
public function draw(graphics:Graphics, rc:Rectangle):Boolean

Initiates the render phase.

Parameters
graphics:Graphics
 
rc:Rectangle

Returns
Boolean — true if the final phase of rendering in Geometry (endDraw) should be skipped
getItem()method 
public function getItem(index:int):CommandStackItem

Return the item at the given index

Parameters
index:int

Returns
CommandStackItem
getSettingsCache()method 
public static function getSettingsCache():Object

Helper function to permit caching values before nested calls inside a draw/endDraw phase dev: this and related methods may change in the future.

Returns
Object — an object holding cached settings to be re-applied following a nested call
pathAngleAt()method 
public function pathAngleAt(t:Number):Number

Returns the angle of a point t(0-1) on the path.

Parameters
t:Number

Returns
Number
pathPointAt()method 
public function pathPointAt(t:Number):Point

Returns the point at t(0-1) on the path.

Parameters
t:Number

Returns
Point
removeContextualSettings()method 
public static function removeContextualSettings():void

Helper function to reset a the rendering context to its default state dev: this and related methods may change in the future.

resetBounds()method 
public function resetBounds():void

Resets the bounds for this command stack.

resetCacheValues()method 
public static function resetCacheValues(values:Object):void

Helper function to reapply a set of cached settings to reset the context dev: this and related methods may change in the future.

Parameters
values:Object
simpleRender()method 
public function simpleRender(graphics:Graphics, rc:Rectangle):voidParameters
graphics:Graphics
 
rc:Rectangle
stackAlpha()method 
public static function stackAlpha(alpha:Number):void

called internally by Geometry during a draw loop to create a nested alpha 'context' dev: this and related methods may change in the future.

Parameters
alpha:Number
unstackAlpha()method 
public static function unstackAlpha():void

called internally during endDraw from Geometry to remove the local alpha 'context' after any children have rendered dev: this and related methods may change in the future.

Constant detail
IS_REGISTEREDconstant
public static const IS_REGISTERED:Boolean