Packagecom.degrafa.geometry
Classpublic class Geometry
InheritanceGeometry Inheritance com.degrafa.core.DegrafaObject
Implements com.degrafa.core.IDegrafaObject, com.degrafa.IGeometryComposition, com.degrafa.states.IDegrafaStateClient, mx.styles.ISimpleStyleClient
Subclasses Wedge

A geometry object is a type of Degrafa object that enables rendering to a graphics context. Degrafa provides a number of ready-to-use geometry objects. All geometry objects inherit from the Geometry class. All geometry objects have a default data property that can be used for short hand property setting.

Default MXML Propertygeometry



Public Properties
 PropertyDefined By
  alpha : Number
The alpha setting that applies to this object.
Geometry
  autoClearGraphicsTarget : Boolean
When using a graphicsTarget and if this property is set to true the draw phase will clear the graphics context before drawing.
Geometry
  bottom : Number
When set, the bottom of the layout will be located offset from the bottom of it's parent.
Geometry
  bounds : Rectangle
[read-only] The tight bounds of this element as represented by a Rectangle.
Geometry
  clippingRectangle : Rectangle
A clipping rectangle to use when rendering this geometry.
Geometry
  commandStack : CommandStack
Provides access to the command stack.
Geometry
  currentState : String
The current view state.
Geometry
  data : Object
Allows a short hand property setting that is specific to and parsed by each geometry object.
Geometry
  decoratorCollection : DecoratorCollection
[read-only] Access to the Decorator collection object for this Geometry object.
Geometry
  decorators : Array
A array of IDecorator objects to be applied on this Geometry.
Geometry
  fill : IGraphicsFill
Defines the fill object that will be used for rendering this geometry object.
Geometry
  filters : Array
An array of BitmapFilter objects applied to this Geometry.
Geometry
  geometricLength : Number
[read-only] Returns geometric length of this object.
Geometry
  geometry : Array
A array of IGeometryComposition objects.
Geometry
  geometryCollection : GeometryCollection
[read-only] Access to the Degrafa geometry collection object for this geometry object.
Geometry
  graphicsTarget : Array
One or more display object's that this Geometry is to be drawn to.
Geometry
  graphicsTargetCollection : DisplayObjectCollection
[read-only] Access to the Degrafa target collection object for this geometry object.
Geometry
  hasDecorators : Boolean
Returns true if this Geometry has decorators.
Geometry
  hasFilters : Boolean
Returns true if this Geometry has filters.
Geometry
  hasLayout : Boolean
Returns true if this Geometry has layout.
Geometry
  hasStates : Boolean
Returns true if this Geometry has states.
Geometry
  hasTriggers : Boolean
Returns true if this Geometry has triggers.
Geometry
  height : Number
Defines the height of the layout boundary.
Geometry
  horizontalCenter : Number
When set, if left or right is not set, the layout will be centered horizontally offset by the numeric value of this property.
Geometry
  IGraphicParent : IGraphic
Geometry
  inheritFill : Boolean
If set to true and no fill is defined and there is a parent object then this object will walk up through the parents to retrive a fill object.
Geometry
  inheritStroke : Boolean
If set to true and no stroke is defined and there is a parent object then this object will walk up through the parents to retrive a stroke object.
Geometry
  invalidated : Boolean
Specifies whether this object is to be re calculated on the next cycle.
Geometry
  isInvalidated : Boolean
[read-only] Returns true if this Geometry object is invalidated
Geometry
  isRootGeometry : Boolean
[read-only] Returns true if this Geometry object is a root Geometry Object.
Geometry
  layoutConstraint : LayoutConstraint
The layout constraint that is used for positioning/sizing this geometry object.
Geometry
  _layoutMatrix : Matrix
Access to the layout matrix if this Geometry has layout.
Geometry
  layoutRectangle : Rectangle
[read-only] Returns the constraint based layout rectangle for this object or bounds if no layout constraint is specified.
Geometry
  left : Number
When set, the left of the layout will be located offset by the value of this property multiplied by the containing width.
Geometry
  maintainAspectRatio : Boolean
When true, the size of the layout will always maintain an aspect ratio relative to the ratio of the current width and height properties, even if those properties are not in control of the height and width of the layout.
Geometry
  mask : IGeometryComposition
