Packagecom.yworks.graph.model
Classpublic class DefaultNode
InheritanceDefaultNode Inheritance AbstractLabeledItem Inheritance AbstractModelItem Inheritance Object
Implements INode, ITagOwner, com.yworks.graph.model.IZOrderOwner

A simple mutable implementation of the INode interface that can be used stand-alone.



Public Properties
 PropertyDefined By
 Inheritedlabels : ILabelCollection
The collection for the labels.
AbstractLabeledItem
  layout : IRectangle
Returns a live view of the layout of the node.
DefaultNode
  ports : IPortCollection
Provides access to a collection of IPort that are owned by this instance.
DefaultNode
  style : INodeStyle
Returns the style that is responsible for the visual representation of this node in a CanvasComponent.
DefaultNode
  tag : Object
Gets or sets the tag associated with this instance.
DefaultNode
  zOrder : int
The z-order of a model item which determines its render order in comparison to other model items.
DefaultNode
Protected Properties
 PropertyDefined By
 Inherited_lookupMap : IMapper
The map which is used by registerLookup() to store instances in.
AbstractModelItem
Public Methods
 MethodDefined By
  
DefaultNode(labelCollection:ILabelCollection = null, layout:IRectangle = null, ports:IPortCollection = null, lookup:ILookup = null)
Creates a node using the given label and ports collection as well as the layout instance.
DefaultNode
 Inherited
Returns the currently set ILookup delegate.
AbstractModelItem
  
lookup(type:Class):Object
[override] Returns an instance that implements the given type or null.
DefaultNode
 Inherited
registerLookup(type:Class, instance:Object):void
Register an implementation for the given type that should be returned when lookup is called with this given type.
AbstractModelItem
 Inherited
Sets the ILookup implementation used for lookup calls on this instance.
AbstractModelItem
  
toString():String
Returns a String representation of this instance.
DefaultNode
Property Detail
layoutproperty
layout:IRectangle

Returns a live view of the layout of the node.

The layout of a node is a rectangle in the world coordinate system that describes the bounding box of the representation of a node. Since this method will yield a live view, it is up to the client to copy the values of the instance if a snapshot of the state is needed. In order to modify the layout of a node, use the various methods in IGraph.


Implementation
    public function get layout():IRectangle
    public function set layout(value:IRectangle):void
portsproperty 
ports:IPortCollection

Provides access to a collection of IPort that are owned by this instance.

This gives access to a read-only live view of the ports, i.e. the collection can change over time, as well as the ports contained in it. If a snapshot of the current state is needed, one needs to copy the collection.


Implementation
    public function get ports():IPortCollection
    public function set ports(value:IPortCollection):void
styleproperty 
style:INodeStyle

Returns the style that is responsible for the visual representation of this node in a CanvasComponent.

In order to set the style on an instance, use the IGraph.setStyle( INode, INodeStyle ) method.

Note that the style instance associated with a node instance may be shared between multiple node instances and that the modification of this style will result in a change of the appearance of all nodes that are associated with the same style instance.


Implementation
    public function get style():INodeStyle
    public function set style(value:INodeStyle):void
tagproperty 
tag:Object

Gets or sets the tag associated with this instance.

The implementation itself does not normally depend on the tag associated with it. It serves as storage for the object only.


Implementation
    public function get tag():Object
    public function set tag(value:Object):void
zOrderproperty 
zOrder:int

The z-order of a model item which determines its render order in comparison to other model items.


Implementation
    public function get zOrder():int
    public function set zOrder(value:int):void
Constructor Detail
DefaultNode()Constructor
public function DefaultNode(labelCollection:ILabelCollection = null, layout:IRectangle = null, ports:IPortCollection = null, lookup:ILookup = null)

Creates a node using the given label and ports collection as well as the layout instance.

Parameters
labelCollection:ILabelCollection (default = null) — The node labels. If null, an instance of ListLabelCollection is used.
 
layout:IRectangle (default = null) — The node layout. If null, a zero-sized rectangle will be used.
 
ports:IPortCollection (default = null) — The node ports. If null an instance of ListPortModel is used.
 
lookup:ILookup (default = null)
Method Detail
lookup()method
override public function lookup(type:Class):Object

Returns an instance that implements the given type or null.

Typically, this method will be called in order to obtain a different view or aspect of the current instance. This is quite similar to casting or using a super type or interface of this instance, but is not limited to inheritance or compile time constraints. An instance implementing this method is not required to return non-null implementations for the types, nor does it have to return the same instance any time. Also it depends on the type and context whether the instance returned stays up to date or needs to be reobtained for subsequent use.

Parameters

type:Class — the type for which an instance shall be returned

Returns
Object — an instance that is assignable to type or null
toString()method 
public function toString():String

Returns a String representation of this instance.

Returns
String — A String representation of this instance.