API / geotoolkit / controls / editing / ShapeAdapter / ShapeAdapter
editing.ShapeAdapter.ShapeAdapter
Defines an abstract adapter to perform operation for shapes
This is the parent class for shape adapters responsible for implementing editing capabilities for a shape.
| Name | Type |
|---|---|
T | Node |
↳
ShapeAdapter
Constructors
Methods
Constructors
• Protected new ShapeAdapter<T>()
Creates adapter
| Name | Type |
|---|---|
T | Node |
EventDispatcher.constructor
Methods
▸ dispose(): void
Dispose.
void
▸ getActiveHandle(): AbstractHandle
Gets active handle
▸ getClassName(): string
string
▸ getManipulatorLayer(): CompositeNode<Node>
Return manipulator layer
▸ getPosition(): Point
Gets position
▸ getProperties(): any
Gets properties pertaining to this handle
any
properties properties
▸ getShape(): T
Shape
T
▸ getTransformation(): Transformation
Return transformation
▸ 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
EventDispatcher.hasEventListener
▸ 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): ShapeAdapter<T>
Move adapter and send event Events.Moved
| Name | Type | Description |
|---|---|---|
x | number | x position |
y | number | y position |
ShapeAdapter<T>
this
▸ notify<E>(type, source, args?): ShapeAdapter<T>
Notify listeners
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | event types |
source | ShapeAdapter<T> | of the event |
Optional args | EventMap[E] | arguments of the event |
ShapeAdapter<T>
this
▸ off<E>(type?, callback?): ShapeAdapter<T>
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: ShapeAdapter<T>, args: EventMap[E]) => void | function to be called |
ShapeAdapter<T>
this
▸ on<E>(type, callback): ShapeAdapter<T>
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: ShapeAdapter<T>, args: EventMap[E]) => void | to be called |
ShapeAdapter<T>
this
▸ Protected Abstract onActiveStateChanged(active): void
Active state is changed
| Name | Type | Description |
|---|---|---|
active | boolean | active state or not |
void
▸ Protected Abstract onInitialize(): boolean
OnInitialize
boolean
success true if initialized successfully
▸ Protected Abstract onMove(x, y): ShapeAdapter<T>
OnMove
| Name | Type | Description |
|---|---|---|
x | number | x coordinate |
y | number | y coordinate |
ShapeAdapter<T>
▸ setActive(active): ShapeAdapter<T>
Activate
| Name | Type | Description |
|---|---|---|
active | boolean | active state or not |
ShapeAdapter<T>
▸ setActiveHandle(handle): ShapeAdapter<T>
Sets active handle
| Name | Type | Description |
|---|---|---|
handle | AbstractHandle | active handle |
ShapeAdapter<T>
this
▸ setPosition(x?, y?): ShapeAdapter<T>
Sets position
| Name | Type | Description |
|---|---|---|
Optional x | number | x coordinate |
Optional y | number | y coordinate |
ShapeAdapter<T>
▸ setProperties(props?): ShapeAdapter<T>
Sets properties pertaining to this object
| Name | Type | Description |
|---|---|---|
Optional props | any | An object containing the properties to set |
ShapeAdapter<T>
this
▸ setRegistry(registry): ShapeAdapter<T>
Sets registry
| Name | Type | Description |
|---|---|---|
registry | ShapeAdapterRegistry | associated with current shape adapter |
ShapeAdapter<T>
this
▸ setShape(shape): ShapeAdapter<T>
Sets shape to be modified
| Name | Type | Description |
|---|---|---|
shape | T | shape to be modified |
ShapeAdapter<T>
▸ setSilent(bool): ShapeAdapter<T>
Set silent mode
| Name | Type | Description |
|---|---|---|
bool | boolean | flag to enable silent mode |
ShapeAdapter<T>
this
▸ update(): void
Update
void
▸ Abstract updateHandles(): ShapeAdapter<T>
Update handles
ShapeAdapter<T>
this
▸ Static getClassName(): string
string