Class Shape
- extends Graphic
The Shape class creates a graphic object with editable
properties.
Properties
Used to convert shape declarations to the appropriate node type.
Indicates whether or not the instance will size itself based on its contents.
Determines whether the instance will receive mouse events.
type
- string
Indicates the type of shape.
Methods
private
void
_addBorder
(
)
Adds a border to the shape node.
private
void
_addFill
(
)
Adds a fill to the shape node.
private
void
_draw
(
)
Draws the graphic.
private
_getNodeShapeType
(
type
)
Converts a shape type to the appropriate node attribute.
- Parameters:
-
type
<String>
The type of shape.
- Returns:
- String
private
void
_initialize
(
)
Initializes the graphic instance.
private
void
_setPath
(
)
Adds a path to the shape node.
private
void
_setProps
(
cfg
)
Updates properties for the shape.
- Parameters:
-
cfg
<Object>
Properties to update.
void
addClass
(
className
)
Adds a class to the shape's node.
- Parameters:
-
className
<String>
Name of the class to add.
void
end
(
)
Completes a drawing operation.
void
setPosition
(
,
)
Positions the parent node of the shape.
- Parameters:
-
,
<Number>
x The x-coordinate
-
,
<Number>
y The y-coordinate
void
toggleVisible
(
val
)
Sets the visibility of a shape.
- Parameters:
-
val
<Boolean>
indicates whether or not the shape is visible.
void
update
(
cfg
)
Updates the properties of the shape instance.
- Parameters:
-
cfg
<Object>
Object literal containing properties to update.
Methods inherited from Graphic:
_clearPath,
_createGraphicNode,
_createGraphics,
_draw,
_getFill,
_getLinearGradient,
_getWedgePath,
_initProps,
_removeChildren,
_styleGroup,
_toggleVisible,
_trackSize,
beginBitmapFill,
beginFill,
beginGradientFill,
clear,
curveTo,
destroy,
drawCircle,
drawEllipse,
drawRect,
drawWedge,
end,
getShape,
initializer,
lineGradientStyle,
lineStyle,
lineTo,
moveTo,
quadraticCurveTo,
render,
setPosition,
setSize,
toggleVisible