A separate geometry object to use as a mask when rendering this geometry.
Geometry
  maskMode : String
The mode used when this object is being masked by the geometry assigned to the mask property.
Geometry
  maskSpace : String
The coordinate space within which the referenced mask geometry is rendered before being applied as a mask (respecting maskMode) to this object.
Geometry
  maxHeight : Number
The maximum height that can be applied to the layout.
Geometry
  maxWidth : Number
The maximum width that can be applied to the layout.
Geometry
  maxX : Number
The maximum x location that can be applied to the layout.
Geometry
  maxY : Number
The maximum y location that can be applied to the layout.
Geometry
  minHeight : Number
The minimum height that can be applied to the layout.
Geometry
  minWidth : Number
The minimum width that can be applied to the layout.
Geometry
  minX : Number
The minimum x location that can be applied to the layout.
Geometry
  minY : Number
The minimum y location that can be applied to the layout.
Geometry
  percentHeight : Number
When set, the height of the layout will be set as the value of this property multiplied by the containing height.
Geometry
  percentWidth : Number
When set, the width of the layout will be set as the value of this property multiplied by the containing width.
Geometry
  right : Number
When set, the right of the layout will be located offset by the value of this property multiplied by the containing width.
Geometry
  scaleOnLayout : Boolean
When using layout this flag will determine if you want Scale to be applied to fit layout rules
Geometry
  state : String
The state at which to draw this object.
Geometry
  stateEvent : String
The state event at which to draw this object.
Geometry
  states : Array
An array of states defined for this Geometry.
Geometry
  stroke : IGraphicsStroke
Defines the stroke object that will be used for rendering this geometry object.
Geometry
  styleName : Object
The css style name associated with this Geometry.
Geometry
  targetCoordinateSpace : DisplayObject
The display object that defines the coordinate system to use.
Geometry
  top : Number
When set, the top of the layout will be located offset from the top of it's parent.
Geometry
  transform : ITransform
Defines the transform object that will be used for rendering this geometry object.
Geometry
  transformBounds : Rectangle
[read-only] Returns a transformed version of this objects bounds as represented by a Rectangle.
Geometry
  transformContext : Matrix
A reference to the transformation matrix context within which local transforms will be applied.
Geometry
  triggers : Array
An array of ITrigger objects that this Geometry object will use.
Geometry
  verticalCenter : Number
When set, if top or bottom is not set, the layout will be centered vertically offset by the numeric value of this property.
Geometry
  visible : Boolean
Controls the visibility of this geometry object.
Geometry
  width : Number
Defines the width of the layout.
Geometry
  x : Number
Defines the x location (top left) of the layout.
Geometry
  y : Number
Defines the y location (top left) of the layout.
Geometry
Protected Properties
 PropertyDefined By
  _fill : IGraphicsFill
Geometry
  _stroke : IGraphicsStroke
Geometry
Public Methods
 MethodDefined By
  
angleAt(t:Number):Number
Returns the angle of a point t(0-1) on the path.
Geometry
  
calculateLayout(childBounds:Rectangle = null):void
Performs the layout calculations if required.
Geometry
  
Clears all graphics targets specified in the graphicsTarget array.
Geometry
  
draw(graphics:Graphics, rc:Rectangle):void
Begins the draw phase for geometry objects.
Geometry
  
Requests a draw for each graphics target specified in the graphicsTarget array.
Geometry
  
endDraw(graphics:Graphics):void
Ends the draw phase for geometry objects.
Geometry
  
initFill(graphics:Graphics, rc:Rectangle):void
Initialise the fill for this geometry object.
Geometry
  
initStroke(graphics:Graphics, rc:Rectangle):void
Initialise the stroke for this geometry object.
Geometry
  
pointAt(t:Number):Point
Returns the point at t(0-1) on this object.
Geometry
  
preDraw():void
Performs any pre calculation that is required to successfully render this element.
Geometry
  
styleChanged(styleProp:String):void
Called when the value of a style property is changed.
Geometry
Protected Methods
 MethodDefined By
  
propertyChangeHandler(event:PropertyChangeEvent):void
Principle event handler for any property changes to a geometry object or it's child objects.
Geometry
Property Detail
_fillproperty
protected var _fill:IGraphicsFill

