API / geotoolkit / controls / editing / LineShapeAdapter / LineShapeAdapter
editing.LineShapeAdapter.LineShapeAdapter
Defines adapter to move and modify a Line shape
↳
LineShapeAdapter
Constructors
Methods
Constructors
• new LineShapeAdapter()
ShapeAdapter<Line&gt;.constructor
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(): Line
Shape
▸ 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): LineShapeAdapter
Move adapter and send event Events.Moved
| Name | Type | Description |
|---|---|---|
x | number | x position |
y | number | y position |
this
▸ notify<E>(type, source, args?): LineShapeAdapter
Notify listeners
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | event types |
source | ShapeAdapter<Line> | of the event |
Optional args | EventMap[E] | arguments of the event |
this
▸ off<E>(type?, callback?): LineShapeAdapter
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: LineShapeAdapter, args: EventMap[E]) => void | function to be called |
this
▸ on<E>(type, callback): LineShapeAdapter
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: LineShapeAdapter, 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
▸ Protected onMove(x, y): LineShapeAdapter
OnMove
| Name | Type | Description |
|---|---|---|
x | number | x coordinate |
y | number | y coordinate |
▸ setActive(active): LineShapeAdapter
Activate
| Name | Type | Description |
|---|---|---|
active | boolean | active state or not |
▸ setActiveHandle(handle): LineShapeAdapter
Sets active handle
| Name | Type | Description |
|---|---|---|
handle | AbstractHandle | active handle |
this
▸ setPosition(x?, y?): LineShapeAdapter
Sets position
| Name | Type | Description |
|---|---|---|
Optional x | number | x coordinate |
Optional y | number | y coordinate |
▸ setProperties(props?): LineShapeAdapter
Sets properties pertaining to this object
| Name | Type | Description |
|---|---|---|
Optional props | any | An object containing the properties to set |
this
▸ setRegistry(registry): LineShapeAdapter
Sets registry
| Name | Type | Description |
|---|---|---|
registry | ShapeAdapterRegistry | associated with current shape adapter |
this
▸ setShape(shape): LineShapeAdapter
Sets shape
| Name | Type | Description |
|---|---|---|
shape | Line | shape to be modified |
this
▸ setSilent(bool): LineShapeAdapter
Set silent mode
| Name | Type | Description |
|---|---|---|
bool | boolean | flag to enable silent mode |
this
▸ update(): void
Update
void
▸ updateHandles(): LineShapeAdapter
Update handles
this
▸ Static getClassName(): string
string