API / geotoolkit / controls / editing / scaling / RectangularShapeAdapter / RectangularShapeAdapter
scaling.RectangularShapeAdapter.RectangularShapeAdapter
Defines adapter to scale and move rectangular shape
| Name | Type |
|---|---|
T | extends AbstractNode & { getBounds: () => Rect | null } = Rectangle |
ShapeAdapter<T>↳
RectangularShapeAdapter↳↳
GroupAdapter
Methods
Constructors
• new RectangularShapeAdapter<T>(options?)
| Name | Type |
|---|---|
T | extends AbstractNode<T> & { getBounds: () => Rect } = Rectangle |
| Name | Type |
|---|---|
Optional options | Options |
ShapeAdapter<T&gt;.constructor
Methods
▸ dispose(): void
Dispose.
void
▸ getActiveHandle(): AbstractHandle
Gets active handle
▸ getClassName(): string
string
▸ getHandle(): BoxHandle
Return box handle
▸ getManipulatorLayer(): CompositeNode<Node>
Return manipulator layer
ShapeAdapter.getManipulatorLayer
▸ getOptions(): OptionsBase
Get display options
options
▸ getPosition(): Point
Gets position
▸ getProperties(): any
Gets properties pertaining to this handle
any
properties properties
▸ getShape(): T
Shape
T
▸ 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): RectangularShapeAdapter<T>
Move adapter and send event Events.Moved
| Name | Type | Description |
|---|---|---|
x | number | x position |
y | number | y position |
this
▸ notify<E>(type, source, args?): RectangularShapeAdapter<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 |
this
▸ off<E>(type?, callback?): RectangularShapeAdapter<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: RectangularShapeAdapter<T>, args: EventMap[E]) => void | function to be called |
this
▸ on<E>(type, callback): RectangularShapeAdapter<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: RectangularShapeAdapter<T>, 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): RectangularShapeAdapter<T>
OnMove
| Name | Type | Description |
|---|---|---|
x | number | x coordinate |
y | number | y coordinate |
▸ setActive(active): RectangularShapeAdapter<T>
Activate
| Name | Type | Description |
|---|---|---|
active | boolean | active state or not |
▸ setActiveHandle(handle): RectangularShapeAdapter<T>
Sets active handle
| Name | Type | Description |
|---|---|---|
handle | AbstractHandle | active handle |
this
▸ setOptions(options?): RectangularShapeAdapter<T>
Set display options
| Name | Type | Description |
|---|---|---|
Optional options | Options | options |
this
▸ setPosition(x?, y?): RectangularShapeAdapter<T>
Sets position
| Name | Type | Description |
|---|---|---|
Optional x | number | x coordinate |
Optional y | number | y coordinate |
▸ setProperties(props?): RectangularShapeAdapter<T>
Sets properties pertaining to this object
| Name | Type | Description |
|---|---|---|
Optional props | any | An object containing the properties to set |
this
▸ setRegistry(registry): RectangularShapeAdapter<T>
Sets registry
| Name | Type | Description |
|---|---|---|
registry | ShapeAdapterRegistry | associated with current shape adapter |
this
▸ setShape(shape): RectangularShapeAdapter<T>
Sets shape
| Name | Type | Description |
|---|---|---|
shape | T | current shape |
▸ setSilent(bool): RectangularShapeAdapter<T>
Set silent mode
| Name | Type | Description |
|---|---|---|
bool | boolean | flag to enable silent mode |
this
▸ setStyle(json?): RectangularShapeAdapter<T>
Sets linestyle and fillstyle for the main handle (rectangle) and all the corner handles (squares)
| Name | Type | Description |
|---|---|---|
Optional json | Style | json object for new style |
this
▸ update(): void
Update
void
▸ updateHandles(): RectangularShapeAdapter<T>
Update handles
this
▸ Static getClassName(): string
string