_layoutMatrixproperty 
public var _layoutMatrix:Matrix

Access to the layout matrix if this Geometry has layout.

_strokeproperty 
protected var _stroke:IGraphicsStroke

alphaproperty 
alpha:Number  [read-write]

The alpha setting that applies to this object. Actual alpha used when rendering reflects this objects parent chain alpha settings. If this object descends from other geometries with alpha settings less than, the combined effect of the parent alphas is used in conjunction with the setting on this object.


Implementation
    public function get alpha():Number
    public function set alpha(value:Number):void
autoClearGraphicsTargetproperty 
autoClearGraphicsTarget:Boolean  [read-write]

When using a graphicsTarget and if this property is set to true the draw phase will clear the graphics context before drawing.


Implementation
    public function get autoClearGraphicsTarget():Boolean
    public function set autoClearGraphicsTarget(value:Boolean):void
bottomproperty 
bottom:Number  [read-write]

When set, the bottom of the layout will be located offset from the bottom of it's parent.


Implementation
    public function get bottom():Number
    public function set bottom(value:Number):void
boundsproperty 
bounds:Rectangle  [read-only]

The tight bounds of this element as represented by a Rectangle. The value does not include children.


Implementation
    public function get bounds():Rectangle
clippingRectangleproperty 
clippingRectangle:Rectangle  [read-write]

A clipping rectangle to use when rendering this geometry.


Implementation
    public function get clippingRectangle():Rectangle
    public function set clippingRectangle(value:Rectangle):void
commandStackproperty 
commandStack:CommandStack  [read-write]

Provides access to the command stack.


Implementation
    public function get commandStack():CommandStack
    public function set commandStack(value:CommandStack):void
currentStateproperty 
currentState:String  [read-write]

The current view state.

This property can be used as the source for data binding.


Implementation
    public function get currentState():String
    public function set currentState(value:String):void
dataproperty 
data:Object  [read-write]

Allows a short hand property setting that is specific to and parsed by each geometry object. Look at the various geometry objects to learn what this setting requires.


Implementation
    public function get data():Object
    public function set data(value:Object):void
decoratorCollectionproperty 
decoratorCollection:DecoratorCollection  [read-only]

Access to the Decorator collection object for this Geometry object.


Implementation
    public function get decoratorCollection():DecoratorCollection
decoratorsproperty 
decorators:Array  [read-write]

A array of IDecorator objects to be applied on this Geometry.


Implementation
    public function get decorators():Array
    public function set decorators(value:Array):void
fillproperty 
fill:IGraphicsFill  [read-write]

Defines the fill object that will be used for rendering this geometry object.


Implementation
    public function get fill():IGraphicsFill
    public function set fill(value:IGraphicsFill):void
filtersproperty 
filters:Array  [read-write]

An array of BitmapFilter objects applied to this Geometry.


Implementation
    public function get filters():Array
    public function set filters(value:Array):void
geometricLengthproperty 
geometricLength:Number  [read-only]

Returns geometric length of this object. The value does not include children.


Implementation
    public function get geometricLength():Number
geometryproperty 
geometry:Array  [read-write]

A array of IGeometryComposition objects.


Implementation
    public function get geometry():Array
    public function set geometry(value:Array):void
geometryCollectionproperty 
geometryCollection:GeometryCollection  [read-only]

Access to the Degrafa geometry collection object for this geometry object.


Implementation
    public function get geometryCollection():GeometryCollection
graphicsTargetproperty 
graphicsTarget:Array  [read-write]

One or more display object's that this Geometry is to be drawn to. During the drawing phase this is tested first. If items have been defined the drawing of the geometry is done on each item(s) graphics context.


Implementation
    public function get graphicsTarget():Array
    public function set graphicsTarget(value:Array):void
graphicsTargetCollectionproperty 
graphicsTargetCollection:DisplayObjectCollection  [read-only]

Access to the Degrafa target collection object for this geometry object.


Implementation
    public function get graphicsTargetCollection():DisplayObjectCollection
hasDecoratorsproperty 
public var hasDecorators:Boolean

Returns true if this Geometry has decorators.

