An ICanvasObjectDescriptor implementation that can be used to draw IPortCandidate instances in a CanvasComponent.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.view.DefaultPortCandidateDescriptor
See Also
Properties
Gets or sets a value indicating whether port candidates are drawn in view coordinates, instead of intermediate coordinates.
Remarks
This setting has no visible effect, unless a projection is set.
The default value is false
, to draw port candidates in the intermediate coordinate system.
Methods
This method is called by the framework to create a Visual that will be included into the IRenderContext.
Remarks
Parameters
A map of options to pass to the method.
- context - IRenderContext
- The context that describes where the visual will be used.
Returns
- ↪Visual
- The visual to include in the canvas object visual tree. This may be
null
.
See Also
Implements
Returns a tight rectangular area where the whole rendering would fit into.
Remarks
Parameters
A map of options to pass to the method.
- context - ICanvasContext
- the context to calculate the bounds for
Returns
Implements
Returns an implementation of IBoundsProvider that can determine the visible bounds of the rendering of the user object.
Remarks
Parameters
A map of options to pass to the method.
- forUserObject - Object
- the user object to query the bounds for
Returns
- ↪IBoundsProvider
- An implementation of IBoundsProvider to determine the bounds of the visualization.
Implements
Returns an implementation of IHitTestable that can determine whether the rendering of the user object has been hit at a given coordinate.
Remarks
Parameters
A map of options to pass to the method.
- forUserObject - Object
- the user object to do the hit testing for
Returns
- ↪IHitTestable
- An implementation of IHitTestable to determine visibility.
Implements
Returns an implementation of IVisibilityTestable that can determine if the rendering of the user object would be visible in a given context.
Remarks
Parameters
A map of options to pass to the method.
- forUserObject - Object
- the user object to query visibility for
Returns
- ↪IVisibilityTestable
- An implementation of IVisibilityTestable to determine visibility.
Implements
Returns an implementation of IVisualCreator that will create the Visual tree for the user object.
Remarks
Parameters
A map of options to pass to the method.
- forUserObject - Object
- the user object to create a Visual for
Returns
- ↪IVisualCreator
- An implementation of IVisualCreator to create or update the visualization.
Implements
Determines whether the given canvas object is deemed dirty and needs updating.
Parameters
A map of options to pass to the method.
- context - ICanvasContext
- The context that will be used for the update.
- canvasObject - ICanvasObject
- The object to check.
Returns
- ↪boolean
- Whether an update is needed.
See Also
Implements
Determines if something has been hit at the given coordinates in the world coordinate system.
Remarks
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- the context the hit test is performed in
- location - Point
- the coordinates in world coordinate system
Returns
- ↪boolean
- whether something has been hit
Implements
Returns true
if the corresponding item is considered to intersect the given rectangular box.
Remarks
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.
Implementations should respect the hitTestRadius if marquee selections should behave differently on different zoom levels.
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- the current input mode context
- rectangle - Rect
- the box describing the marquee's bounds
Returns
- ↪boolean
true
if the item is considered to be captured by the marquee
Implements
Returns true
if the corresponding item is considered to intersect the given path.
Remarks
This method may return false
if the item cannot be selected using a lasso selection or optionally if the item is only partially contained within the path.
Implementations should respect the hitTestRadius if lasso selections should behave differently on different zoom levels.
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- the current input mode context
- path - GeneralPath
- the path describing the lasso selection bounds
Returns
- ↪boolean
true
if the item is considered to be captured by the lasso
Implements
Determines whether an element might intersect the visible region for a given context.
Remarks
true
.Parameters
A map of options to pass to the method.
- context - ICanvasContext
- The context to determine the visibility for.
- rectangle - Rect
- The visible region clip.
Returns
- ↪boolean
false
if and only if it is safe not to paint the element because it would not affect the given clipping region.
Implements
Sets the IVisualTemplate to use for the given string by this instance.
Remarks
Parameters
A map of options to pass to the method.
- resourceKey - string
- The key to reconfigure. This is one of CANDIDATE_DRAWING_VALID_NON_FOCUSED_KEY, CANDIDATE_DRAWING_INVALID_NON_FOCUSED_KEY, CANDIDATE_DRAWING_INVALID_FOCUSED_KEY, CANDIDATE_DRAWING_VALID_FOCUSED_KEY.
- template - IVisualTemplate
- The template to use instead of the default.
This method updates or replaces a previously created Visual for inclusion in the IRenderContext.
Remarks
The CanvasComponent uses this method to give implementations a chance to update an existing Visual that has previously been created by the same instance during a call to createVisual. Implementation may update the oldVisual
and return that same reference, or create a new visual and return the new instance or null
.
I most cases oldVisual
is a visual instance that has been returned by the createVisual method of this instance. This is, however, not guaranteed. Implementations have to be aware of this.
Parameters
A map of options to pass to the method.
- context - IRenderContext
- The context that describes where the visual will be used in.
- oldVisual - Visual
- The visual instance to be updated.
Returns
- ↪Visual
oldVisual
, if this instance modified the visual, or a new visual that should replace the existing one in the canvas object visual tree.
See Also
Implements
Constants
A string that can be used by instances of the DefaultPortCandidateDescriptor to look up a IVisualTemplate that will be used for rendering a invalid, focused IPortCandidate.
Remarks
The drawing returned should be centered around (0,0)
.
See Customizing the Predefined Indicators on how to register a custom IVisualTemplate for this string.
The default template uses visualizations based on the ThemeVariant of the current theme:
- CLASSIC – Rectangle filled with backgroundColor, with a smaller red rectangle inside and corners in primaryColor.
- SIMPLE_ROUND – Gray circle stroked with backgroundColor.
- SIMPLE_SQUARE – Gray square stroked with backgroundColor.
See Also
A string that can be used by instances of the DefaultPortCandidateDescriptor to look up a IVisualTemplate that will be used for rendering an invalid, non-focused IPortCandidate.
Remarks
The drawing returned should be centered around (0,0)
.
See Customizing the Predefined Indicators on how to register a custom IVisualTemplate for this string.
The default template uses visualizations based on the ThemeVariant of the current theme:
- CLASSIC – Rectangle filled with backgroundColor, with a smaller red rectangle inside and corners in primaryColor.
- SIMPLE_ROUND – Gray circle stroked with backgroundColor.
- SIMPLE_SQUARE – Gray square stroked with backgroundColor.
See Also
A string that can be used by instances of the DefaultPortCandidateDescriptor to look up a IVisualTemplate that will be used for rendering a valid, focused IPortCandidate.
Remarks
The drawing returned should be centered around (0,0)
.
See Customizing the Predefined Indicators on how to register a custom IVisualTemplate for this string.
The default template uses visualizations based on the ThemeVariant of the current theme:
- CLASSIC – Rectangle filled with backgroundColor, with a smaller green rectangle inside and corners in primaryColor.
- SIMPLE_ROUND – Green circle stroked with backgroundColor.
- SIMPLE_SQUARE – Green square stroked with backgroundColor.
See Also
A string that can be used by instances of the DefaultPortCandidateDescriptor to look up a IVisualTemplate that will be used for rendering a valid, non-focused IPortCandidate.
Remarks
The drawing returned should be centered around (0,0)
.
See Customizing the Predefined Indicators on how to register a custom IVisualTemplate for this string.
The default template uses visualizations based on the ThemeVariant of the current theme:
- CLASSIC – Rectangle filled with backgroundColor, with a smaller green rectangle inside and corners in primaryColor.
- SIMPLE_ROUND – Green circle stroked with backgroundColor.
- SIMPLE_SQUARE – Green square stroked with backgroundColor.