Packagecom.yworks.graph.drawing
Classpublic class ShapeNodeStyleRenderer
InheritanceShapeNodeStyleRenderer Inheritance AbstractNodeStyleRenderer Inheritance AbstractStyleRenderer Inheritance Object

Default renderer implementation that can be used for IShapeNodeStyle instances.



Public Properties
 PropertyDefined By
  brightenHighlightBy : Number
The value to brighten the stroke color by when drawing border highlights.
ShapeNodeStyleRenderer
  darkenShadowBy : Number
The value to darken the stroke color by when drawing border shadows.
ShapeNodeStyleRenderer
 Inheriteditem : IModelItem
[read-only] Gets the currently configured item.
AbstractStyleRenderer
 Inheritedlayout : IRectangle
[read-only] Returns the INode.layout of the node this renderer is currently configured for.
AbstractNodeStyleRenderer
  roundRectEllipseHeight : Number
Get or set the default ellipse height used for drawing rounded corners.
ShapeNodeStyleRenderer
  roundRectEllipseWidth : Number
Get or set the default ellipse width used for drawing rounded corners.
ShapeNodeStyleRenderer
 Inheritedstyle : IVisualStyle
[read-only] Gets the currently configured style.
AbstractStyleRenderer
 InheritedstyleDescriptor : ICanvasObjectDescriptor
[read-only] Gets the ICanvasObjectDescriptor to use for new installations.
AbstractStyleRenderer
Protected Properties
 PropertyDefined By
  fill : IFill
[read-only] Get the fill that is currently used by this renderer.
ShapeNodeStyleRenderer
  shape : uint
[read-only] Get the shape that is currently used by this renderer.
ShapeNodeStyleRenderer
  stroke : IStroke
[read-only] Get the stroke that is currently used by this renderer.
ShapeNodeStyleRenderer
Public Methods
 MethodDefined By
 Inherited
[override] Returns a tight rectangular area where the whole rendering would fit into.
AbstractNodeStyleRenderer
  
[override]
ShapeNodeStyleRenderer
 Inherited
Configures the style and item parameters, calls configure and returns this.
AbstractStyleRenderer
 Inherited
Configures the style and item parameters, does not call configure and returns this.
AbstractStyleRenderer
 Inherited
Configures the style and item parameters, calls configure and returns this.
AbstractStyleRenderer
 Inherited
Configures the style and item parameters, calls configure and returns this.
AbstractStyleRenderer
  
getIntersection(innerX:Number, innerY:Number, outerX:Number, outerY:Number, intersectionPoint:IPointSetter):Boolean
[override] Returns the intersection for the given line with this shape's geometry.
ShapeNodeStyleRenderer
 Inherited
Configures the style and item parameters, calls configure and returns this.
AbstractStyleRenderer
  
[override] Returns the outline of the shape using the node's layout.
ShapeNodeStyleRenderer
 Inherited
Configures the style and item parameters, calls configure and returns this.
AbstractNodeStyleRenderer
 Inherited
install(canvas:CanvasComponent, group:ICanvasObjectGroup, modelItem:IModelItem):Array
Installs the model in the canvas at the given group using the styleDescriptor.
AbstractStyleRenderer
  
isHit(x:Number, y:Number, ctx:ICanvasContext):Boolean
[override] Determines if something has been hit at the given coordinates in the world coordinate system.
ShapeNodeStyleRenderer
 Inherited
[override] Returns true if the corresponding item is considered to intersect the given rectangular box. This method may return false if the item cannot be selected using a selection marquee or optionally if the item is only partially contained within the box.
AbstractNodeStyleRenderer
  
isInside(x:Number, y:Number):Boolean
[override] Checks whether the given coordinate is deemed to lie within the shape's geometric bounds.
ShapeNodeStyleRenderer
 Inherited
Calls configure and tests the item using the style for a visible intersection with the clip bounds.
AbstractStyleRenderer
  
lookup(type:Class):Object
[override] Implements the ILookup interface.
ShapeNodeStyleRenderer
  
updateDisplayObject(oldDisplayObject:DisplayObject, context:IDisplayObjectContext):DisplayObject
[override]
ShapeNodeStyleRenderer
Protected Methods
 MethodDefined By
  
configure():void
[override] This is an empty implementation of the AbstractStyleRenderer.configure method.
ShapeNodeStyleRenderer
  
Creates an Object which reflects the current state of the style and the model item.
ShapeNodeStyleRenderer
 Inherited
[override] Factory method for the StyleDescriptor property.
AbstractNodeStyleRenderer
  
ShapeNodeStyleRenderer
 Inherited
setItem(item:IModelItem):void
Called by the various descriptor getters to initialize the item.
AbstractStyleRenderer
 Inherited
Called by the various descriptor getters to initialize the style.
AbstractStyleRenderer
  
shouldRepaint(oldCache:Object):Boolean
Whether the current display object should be repainted.
ShapeNodeStyleRenderer
  
updateLayout(obj:DisplayObject, context:IDisplayObjectContext):void
ShapeNodeStyleRenderer
  
updateRenderDataCache(renderDataCache:Object):Object
Updates the given object with the current state of the style and the node.
ShapeNodeStyleRenderer
Property Detail
brightenHighlightByproperty
brightenHighlightBy:Number

