| Package | com.yworks.graph.model |
| Class | public class DefaultPortCandidateDescriptor |
| Inheritance | DefaultPortCandidateDescriptor CanvasObjectDescriptorAdapter Object |
| Implements | IDisplayObjectCreator, IBoundsProvider, IHitTestable, IMarqueeTestable |
ICanvasObjectDescriptor that can be used
to draw IPortCandidate instances in a CanvasComponent.
| Property | Defined By | ||
|---|---|---|---|
| candidateSize : int
Gets or sets the size to use for a valid candidate. | DefaultPortCandidateDescriptor | ||
| currentCandidateSize : int
Gets or sets the size to use for the currentPortCandidate
| DefaultPortCandidateDescriptor | ||
| currentPortCandidate : IPortCandidate
Gets or sets the highlighted port candidate. | DefaultPortCandidateDescriptor | ||
| invalidCenterFill : IFill
Gets or sets the fill to use for a invalid candidate. | DefaultPortCandidateDescriptor | ||
| validCenterFill : IFill
Gets or sets the fill to use for a valid candidate. | DefaultPortCandidateDescriptor | ||
| Method | Defined By | ||
|---|---|---|---|
Instantiates a new descriptor. | DefaultPortCandidateDescriptor | ||
Returns a tight rectangular area where the whole rendering
would fit into. | DefaultPortCandidateDescriptor | ||
createDisplayObject(context:IDisplayObjectContext):DisplayObject | DefaultPortCandidateDescriptor | ||
getBoundsProvider(forUserObject:Object):IBoundsProvider [override]
Returns an implementation of IBoundsProvider that can
determine the visible bounds of the rendering of the user object. | DefaultPortCandidateDescriptor | ||
getDisplayObjectCreator(forUserObject:Object):IDisplayObjectCreator [override]
| DefaultPortCandidateDescriptor | ||
getHitTestable(forUserObject:Object):IHitTestable [override]
Returns an implementation of IHitTestable that can determine whether
the rendering of the user object has been hit at a given coordinate. | DefaultPortCandidateDescriptor | ||
isDirty(obj:ICanvasObject):Boolean [override]
Returns true if the canvas object needs to be repainted. | DefaultPortCandidateDescriptor | ||
isHit(x:Number, y:Number, ctx:ICanvasContext):Boolean
Determines if something has been hit at the given coordinates
in the world coordinate system. | DefaultPortCandidateDescriptor | ||
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. | DefaultPortCandidateDescriptor | ||
| DefaultPortCandidateDescriptor | |||
updateDisplayObject(oldDisplayObject:DisplayObject, context:IDisplayObjectContext):DisplayObject | DefaultPortCandidateDescriptor | ||
| candidateSize | property |
candidateSize:intGets or sets the size to use for a valid candidate.
public function get candidateSize():int public function set candidateSize(value:int):void| currentCandidateSize | property |
currentCandidateSize:int
Gets or sets the size to use for the currentPortCandidate
public function get currentCandidateSize():int public function set currentCandidateSize(value:int):void| currentPortCandidate | property |
currentPortCandidate:IPortCandidateGets or sets the highlighted port candidate.
If this descriptor renders the same instance, it will be rendered highlighted.
public function get currentPortCandidate():IPortCandidate public function set currentPortCandidate(value:IPortCandidate):void| invalidCenterFill | property |
invalidCenterFill:IFillGets or sets the fill to use for a invalid candidate.
public function get invalidCenterFill():IFill public function set invalidCenterFill(value:IFill):void| validCenterFill | property |
validCenterFill:IFillGets or sets the fill to use for a valid candidate.
public function get validCenterFill():IFill public function set validCenterFill(value:IFill):void| DefaultPortCandidateDescriptor | () | Constructor |
public function DefaultPortCandidateDescriptor()Instantiates a new descriptor.
| calculateBounds | () | method |
public function calculateBounds(scratch:IMutableRectangle, ctx:ICanvasContext):IRectangleReturns 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 |
public function createDisplayObject(context:IDisplayObjectContext):DisplayObjectParameters
context:IDisplayObjectContext |
DisplayObject |
| getBoundsProvider | () | method |
override public function getBoundsProvider(forUserObject:Object):IBoundsProvider
Returns an implementation of IBoundsProvider that can
determine the visible bounds of the rendering of the user object.
This method may always return the same instance. By contract, clients will not cache instances returned, but will always call this method before the methods on the instance will be called. This contract enables the use of the fly-weight design pattern. Implementations of this class can always return the same instance and reconfigure this instance upon each call to this method.
Parameters
forUserObject:Object — The user object to query the bounds for
|
IBoundsProvider — An implementation or null if the bounds are not known, in which
case the bounds are treated as infinite
|
| getDisplayObjectCreator | () | method |
override public function getDisplayObjectCreator(forUserObject:Object):IDisplayObjectCreator
Parameters
forUserObject:Object |
IDisplayObjectCreator |
| getHitTestable | () | method |
override public function getHitTestable(forUserObject:Object):IHitTestable
Returns an implementation of IHitTestable that can determine whether
the rendering of the user object has been hit at a given coordinate.
This method may always return the same instance. By contract, clients will not cache instances returned, but will always call this method before the methods on the instance will be called. This contract enables the use of the fly-weight design pattern. Implementations of this class can always return the same instance and reconfigure this instance upon each call to this method.
Parameters
forUserObject:Object — The user object to do the hit testing for
|
IHitTestable — An implementation or null if the rendering cannot be hit tested
|
| isDirty | () | method |
override public function isDirty(obj:ICanvasObject):Boolean
Returns true if the canvas object needs to be repainted.
Parameters
obj:ICanvasObject — The canvas object.
|
Boolean — true if the canvas object needs to be repainted.
|
| isHit | () | method |
public function isHit(x:Number, y:Number, ctx:ICanvasContext):BooleanDetermines 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 |
public function isInBox(box:IRectangle, ctx:ICanvasContext):Boolean
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.
Parameters
box:IRectangle — The box describing the marquee's bounds
| |
ctx:ICanvasContext — The current canvas context
|
Boolean — true if the item is considered to be captured by the marquee
|
| paint | () | method |
| updateDisplayObject | () | method |
public function updateDisplayObject(oldDisplayObject:DisplayObject, context:IDisplayObjectContext):DisplayObjectParameters
oldDisplayObject:DisplayObject | |
context:IDisplayObjectContext |
DisplayObject |