hasFiltersproperty 
public var hasFilters:Boolean

Returns true if this Geometry has filters.

hasLayoutproperty 
public var hasLayout:Boolean

Returns true if this Geometry has layout.

hasStatesproperty 
public var hasStates:Boolean

Returns true if this Geometry has states.

hasTriggersproperty 
public var hasTriggers:Boolean

Returns true if this Geometry has triggers.

heightproperty 
height:Number  [read-write]

Defines the height of the layout boundary. Once top (or percentTop) or bottom (or percentBottom) is set, the width value no longer applies. If percentWidth exists when width is set, percentWidth will be overridden and be given a value of NaN. This property also accepts a percent value for example 75%.


Implementation
    public function get height():Number
    public function set height(value:Number):void
horizontalCenterproperty 
horizontalCenter:Number  [read-write]

When set, if left or right is not set, the layout will be centered horizontally offset by the numeric value of this property.


Implementation
    public function get horizontalCenter():Number
    public function set horizontalCenter(value:Number):void
IGraphicParentproperty 
IGraphicParent:IGraphic  [read-write]


Implementation
    public function get IGraphicParent():IGraphic
    public function set IGraphicParent(value:IGraphic):void
inheritFillproperty 
inheritFill:Boolean  [read-write]

If set to true and no fill is defined and there is a parent object then this object will walk up through the parents to retrive a fill object.


Implementation
    public function get inheritFill():Boolean
    public function set inheritFill(value:Boolean):void
inheritStrokeproperty 
inheritStroke:Boolean  [read-write]

If set to true and no stroke is defined and there is a parent object then this object will walk up through the parents to retrive a stroke object.


Implementation
    public function get inheritStroke():Boolean
    public function set inheritStroke(value:Boolean):void
invalidatedproperty 
invalidated:Boolean  [read-write]

Specifies whether this object is to be re calculated on the next cycle. Only property updates which affect the computation of this object set this property


Implementation
    public function get invalidated():Boolean
    public function set invalidated(value:Boolean):void
isInvalidatedproperty 
isInvalidated:Boolean  [read-only]

Returns true if this Geometry object is invalidated


Implementation
    public function get isInvalidated():Boolean
isRootGeometryproperty 
isRootGeometry:Boolean  [read-only]

Returns true if this Geometry object is a root Geometry Object.


Implementation
    public function get isRootGeometry():Boolean
layoutConstraintproperty 
layoutConstraint:LayoutConstraint  [read-write]

The layout constraint that is used for positioning/sizing this geometry object.


Implementation
    public function get layoutConstraint():LayoutConstraint
    public function set layoutConstraint(value:LayoutConstraint):void
layoutRectangleproperty 
layoutRectangle:Rectangle  [read-only]

Returns the constraint based layout rectangle for this object or bounds if no layout constraint is specified.


Implementation
    public function get layoutRectangle():Rectangle
leftproperty 
left:Number  [read-write]

When set, the left of the layout will be located offset by the value of this property multiplied by the containing width.


Implementation
    public function get left():Number
    public function set left(value:Number):void
maintainAspectRatioproperty 
maintainAspectRatio:Boolean  [read-write]

When true, the size of the layout will always maintain an aspect ratio relative to the ratio of the current width and height properties, even if those properties are not in control of the height and width of the layout.


Implementation
    public function get maintainAspectRatio():Boolean
    public function set maintainAspectRatio(value:Boolean):void
maskproperty 
mask:IGeometryComposition  [read-write]

A separate geometry object to use as a mask when rendering this geometry.


Implementation
    public function get mask():IGeometryComposition
    public function set mask(value:IGeometryComposition):void
maskModeproperty 
maskMode:String  [read-write]

The mode used when this object is being masked by the geometry assigned to the mask property. The value can either be "clip" or "mask". Clip mode is shape based clipping, alpha mode is alpha based masking. "svgClip" is a mode that mimics svg's clip-path setting with a non-zero clip-rule and userSpaceOnUse clipping units


Implementation
    public function get maskMode():String
    public function set maskMode(value:String):void
maskSpaceproperty 
maskSpace:String  [read-write]

The coordinate space within which the referenced mask geometry is rendered before being applied as a mask (respecting maskMode) to this object.


