| Package | com.yworks.graph.model |
| Class | public class DefaultPortCandidateDescriptor |
| Inheritance | DefaultPortCandidateDescriptor CanvasObjectDescriptorAdapter |
| Implements | IBoundsProvider, IHitTestable, IMarqueeTestable, IPaintable |
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 | ||
|---|---|---|---|
|
Instanciates a new descriptor.
| DefaultPortCandidateDescriptor | ||
|
Returns a tight rectangular area where the whole rendering
would fit into.
| DefaultPortCandidateDescriptor | ||
|
getBoundsProvider(forUserObject:Object):IBoundsProvider
Returns an implementation of
IBoundsProvider that can
determine the visible bounds of the rendering of the user object. | DefaultPortCandidateDescriptor | ||
|
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. | DefaultPortCandidateDescriptor | ||
|
getPaintable(forUserObject:Object):IPaintable
Returns an implementation of
IPaintable that will render the user
object. | DefaultPortCandidateDescriptor | ||
|
isDirty(obj:ICanvasObject):Boolean
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 | ||
|
Performs the actual painting into the given graphics context.
| DefaultPortCandidateDescriptor | ||
| candidateSize | property |
candidateSize:int [read-write]Gets or sets the size to use for a valid candidate.
Implementation public function get candidateSize():int
public function set candidateSize(value:int):void
| currentCandidateSize | property |
currentCandidateSize:int [read-write]
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:IPortCandidate [read-write]Gets or sets the highlighted port candidate.
If this descriptor renders the same instance, it will be rendered highlighted.
Implementation public function get currentPortCandidate():IPortCandidate
public function set currentPortCandidate(value:IPortCandidate):void
| invalidCenterFill | property |
invalidCenterFill:IFill [read-write]Gets or sets the fill to use for a invalid candidate.
Implementation public function get invalidCenterFill():IFill
public function set invalidCenterFill(value:IFill):void
| validCenterFill | property |
validCenterFill:IFill [read-write]Gets or sets the fill to use for a valid candidate.
Implementation public function get validCenterFill():IFill
public function set validCenterFill(value:IFill):void
| DefaultPortCandidateDescriptor | () | constructor |
public function DefaultPortCandidateDescriptor()Instanciates 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.
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
|
| getBoundsProvider | () | method |
public override 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.
ParametersforUserObject: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
|
| getHitTestable | () | method |
public override 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.
forUserObject:Object — The user object to do the hit testing for
|
IHitTestable —
An implementation or null if the rendering cannot be hit tested
|
| getPaintable | () | method |
public override function getPaintable(forUserObject:Object):IPaintable
Returns an implementation of IPaintable that will render the user
object. This method will always return the same instance.
By contract, clients will not cache instances returned, but will always call this method
before the methods of 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.
ParametersforUserObject:Object — The userObject to paint
|
IPaintable —
An Implementation or null if nothing shall be painted.
|
| isDirty | () | method |
public override function isDirty(obj:ICanvasObject):Boolean
Returns true if the canvas object needs to be repainted.
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.
Parametersx: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.
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 |
public function paint(g:YGraphics, ctx:IPaintContext):voidPerforms the actual painting into the given graphics context.
Parametersg:YGraphics — The graphics context to paint into
|
|
ctx:IPaintContext — Currently not used
|