API / geotoolkit / controls / editing / SymbolAdapter / SymbolAdapter
editing.SymbolAdapter.SymbolAdapter
Defines a shape adapter which has functionality to manipulate Symbols. This adapter associates itself to an instance of Symbol shape, creates a handle rendered on top of the shape and allows dragging the shape around the scene.
↳
SymbolAdapter
Constructors
Methods
Constructors
• new SymbolAdapter()
ShapeAdapter<SymbolShape&gt;.constructor
Methods
▸ dispose(): void
Dispose.
void
▸ engage(x, y, eventArgs?): void
Called when a handle owned by this adapter has been selected and activated. The editing began.
| Name | Type | Description |
|---|---|---|
x | number | X coordinate of the point where the mouse was clicked to engage the handle |
y | number | Y coordinate of the point where the mouse was clicked to engage the handle |
Optional eventArgs | EventArgs | arguments from the event that started the change |
void
▸ getActiveHandle(): AnchoredHandle
Gets active handle
▸ getAllowShapeEdit(): boolean
Returns the flag defining if this adapter directly edits the shape which it is associated with.
boolean
True if shape is being edited
▸ 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(): SymbolShape
Shape
▸ getShowGhost(): boolean
Returns the flag defining if a ghost is moved instead of an actual handle when the shape is being manipulated.
boolean
▸ 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): SymbolAdapter
Move adapter and send event Events.Moved
| Name | Type | Description |
|---|---|---|
x | number | x position |
y | number | y position |
this
▸ notify<E>(type, source, args?): SymbolAdapter
Notify listeners
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | event types |
source | SymbolAdapter | of the event |
Optional args | EventMap[E] | arguments of the event |
this
▸ off<E>(type?, callback?): SymbolAdapter
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: SymbolAdapter, args: EventMap[E]) => void | function to be called |
this
▸ on<E>(type, callback): SymbolAdapter
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: SymbolAdapter, args: EventMap[E]) => void | to be called |
this
▸ onActiveStateChanged(active): void
Called when adapter goes from active to non-active and vice versa
| Name | Type | Description |
|---|---|---|
active | boolean | New state of the adapter |
void
ShapeAdapter.onActiveStateChanged
▸ onInitialize(): boolean
Called during initialization process. Create handles
boolean
▸ onMove(x, y, eventArgs?): SymbolAdapter
Moves the handle and the shape, if shape editing is enabled
| Name | Type | Description |
|---|---|---|
x | number | The device x position to move to |
y | number | The device y position to move to |
Optional eventArgs | EventArgs | Event arguments from the calling tool |
▸ release(x, y, eventArgs?): SymbolAdapter
Called when a handle owned by this adapter has been released and editing stops.
| Name | Type | Description |
|---|---|---|
x | number | X coordinate of pointer when mouseup occurred |
y | number | Y coordinate of pointer when mouseup occurred |
Optional eventArgs | EventArgs | Event arguments from the calling tool |
▸ setActive(active): SymbolAdapter
Activate
| Name | Type | Description |
|---|---|---|
active | boolean | active state or not |
▸ setActiveHandle(handle): SymbolAdapter
Sets active handle
| Name | Type | Description |
|---|---|---|
handle | AbstractHandle | active handle |
this
▸ setAllowShapeEdit(allow): SymbolAdapter
Sets the flag defining if this adapter has to directly edit the shape which it is associated with. Otherwise, it will only send an event.
| Name | Type | Description |
|---|---|---|
allow | boolean | True to edit the shape directly |
▸ setHandleStyles(styles): SymbolAdapter
Sets styles for active, inactive, and ghost states of all handles, and redraws the handle
| Name | Type | Description |
|---|---|---|
styles | HandleStyles | object containing styling for different types of handle states |
▸ setHandlesVisible(visible): SymbolAdapter
Sets the visibility of the handles registered with this adapter
| Name | Type | Description |
|---|---|---|
visible | boolean | Visibility to set on handles |
▸ setPosition(x?, y?): SymbolAdapter
Sets position
| Name | Type | Description |
|---|---|---|
Optional x | number | x coordinate |
Optional y | number | y coordinate |
▸ setProperties(props?): SymbolAdapter
Sets properties pertaining to this object
| Name | Type | Description |
|---|---|---|
Optional props | any | An object containing the properties to set |
this
▸ setRegistry(registry): SymbolAdapter
Sets registry
| Name | Type | Description |
|---|---|---|
registry | ShapeAdapterRegistry | associated with current shape adapter |
this
▸ setShape(shape): SymbolAdapter
Sets shape to be modified
| Name | Type | Description |
|---|---|---|
shape | SymbolShape | shape to be modified |
▸ setShowGhost(show): SymbolAdapter
Sets the flag defining if a ghost should be moved instead of an actual handle when the shape is being manipulated.
| Name | Type | Description |
|---|---|---|
show | boolean | True to display a ghost handle |
▸ setSilent(bool): SymbolAdapter
Set silent mode
| Name | Type | Description |
|---|---|---|
bool | boolean | flag to enable silent mode |
this
▸ update(): SymbolAdapter
Updates the state of the adapter, recalculates position and size of handles, and redraws.
▸ updateHandles(): SymbolAdapter
Update handles
this
▸ Static getClassName(): string
string