Implementation
    public function get maskSpace():String
    public function set maskSpace(value:String):void
maxHeightproperty 
maxHeight:Number  [read-write]

The maximum height that can be applied to the layout.


Implementation
    public function get maxHeight():Number
    public function set maxHeight(value:Number):void
maxWidthproperty 
maxWidth:Number  [read-write]

The maximum width that can be applied to the layout.


Implementation
    public function get maxWidth():Number
    public function set maxWidth(value:Number):void
maxXproperty 
maxX:Number  [read-write]

The maximum x location that can be applied to the layout.


Implementation
    public function get maxX():Number
    public function set maxX(value:Number):void
maxYproperty 
maxY:Number  [read-write]

The maximum y location that can be applied to the layout.


Implementation
    public function get maxY():Number
    public function set maxY(value:Number):void
minHeightproperty 
minHeight:Number  [read-write]

The minimum height that can be applied to the layout.


Implementation
    public function get minHeight():Number
    public function set minHeight(value:Number):void
minWidthproperty 
minWidth:Number  [read-write]

The minimum width that can be applied to the layout.


Implementation
    public function get minWidth():Number
    public function set minWidth(value:Number):void
minXproperty 
minX:Number  [read-write]

The minimum x location that can be applied to the layout.


Implementation
    public function get minX():Number
    public function set minX(value:Number):void
minYproperty 
minY:Number  [read-write]

The minimum y location that can be applied to the layout.


Implementation
    public function get minY():Number
    public function set minY(value:Number):void
percentHeightproperty 
percentHeight:Number  [read-write]

When set, the height of the layout will be set as the value of this property multiplied by the containing height. A value of 0 represents 0% and 1 represents 100% a value of 75 represents 75%.


Implementation
    public function get percentHeight():Number
    public function set percentHeight(value:Number):void
percentWidthproperty 
percentWidth:Number  [read-write]

When set, the width of the layout will be set as the value of this property multiplied by the containing width. A value of 0 represents 0% and 1 represents 100% a value of 75 represents 75%.


Implementation
    public function get percentWidth():Number
    public function set percentWidth(value:Number):void
rightproperty 
right:Number  [read-write]

When set, the right of the layout will be located offset by the value of this property multiplied by the containing width.


Implementation
    public function get right():Number
    public function set right(value:Number):void
scaleOnLayoutproperty 
scaleOnLayout:Boolean  [read-write]

When using layout this flag will determine if you want Scale to be applied to fit layout rules


Implementation
    public function get scaleOnLayout():Boolean
    public function set scaleOnLayout(value:Boolean):void
stateproperty 
state:String  [read-write]

The state at which to draw this object. This property is specific to Skinning.


Implementation
    public function get state():String
    public function set state(value:String):void
stateEventproperty 
stateEvent:String  [read-write]

The state event at which to draw this object. This property is specific to Skinning.


Implementation
    public function get stateEvent():String
    public function set stateEvent(value:String):void
statesproperty 
states:Array  [read-write]

An array of states defined for this Geometry.


Implementation
    public function get states():Array
    public function set states(value:Array):void
strokeproperty 
stroke:IGraphicsStroke  [read-write]

Defines the stroke object that will be used for rendering this geometry object.


Implementation
    public function get stroke():IGraphicsStroke
    public function set stroke(value:IGraphicsStroke):void
styleNameproperty 
styleName:Object  [read-write]

The css style name associated with this Geometry. Not yet fully implemented as of Beta 3.


Implementation
    public function get styleName():Object
    public function set styleName(value:Object):void
targetCoordinateSpaceproperty 
targetCoordinateSpace:DisplayObject  [read-write]

The display object that defines the coordinate system to use. Dev Note:: Not yet implemented as of Beta 3.


Implementation
    public function get targetCoordinateSpace():DisplayObject
    public function set targetCoordinateSpace(value:DisplayObject):void
topproperty 
top:Number  [read-write]

When set, the top of the layout will be located offset from the top of it's parent.


Implementation
    public function get top():Number
    public function set top(value:Number):void
transformproperty 
transform:ITransform  [read-write]

Defines the transform object that will be used for rendering this geometry object.


Implementation
    public function get transform():ITransform
    public function set transform(value:ITransform):void
