API / geotoolkit / attributes / SpaceStyle / SpaceStyle
attributes.SpaceStyle.SpaceStyle
Defines properties to specify margins or padding
| Name | Type |
|---|---|
T | extends number | string = number | string |
↳
SpaceStyle↳↳
LayoutStyle
Constructors
Methods
Constructors
• new SpaceStyle<T>(space?)
| Name | Type |
|---|---|
T | extends string | number = string | number |
| Name | Type |
|---|---|
Optional space | Type<T> |
Style.constructor
Methods
▸ clone(): SpaceStyle<T>
All inheritors should implement copy constructor or provide custom implementation for this method
SpaceStyle<T>
this
▸ compile(bounds?): SpaceStyle<number>
Compile style
| Name | Type | Description |
|---|---|---|
Optional bounds | Rect | target bounds |
SpaceStyle<number>
▸ compile(convertToUnit?, bounds?): SpaceStyle<number>
Compile style
| Name | Type | Description |
|---|---|---|
Optional convertToUnit | AbstractUnit | target unit |
Optional bounds | Rect | target bounds |
SpaceStyle<number>
▸ Protected copyConstructor(src, deepCopy?): SpaceStyle<T>
copy constructor
| Name | Type | Description |
|---|---|---|
src | SpaceStyle<T> | Source to copy from |
Optional deepCopy | boolean | deep copy |
SpaceStyle<T>
this
▸ dispose(): void
Dispose.
void
▸ equalsTo(style): boolean
Return true if styles are equals
| Name | Type | Description |
|---|---|---|
style | SpaceStyle<string | number> | style to compare |
boolean
▸ getBottom(): T
Return bottom position
T
▸ getClassName(): string
string
▸ getLeft(): T
Return left position
T
▸ getProperties(context?): OptionsOut<T>
Gets all the properties pertaining to this object
| Name | Type | Description |
|---|---|---|
Optional context | ISerializationContext | serialization context |
OptionsOut<T>
object which contains the following fields
▸ getRight(): T
Return right position
T
▸ getStyle(): Options<T>
return JSON representation of the space object
Options<T>
offsets
▸ getTimeStamp(): number
Gets time stamp
number
timeStamp
▸ getTop(): T
Return top position
T
▸ 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
▸ invalidate(): SpaceStyle<T>
notify the node that the style is invalidated
SpaceStyle<T>
this
▸ isDisposed(): boolean
Returns whether this object has been disposed
boolean
▸ isSilent(): boolean
Return true if the event dispatcher doesn't notify any events
boolean
▸ notify<E>(type, source, args?): SpaceStyle<T>
Notify listeners
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | event types |
source | Style | of the event |
Optional args | EventMap[E] | arguments of the event |
SpaceStyle<T>
this
▸ off<E>(type?, callback?): SpaceStyle<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: SpaceStyle<T>, args: EventMap[E]) => void | function to be called |
SpaceStyle<T>
this
▸ on<E>(type, callback): SpaceStyle<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: SpaceStyle<T>, args: EventMap[E]) => void | to be called |
SpaceStyle<T>
this
▸ setBottom(bottom): SpaceStyle<T>
Set bottom position
| Name | Type | Description |
|---|---|---|
bottom | T | position |
SpaceStyle<T>
this
▸ setLeft(left): SpaceStyle<T>
Set left position
| Name | Type | Description |
|---|---|---|
left | T | position |
SpaceStyle<T>
this
▸ setProperties(properties?): SpaceStyle<T>
Sets all the properties pertaining to this object
| Name | Type | Description |
|---|---|---|
Optional properties | Options<T> | object which contains the following fields |
SpaceStyle<T>
▸ setRight(right): SpaceStyle<T>
Set right position
| Name | Type | Description |
|---|---|---|
right | T | position |
SpaceStyle<T>
this
▸ setSilent(bool, force?): SpaceStyle<T>
Set silent mode
| Name | Type | Description |
|---|---|---|
bool | boolean | flag to enable silent mode |
Optional force | boolean | true if parent should be invalidated immediately |
SpaceStyle<T>
this
▸ setStyle(spaceStyle, silent?): SpaceStyle<T>
Set style
| Name | Type | Description |
|---|---|---|
spaceStyle | Type<T> | space style |
Optional silent | boolean | silent mode |
SpaceStyle<T>
▸ setTop(top): SpaceStyle<T>
Set top position
| Name | Type | Description |
|---|---|---|
top | T | position |
SpaceStyle<T>
this
▸ updateTimeStamp(silent?): SpaceStyle<T>
Update time stamp to indicate that style has been changed.
| Name | Type | Description |
|---|---|---|
Optional silent | boolean | silent mode. If this parameter equals to true then style doesn't send invalidate event |
SpaceStyle<T>
this
▸ Static addSpace(style, rect, transformation?): Rect
Return area including space
| Name | Type | Description |
|---|---|---|
style | SpaceStyle<string | number> | style to add space |
rect | Rect | original area |
Optional transformation | Transformation | screen transformation |
area with including space
▸ Static excludeSpace(style, rect, transformation?): Rect
Return area excluding space
| Name | Type | Description |
|---|---|---|
style | number | SpaceStyle<string | number> | style to exclude space |
rect | Rect | original area |
Optional transformation | Transformation | screen transformation |
area with excluding space
▸ Static fromObject(object?): SpaceStyle<string | number>
Create or get space style from object
| Name | Type | Description |
|---|---|---|
Optional object | Type<string | number> | object can be in format of constructor geotoolkit.attributes.SpaceStyle |
SpaceStyle<string | number>
space style
▸ Static getClassName(): string
string
▸ Static isStyleNotificationEnabled(): boolean
Return status of the global notification for all styles.
boolean
Style.isStyleNotificationEnabled
▸ Static mergeFromObject(node, spaceStyle, object, merge?, invalidateMethod?): SpaceStyle<string | number>
Merge spaceStyle object with existing instance
| Name | Type | Description |
|---|---|---|
node | IStyleListener | node |
spaceStyle | SpaceStyle<string | number> | instance of node property |
object | Type<string | number> | contains space style |
Optional merge | boolean | merge flag |
Optional invalidateMethod | AttributeCallback<EventDispatcher> | invalidate method |
SpaceStyle<string | number>
spaceStyle