Package | com.yworks.graph.model |
Class | public class AbstractModelItem |
Inheritance | AbstractModelItem Object |
Implements | IModelItem, IMutableLookup |
Subclasses | AbstractLabeledItem, DefaultBend, DefaultLabel, DefaultPort |
IModelItem
with support for pluggable ILookup
implementations.
Property | Defined By | ||
---|---|---|---|
_lookupMap : IMapper
The map which is used by registerLookup() to store instances in. | AbstractModelItem |
Method | Defined By | ||
---|---|---|---|
AbstractModelItem(lookup:ILookup = null)
Creates a new item using the given initial lookup implementation, which may be null. | AbstractModelItem | ||
Returns the currently set ILookup delegate. | AbstractModelItem | ||
lookup(type:Class):Object
Simple lookup implementation that tries to find a registered lookup. | AbstractModelItem | ||
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 | ||
setLookupImplementation(newLookup:ILookup):void
Sets the ILookup implementation used for
lookup calls on this instance. | AbstractModelItem |
_lookupMap | property |
protected var _lookupMap:IMapper
The map which is used by registerLookup()
to store instances in.
This map is lazily created upon first access to registerLookup(). Subclasses
which access this map have to test for null
.
AbstractModelItem | () | Constructor |
public function AbstractModelItem(lookup:ILookup = null)
Creates a new item using the given initial lookup implementation, which may be null
.
lookup:ILookup (default = null )
|
getLookup | () | method |
public function getLookup():ILookup
Returns the currently set ILookup
delegate.
ILookup — The current lookup delegate
|
See also
lookup | () | method |
public function lookup(type:Class):Object
Simple lookup implementation that tries to find a registered lookup. If no such lookup is registered,
returns this
if this
is assignable to the provided type.
This implementation tries to find an implementation of the given type in the following order:
registerLookup
.this
is returned if it can be casted to the given type.null
is returned.Parameters
type:Class — The query type
|
Object — An implementation of type or null .
|
See also
registerLookup | () | method |
public function 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.
Parameters
type:Class — A type to register an implementation for
| |
instance:Object — An implementation of type
|
setLookupImplementation | () | method |
public function setLookupImplementation(newLookup:ILookup):void
Sets the ILookup
implementation used for
lookup
calls on this instance.
Parameters
newLookup:ILookup — the new implementation to use
|
See also