transformBoundsproperty 
transformBounds:Rectangle  [read-only]

Returns a transformed version of this objects bounds as represented by a Rectangle. If no transform is specified bounds is returned. The value does not include children.


Implementation
    public function get transformBounds():Rectangle
transformContextproperty 
transformContext:Matrix  [read-write]

A reference to the transformation matrix context within which local transforms will be applied. Similar in concept to the concatenatedMatrix on a flash DisplayObjects transform property.


Implementation
    public function get transformContext():Matrix
    public function set transformContext(value:Matrix):void
triggersproperty 
triggers:Array  [read-write]

An array of ITrigger objects that this Geometry object will use.


Implementation
    public function get triggers():Array
    public function set triggers(value:Array):void
verticalCenterproperty 
verticalCenter:Number  [read-write]

When set, if top or bottom is not set, the layout will be centered vertically offset by the numeric value of this property.


Implementation
    public function get verticalCenter():Number
    public function set verticalCenter(value:Number):void
visibleproperty 
visible:Boolean  [read-write]

Controls the visibility of this geometry object. If true, the geometry is visible. When set to false this geometry object will be pre computed nor drawn.


Implementation
    public function get visible():Boolean
    public function set visible(value:Boolean):void
widthproperty 
width:Number  [read-write]

Defines the width of the layout. Once left (or percentLeft) or right (or percentRight) is set, the width value no longer applies. If percentWidth exists when width is set, percentWidth will be overridden and be given a value of NaN. This property also accepts a percent value for example 75%.


Implementation
    public function get width():Number
    public function set width(value:Number):void
xproperty 
x:Number  [read-write]

Defines the x location (top left) of the layout.


Implementation
    public function get x():Number
    public function set x(value:Number):void
yproperty 
y:Number  [read-write]

Defines the y location (top left) of the layout.


Implementation
    public function get y():Number
    public function set y(value:Number):void
Method Detail
angleAt()method
public function angleAt(t:Number):Number

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

Parameters

t:Number

Returns
Number
calculateLayout()method 
public function calculateLayout(childBounds:Rectangle = null):void

Performs the layout calculations if required. All geometry override this for specifics.

Parameters

childBounds:Rectangle (default = null) — the bounds to be layed out. If not specified a rectangle of (0,0,1,1) is used.

clearGraphicsTargets()method 
public function clearGraphicsTargets():void

Clears all graphics targets specified in the graphicsTarget array.

draw()method 
public function draw(graphics:Graphics, rc:Rectangle):void

Begins the draw phase for geometry objects. All geometry objects override this to do their specific rendering.

Parameters

graphics:Graphics — The current context to draw to.
 
rc:Rectangle — A Rectangle object used for fill bounds.

drawToTargets()method 
public function drawToTargets():void

Requests a draw for each graphics target specified in the graphicsTarget array.

endDraw()method 
public function endDraw(graphics:Graphics):void

Ends the draw phase for geometry objects.

Parameters

graphics:Graphics — The current Graphics context being drawn to.

initFill()method 
public function initFill(graphics:Graphics, rc:Rectangle):void

Initialise the fill for this geometry object. Typically only called by draw

Parameters

graphics:Graphics — The current context to draw to.
 
rc:Rectangle — A Rectangle object used for fill bounds.

initStroke()method 
public function initStroke(graphics:Graphics, rc:Rectangle):void

Initialise the stroke for this geometry object. Typically only called by draw

Parameters

graphics:Graphics — The current context to draw to.
 
rc:Rectangle — A Rectangle object used for fill bounds.

pointAt()method 
public function pointAt(t:Number):Point

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

Parameters

t:Number

Returns
Point
preDraw()method 
public function preDraw():void

Performs any pre calculation that is required to successfully render this element. Including bounds calculations and lower level drawing command storage. Each geometry object overrides this and is responsible for it's own pre calculation cycle.

propertyChangeHandler()method 
protected function propertyChangeHandler(event:PropertyChangeEvent):void

Principle event handler for any property changes to a geometry object or it's child objects.

Parameters

event:PropertyChangeEvent

styleChanged()method 
public function styleChanged(styleProp:String):void

Called when the value of a style property is changed.

Parameters

styleProp:String