The value to brighten the stroke color by when drawing border highlights.

Valid values are between 0 and 100.

The default value is 50.


Implementation
    public function get brightenHighlightBy():Number
    public function set brightenHighlightBy(value:Number):void
darkenShadowByproperty 
darkenShadowBy:Number

The value to darken the stroke color by when drawing border shadows.

Valid values are between 0 and 100.

The default value is 50.


Implementation
    public function get darkenShadowBy():Number
    public function set darkenShadowBy(value:Number):void
fillproperty 
fill:IFill  [read-only]

Get the fill that is currently used by this renderer.

This implementation retrieves the fill from the owning style.


Implementation
    protected function get fill():IFill
roundRectEllipseHeightproperty 
roundRectEllipseHeight:Number

Get or set the default ellipse height used for drawing rounded corners.


Implementation
    public function get roundRectEllipseHeight():Number
    public function set roundRectEllipseHeight(value:Number):void
roundRectEllipseWidthproperty 
roundRectEllipseWidth:Number

Get or set the default ellipse width used for drawing rounded corners.


Implementation
    public function get roundRectEllipseWidth():Number
    public function set roundRectEllipseWidth(value:Number):void
shapeproperty 
shape:uint  [read-only]

Get the shape that is currently used by this renderer.

This implementation retrieves the shape from the owning style.


Implementation
    protected function get shape():uint
strokeproperty 
stroke:IStroke  [read-only]

Get the stroke that is currently used by this renderer.

This implementation retrieves the stroke from the owning style.


Implementation
    protected function get stroke():IStroke
Method Detail
configure()method
override protected function configure():void

This is an empty implementation of the AbstractStyleRenderer.configure method. Subclasses should override this.

createDisplayObject()method 
override public function createDisplayObject(context:IDisplayObjectContext):DisplayObject

Parameters

context:IDisplayObjectContext

Returns
DisplayObject
createRenderDataCache()method 
protected function createRenderDataCache():Object

Creates an Object which reflects the current state of the style and the model item.

Returns
Object — An Object which reflects the current state of the style and the model item.
getIntersection()method 
override public function getIntersection(innerX:Number, innerY:Number, outerX:Number, outerY:Number, intersectionPoint:IPointSetter):Boolean

Returns the intersection for the given line with this shape's geometry.

Parameters

innerX:Number — The X coordinate of the first point of the line that is inside the shape.
 
innerY:Number — The Y coordinate of the first point of the line that is inside the shape.
 
outerX:Number — The X coordinate of the second point of the line that is outside the shape.
 
outerY:Number — The Y coordinate of the second point of the line that is outside the shape.
 
intersectionPoint:IPointSetter — The intersection point that is set if this method returns true.

Returns
Boolean — Whether an intersection was found.
getOutline()method 
override public function getOutline():GeneralPath

Returns the outline of the shape using the node's layout.

Returns
GeneralPath — The outline of the bounds of the node.
isHit()method 
override public function isHit(x:Number, y:Number, ctx:ICanvasContext):Boolean

Determines if something has been hit at the given coordinates in the world coordinate system.

Parameters

x:Number — the x-coordinate in world coordinate system
 
y:Number — the y-coordinate in world coordinate system
 
ctx:ICanvasContext — the context the hit test is performed in

Returns
Boolean — whether something has been hit
isInside()method 
override public function isInside(x:Number, y:Number):Boolean

Checks whether the given coordinate is deemed to lie within the shape's geometric bounds.

Parameters

x:Number — The x coordinate to test.
 
y:Number — The y coordinate to test.

Returns
Boolean — True if the point lies within the shape.
lookup()method 
override public function lookup(type:Class):Object

Implements the ILookup interface.

This method will be used by default if getContext has been queried for a lookup implementation. Note that it cannot be assumed that configure has already been invoked. However, normally item and style will be correctly configured if invoked directly after getContext. Subclass implementations should make sure to configure this instance before they return this as a result of a successful lookup.

Parameters

type:Class — The type to query for

Returns
Object — An implementation of the given type or null
paint()method 
protected function paint(g:YGraphics, ctx:IDisplayObjectContext):void

Parameters

g:YGraphics
 
ctx:IDisplayObjectContext

shouldRepaint()method 
protected function shouldRepaint(oldCache:Object):Boolean

Whether the current display object should be repainted.

Parameters

oldCache:Object — An object which reflects the state of the style and node when the object was repainted the last time.

Returns
Booleantrue if a repaint is necessary.
updateDisplayObject()method 
override public function updateDisplayObject(oldDisplayObject:DisplayObject, context:IDisplayObjectContext):DisplayObject

Parameters

oldDisplayObject:DisplayObject
 
context:IDisplayObjectContext

Returns
DisplayObject
updateLayout()method 
protected function updateLayout(obj:DisplayObject, context:IDisplayObjectContext):void

Parameters

obj:DisplayObject
 
context:IDisplayObjectContext

updateRenderDataCache()method 
protected function updateRenderDataCache(renderDataCache:Object):Object

Updates the given object with the current state of the style and the node.

Parameters

renderDataCache:Object — The object to update.

Returns
Object — An object with the current state of the style and the node.