Skip to content
Last updated

API / geotoolkit / controls / editing / scaling / RectangularShapeAdapter / RectangularShapeAdapter

Class: RectangularShapeAdapter<T&gt;

scaling.RectangularShapeAdapter.RectangularShapeAdapter

Defines adapter to scale and move rectangular shape

Type parameters

NameType
Textends AbstractNode & { getBounds: () => Rect | null } = Rectangle

Hierarchy

Table of contents

Constructors
  • [new RectangularShapeAdapter<T&gt;(options)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.controls.editing.scaling.rectangularshapeadapter.rectangularshapeadapter.md#new rectangularshapeadapter<t>(options))
Methods

Contents

Constructors

new RectangularShapeAdapter&lt;T&amp;gt;(options)

• new RectangularShapeAdapter<T&gt;(options?)

Type parameters

NameType
Textends AbstractNode<T&gt; & { getBounds: () => Rect } = Rectangle

Parameters

Name Type
Optional optionsOptions

Overrides

ShapeAdapter&lt;T&amp;gt;.constructor

Methods

dispose

▸ dispose(): void

Dispose.

Returns

void

Inherited from

ShapeAdapter.dispose


getActiveHandle

▸ getActiveHandle(): AbstractHandle

Gets active handle

Returns

AbstractHandle

Inherited from

ShapeAdapter.getActiveHandle


getClassName

▸ getClassName(): string

Returns

string

Inherited from

ShapeAdapter.getClassName


getHandle

▸ getHandle(): BoxHandle

Return box handle

Returns

BoxHandle


getManipulatorLayer

▸ getManipulatorLayer(): CompositeNode<Node&gt;

Return manipulator layer

Returns

CompositeNode<Node&gt;

Inherited from

ShapeAdapter.getManipulatorLayer


getOptions

▸ getOptions(): OptionsBase

Get display options

Returns

OptionsBase

options


getPosition

▸ getPosition(): Point

Gets position

Returns

Point

Inherited from

ShapeAdapter.getPosition


getProperties

▸ getProperties(): any

Gets properties pertaining to this handle

Returns

any

properties properties

Inherited from

ShapeAdapter.getProperties


getShape

▸ getShape(): T

Shape

Returns

T

Inherited from

ShapeAdapter.getShape


getShapeBounds

▸ getShapeBounds(): Rect

Return shape bounds

Returns

Rect

bounds


getTransformation

▸ getTransformation(): Transformation

Return transformation

Returns

Transformation

Inherited from

ShapeAdapter.getTransformation


hasEventListener

▸ hasEventListener(type, callback?): boolean

Check if a list of event listeners for this type contains this listener

Parameters

Name Type Description
typestringtype of event or property
Optional callbackFunctionto be called, if null, check if any callback is registered

Returns

boolean

Inherited from

ShapeAdapter.hasEventListener


initialize

▸ initialize(): boolean

Initialize

Returns

boolean

Inherited from

ShapeAdapter.initialize


isActive

▸ isActive(): boolean

Returns active state of this handle

Returns

boolean

Inherited from

ShapeAdapter.isActive


isDisposed

▸ isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

ShapeAdapter.isDisposed


isInitialized

▸ isInitialized(): boolean

Get state of the adapter

Returns

boolean

Inherited from

ShapeAdapter.isInitialized


isSilent

▸ isSilent(): boolean

Return true if the event dispatcher doesn't notify any events

Returns

boolean

Inherited from

ShapeAdapter.isSilent


move

▸ move(x, y): RectangularShapeAdapter<T&gt;

Move adapter and send event Events.Moved

Parameters

Name Type Description
xnumberx position
ynumbery position

Returns

RectangularShapeAdapter<T&gt;

this

Inherited from

ShapeAdapter.move


notify

▸ notify<E&gt;(type, source, args?): RectangularShapeAdapter<T&gt;

Notify listeners

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEevent types
sourceShapeAdapter<T&gt;of the event
Optional argsEventMap[E]arguments of the event

Returns

RectangularShapeAdapter<T&gt;

this

Inherited from

ShapeAdapter.notify


off

▸ off<E&gt;(type?, callback?): RectangularShapeAdapter<T&gt;

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.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
Optional typeEtype of the event
Optional callback(eventType: E, sender: RectangularShapeAdapter<T&gt;, args: EventMap[E]) => voidfunction to be called

Returns

RectangularShapeAdapter<T&gt;

this

Inherited from

ShapeAdapter.off


on

▸ on<E&gt;(type, callback): RectangularShapeAdapter<T&gt;

Attach listener on event that will be called whenever the specified event is delivered to the target <p> If the callback function is already in the list of event listeners for this target, the function is not added a second time. </p> <p> 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. </p>

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEtype of event or property
callback(eventType: E, sender: RectangularShapeAdapter<T&gt;, args: EventMap[E]) => voidto be called

Returns

RectangularShapeAdapter<T&gt;

this

Inherited from

ShapeAdapter.on


onActiveStateChanged

▸ onActiveStateChanged(active): void

Active state is changed

Parameters

Name Type Description
activebooleanactive state or not

Returns

void

Overrides

ShapeAdapter.onActiveStateChanged


onInitialize

▸ onInitialize(): boolean

OnInitialize

Returns

boolean

success true if initialized successfully

Overrides

ShapeAdapter.onInitialize


onMove

▸ Protected onMove(x, y): RectangularShapeAdapter<T&gt;

OnMove

Parameters

Name Type Description
xnumberx coordinate
ynumbery coordinate

Returns

RectangularShapeAdapter<T&gt;

Overrides

ShapeAdapter.onMove


setActive

▸ setActive(active): RectangularShapeAdapter<T&gt;

Activate

Parameters

Name Type Description
activebooleanactive state or not

Returns

RectangularShapeAdapter<T&gt;

Inherited from

ShapeAdapter.setActive


setActiveHandle

▸ setActiveHandle(handle): RectangularShapeAdapter<T&gt;

Sets active handle

Parameters

Name Type Description
handleAbstractHandleactive handle

Returns

RectangularShapeAdapter<T&gt;

this

Inherited from

ShapeAdapter.setActiveHandle


setOptions

▸ setOptions(options?): RectangularShapeAdapter<T&gt;

Set display options

Parameters

Name Type Description
Optional optionsOptionsoptions

Returns

RectangularShapeAdapter<T&gt;

this


setPosition

▸ setPosition(x?, y?): RectangularShapeAdapter<T&gt;

Sets position

Parameters

Name Type Description
Optional xnumberx coordinate
Optional ynumbery coordinate

Returns

RectangularShapeAdapter<T&gt;

Inherited from

ShapeAdapter.setPosition


setProperties

▸ setProperties(props?): RectangularShapeAdapter<T&gt;

Sets properties pertaining to this object

Parameters

Name Type Description
Optional propsanyAn object containing the properties to set

Returns

RectangularShapeAdapter<T&gt;

this

Inherited from

ShapeAdapter.setProperties


setRegistry

▸ setRegistry(registry): RectangularShapeAdapter<T&gt;

Sets registry

Parameters

Name Type Description
registryShapeAdapterRegistryassociated with current shape adapter

Returns

RectangularShapeAdapter<T&gt;

this

Inherited from

ShapeAdapter.setRegistry


setShape

▸ setShape(shape): RectangularShapeAdapter<T&gt;

Sets shape

Parameters

Name Type Description
shapeTcurrent shape

Returns

RectangularShapeAdapter<T&gt;

Overrides

ShapeAdapter.setShape


setSilent

▸ setSilent(bool): RectangularShapeAdapter<T&gt;

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

RectangularShapeAdapter<T&gt;

this

Inherited from

ShapeAdapter.setSilent


setStyle

▸ setStyle(json?): RectangularShapeAdapter<T&gt;

Sets linestyle and fillstyle for the main handle (rectangle) and all the corner handles (squares)

Parameters

Name Type Description
Optional jsonStylejson object for new style

Returns

RectangularShapeAdapter<T&gt;

this


update

▸ update(): void

Update

Returns

void

Inherited from

ShapeAdapter.update


updateHandles

▸ updateHandles(): RectangularShapeAdapter<T&gt;

Update handles

Returns

RectangularShapeAdapter<T&gt;

this

Overrides

ShapeAdapter.updateHandles


getClassName

▸ Static getClassName(): string

Returns

string

Inherited from

ShapeAdapter.getClassName