API / geotoolkit / flowcharts / shapes / edit / VisualPluginAdapter / VisualPluginAdapter
edit.VisualPluginAdapter.VisualPluginAdapter
The class for visual plugins manipulation
↳
VisualPluginAdapter
Constructors
Methods
Methods
▸ dispose(): void
Dispose.
void
▸ getActiveHandle(): AbstractHandle
Gets active handle
▸ getClassName(): string
string
▸ getManipulatorLayer(): CompositeNode<Node>
Return manipulator layer
ShapeAdapter.getManipulatorLayer
▸ getPosition(): Point
Gets position
▸ getProperties(): any
Gets properties pertaining to this handle
any
properties properties
▸ getShape(): Node
Shape
▸ getShapeBounds(): Rect
Return shape bounds
bounds
▸ getTransformation(): Transformation
Return transformation
ShapeAdapter.getTransformation
▸ hasEventListener(type, callback?): boolean
Check if a list of event listeners for this type contains this listener
| Name | Type | Description |
|---|---|---|
type | string | type of event or property |
Optional callback | Function | to be called, if null, check if any callback is registered |
boolean
▸ initialize(): boolean
Initialize
boolean
▸ isActive(): boolean
Returns active state of this handle
boolean
▸ isDisposed(): boolean
Returns whether this object has been disposed
boolean
▸ isInitialized(): boolean
Get state of the adapter
boolean
▸ isSilent(): boolean
Return true if the event dispatcher doesn't notify any events
boolean
▸ move(x, y): VisualPluginAdapter
Move adapter and send event Events.Moved
| Name | Type | Description |
|---|---|---|
x | number | x position |
y | number | y position |
this
▸ notify<E>(type, source, args?): VisualPluginAdapter
Notify listeners
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | event types |
source | ShapeAdapter<Node> | of the event |
Optional args | EventMap[E] | arguments of the event |
this
▸ off<E>(type?, callback?): VisualPluginAdapter
Detach listener on event. Calling .off() with no arguments removes all attached listeners. Calling .off(type) with no callback removes all attached listeners for specific type.
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
Optional type | E | type of the event |
Optional callback | (eventType: E, sender: VisualPluginAdapter, args: EventMap[E]) => void | function to be called |
this
▸ on<E>(type, callback): VisualPluginAdapter
Attach listener on event that will be called whenever the specified event is delivered to the target
If the callback function is already in the list of event listeners for this target, the function is not added a second time.
If a particular anonymous function is in the list of event listeners registered for a certain target, and then later in the code, an identical anonymous function is given in an "on" call, the second function will also be added to the list of event listeners for that target.
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | type of event or property |
callback | (eventType: E, sender: VisualPluginAdapter, args: EventMap[E]) => void | to be called |
this
▸ onActiveStateChanged(active): void
Active state is changed
| Name | Type | Description |
|---|---|---|
active | boolean | active state or not |
void
ShapeAdapter.onActiveStateChanged
▸ onInitialize(): boolean
OnInitialize
boolean
success true if initialized successfully
▸ onMove(x, y): VisualPluginAdapter
OnMove
| Name | Type | Description |
|---|---|---|
x | number | x coordinate |
y | number | y coordinate |
this
▸ setActive(active): VisualPluginAdapter
Activate
| Name | Type | Description |
|---|---|---|
active | boolean | active state or not |
▸ setActiveHandle(handle): VisualPluginAdapter
Sets active handle
| Name | Type | Description |
|---|---|---|
handle | AbstractHandle | active handle |
this
▸ setPosition(x?, y?): VisualPluginAdapter
Sets position
| Name | Type | Description |
|---|---|---|
Optional x | number | x coordinate |
Optional y | number | y coordinate |
▸ setProperties(props?): VisualPluginAdapter
Sets properties pertaining to this object
| Name | Type | Description |
|---|---|---|
Optional props | any | An object containing the properties to set |
this
▸ setRegistry(registry): VisualPluginAdapter
Sets registry
| Name | Type | Description |
|---|---|---|
registry | ShapeAdapterRegistry | associated with current shape adapter |
this
▸ setShape(shapes): VisualPluginAdapter
Sets shape
this
▸ setSilent(bool): VisualPluginAdapter
Set silent mode
| Name | Type | Description |
|---|---|---|
bool | boolean | flag to enable silent mode |
this
▸ setStyle(json?): VisualPluginAdapter
Sets linestyle and fillstyle for the main handle (rectangle) and all the corner handles (squares)
| Name | Type | Description |
|---|---|---|
Optional json | StyleOptions | a object with style |
this
▸ update(): void
Update
void
▸ updateHandles(): VisualPluginAdapter
Update handles
this
▸ Static getClassName(): string
string