Package | com.yworks.canvas.drawing |
Class | public class GeneralPathVisualCreator |
Inheritance | GeneralPathVisualCreator ShapePaintable Object |
IDisplayObjectCreator
implementations for rendering a GeneralPath
.
Property | Defined By | ||
---|---|---|---|
fill : IFill
The fill to use for painting in the created DisplayObject. | ShapePaintable | ||
path : GeneralPath
Returns the path to render. | GeneralPathVisualCreator | ||
stroke : IStroke
The stroke to use for painting in the created DisplayObject. | ShapePaintable |
Method | Defined By | ||
---|---|---|---|
Creates a new instance. | GeneralPathVisualCreator | ||
[override]
Returns a tight rectangular area where the whole rendering
would fit into. | GeneralPathVisualCreator | ||
createDisplayObject(context:IDisplayObjectContext):DisplayObject [override]
Creates a new DisplayObject from scratch. | GeneralPathVisualCreator | ||
[static]
Creates a dynamic display object creator that will use an IPoint to draw
and fill an ellipse in the created DisplayObject in the view coordinate system with a zoom level invariant
width and height. | ShapePaintable | ||
[static]
Creates a dynamic display object creator that draws a given path in the created DisplayObject. | ShapePaintable | ||
[static]
Creates a dynamic display object creator that will use an IPoint to draw
and fill an ellipse in the created DisplayObject. | ShapePaintable | ||
[static]
Creates a dynamic display object creator that will use two points to
draw a rectangle in the created DisplayObject. | ShapePaintable | ||
[static] | ShapePaintable | ||
[static]
Creates a dynamic display object creator that will use an IRectangle to draw
and fill a rectangle in the created DisplayObject. | ShapePaintable | ||
[static]
Creates a dynamic display object creator that will use a IOrientedRectangle to draw
and fill an IOrientedRectangle in the created DisplayObject in the view coordinate system. | ShapePaintable | ||
[static]
Creates a dynamic display object creator that will use a IRectangle to draw
and fill a rectangle in the created DisplayObject in the view coordinate system. | ShapePaintable | ||
isHit(x:Number, y:Number, ctx:ICanvasContext):Boolean [override]
Determines if something has been hit at the given coordinates
in the world coordinate system. | GeneralPathVisualCreator | ||
[override]
Implements the IMarqueeTestable interface and tests for marquee
intersections with the shape. | GeneralPathVisualCreator | ||
[override]
Performs the actual painting into the given graphics context. | GeneralPathVisualCreator | ||
updateDisplayObject(oldDisplayObject:DisplayObject, context:IDisplayObjectContext):DisplayObject [override]
Updates the given DisplayObject or creates a new one. | GeneralPathVisualCreator |
path | property |
path:GeneralPath
Returns the path to render.
public function get path():GeneralPath
public function set path(value:GeneralPath):void
GeneralPathVisualCreator | () | Constructor |
public function GeneralPathVisualCreator(path:GeneralPath)
Creates a new instance.
Parameterspath:GeneralPath — The path to render.
|
calculateBounds | () | method |
override public function calculateBounds(scratch:IMutableRectangle, ctx:ICanvasContext):IRectangle
Returns a tight rectangular area where the whole rendering would fit into.
Implementations can use the scratch
rectangle to put their
results in and return it as the result of the operation.
Client has to always provide a non-null
instance as
a parameter. They may however decide to return an internally
cached or dynamically created IRectangle
implementation and
disregard the scratch parameter.
If calculating the bounds is too expensive or the painting is not
bound to a certain area, this method may return null
.
If nothing is painted, this method should return an empty rectangle, where
either or both the width and height is non-positive or
ImmutableRectangle.Empty
.
Parameters
scratch:IMutableRectangle — An instance that can optionally be used to fill with the
corresponding values and be returned
| |
ctx:ICanvasContext — The context to calculate the bounds for (currently not used)
|
IRectangle — The bounds or null to indicate an unbound area
|
createDisplayObject | () | method |
override public function createDisplayObject(context:IDisplayObjectContext):DisplayObject
Creates a new DisplayObject
from scratch.
Parameters
context:IDisplayObjectContext — The context for which the display object is created.
|
DisplayObject — A DisplayObject .
|
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
|
Boolean — whether something has been hit
|
isInBox | () | method |
override public function isInBox(box:IRectangle, ctx:ICanvasContext):Boolean
Implements the IMarqueeTestable
interface and tests for marquee
intersections with the shape.
Parameters
box:IRectangle | |
ctx:ICanvasContext |
Boolean |
paint | () | method |
override public function paint(g:YGraphics, ctx:IPaintContext):void
Performs the actual painting into the given graphics context.
Parameters
g:YGraphics — The graphics context to paint into
| |
ctx:IPaintContext — Currently not used
|
updateDisplayObject | () | method |
override public function updateDisplayObject(oldDisplayObject:DisplayObject, context:IDisplayObjectContext):DisplayObject
Updates the given DisplayObject
or creates a new one.
Implementors can decide whether they update the given display object or create a new one. Updating can mean re-rendering or updating size and/or coordinates.
Parameters
oldDisplayObject:DisplayObject — The display object to update.
| |
context:IDisplayObjectContext — The context for which the display object should be updated.
|
DisplayObject — The updated display object or a completely new display object.
|