Sencha Documentation

Sub classes

Config Options

 
autoSize : Boolean
Turn on autoSize support which will set the bounding div's size to the natural size of the contents. Defaults to fals...
Turn on autoSize support which will set the bounding div's size to the natural size of the contents. Defaults to false.
 
height : Number
The height of this component in pixels (defaults to auto). Note to express this dimension as a percentage or offset s...
The height of this component in pixels (defaults to auto). Note to express this dimension as a percentage or offset see Ext.Component.anchor.
 
implOrder : Array
Defines the priority order for which Surface implementation to use. The first one supported by the current environmen...
Defines the priority order for which Surface implementation to use. The first one supported by the current environment will be used.
 
viewBox : Boolean
Turn on view box support which will scale and position items in the draw component to fit to the component while main...
Turn on view box support which will scale and position items in the draw component to fit to the component while maintaining aspect ratio. Defaults to true.
 
width : Number
The width of this component in pixels (defaults to auto). Note to express this dimension as a percentage or offset se...
The width of this component in pixels (defaults to auto). Note to express this dimension as a percentage or offset see Ext.Component.anchor.

Properties

 
addGradient : Object
Add a gradient definition to the Surface. Note that in some surface engines, adding a gradient via this method will n...
Add a gradient definition to the Surface. Note that in some surface engines, adding a gradient via this method will not take effect if the surface has already been rendered. Therefore, it is preferred to pass the gradients as an item to the surface config, rather than calling this method, especially if the surface is rendered immediately (e.g. due to 'renderTo' in its config).

Methods

 
addCls( String sprite, String/Array className ) : Ext.draw.Sprite
Adds one or more CSS classes to the element. Duplicate classes are automatically filtered out.
Adds one or more CSS classes to the element. Duplicate classes are automatically filtered out.

Parameters

  • sprite : String
    The sprite to add, or an array of classes to
  • className : String/Array
    The CSS class to add, or an array of classes

Returns

  • Ext.draw.Sprite   this
 
addGradient( Object gradient ) : Void
Adds a definition to this Surface for a linear gradient. We convert the gradient definition to its corresponding VML ...
Adds a definition to this Surface for a linear gradient. We convert the gradient definition to its corresponding VML attributes and store it for later use by individual sprites.

Parameters

  • gradient : Object

Returns

  • Void
 
applyZIndex( Ext.draw.Sprite sprite ) : Void
Insert or move a given sprite's element to the correct place in the DOM list for its zIndex
Insert or move a given sprite's element to the correct place in the DOM list for its zIndex

Parameters

  • sprite : Ext.draw.Sprite

Returns

  • Void
 
Create the Surface instance. Resolves the correct Surface implementation to instantiate based on the 'implOrder' conf...
Create the Surface instance. Resolves the correct Surface implementation to instantiate based on the 'implOrder' config.
 
getId : Void
Retrieves the id of this component. Will autogenerate an id if one has not already been set.
Retrieves the id of this component. Will autogenerate an id if one has not already been set.
 
getRegion : Void
Get the region for the surface's canvas area
Get the region for the surface's canvas area
 
hasCls( String className ) : Boolean
Checks if the specified CSS class exists on this element's DOM node.
Checks if the specified CSS class exists on this element's DOM node.

Parameters

  • className : String
    The CSS class to check for

Returns

  • Boolean   True if the class exists, else false
 
newInstance( Object config, Array implOrder ) : Void
Create and return a new concrete Surface instance appropriate for the current environment.
Create and return a new concrete Surface instance appropriate for the current environment.

Parameters

  • config : Object
    Initial configuration for the Surface instance
  • implOrder : Array
    Optional order of implementations to use; the first one that is available in the current environment will be used. Defaults to ['SVG', 'Canvas', 'VML].

Returns

  • Void
 
onDestroy : Void
Clean up the Surface instance on component destruction
Clean up the Surface instance on component destruction
 
onRender : Void
Create the Surface on initial render
Create the Surface on initial render
 
positionSpriteInList( Ext.draw.Sprite sprite ) : Number
Insert or move a given sprite into the correct position in the items MixedCollection, according to its zIndex. Will b...
Insert or move a given sprite into the correct position in the items MixedCollection, according to its zIndex. Will be inserted at the end of an existing series of sprites with the same or lower zIndex. If the sprite is already positioned within an appropriate zIndex group, it will not be moved. This ordering can be used by subclasses to assist in rendering the sprites in the correct order for proper z-index stacking.

Parameters

  • sprite : Ext.draw.Sprite

Returns

  • Number   the sprite's new index in the list
 
removeCls( String sprite, String/Array className ) : Ext.draw.Sprite
Removes one or more CSS classes from the element.
Removes one or more CSS classes from the element.

Parameters

  • sprite : String
    The sprite to add, or an array of classes to
  • className : String/Array
    The CSS class to remove, or an array of classes

Returns

  • Ext.draw.Sprite   this
 
setStyle( String/Object property, [String value] ) : Ext.draw.Sprite
Wrapper for setting style properties, also takes single object parameter of multiple styles.
Wrapper for setting style properties, also takes single object parameter of multiple styles.

Parameters

  • property : String/Object
    The style property to be set, or an object of multiple styles.
  • value : String
    (optional) The value to apply to the given property, or null if an object was passed.

Returns

  • Ext.draw.Sprite   this