Default implementation of the ITable interface.
ImplementsInheritance Hierarchy

Members

Show:

Constructors

Default constructor that creates an empty table

Parameters

Properties

Returns the accumulated padding for the table.
readonly
Gets or sets the defaults for Columns.

The settings that are obtained from the instance influence newly created elements only. Setting different defaults later does not influence existing elements.

If no value is set explicitly a default will be created using createColumnDefaults upon first read access.

final
Gets the top-level IColumns in this table.
readonlyfinal
Gets a TableDecorator instance for use with this table.
readonly
Gets the layout of the table, relative to an owner node.
readonlyfinal

Implements

ITable.layout
Gets or sets the padding for this table.
This padding is applied in addition to any implicit padding provided by the child stripes.
conversionfinal

Implements

ITable.padding
Gets the virtual root of the column hierarchy
This column should not be queried except for the parentColumn and the associated table
readonlyfinal
Gets the virtual root of the row hierarchy
This row should not be queried except for the parentRow and the associated table
readonlyfinal

Implements

ITable.rootRow
Gets or sets the defaults for rows.

The settings that are obtained from the instance influence newly created elements only. Setting different defaults later does not influence existing elements.

If no value is set explicitly a default will be created using createRowDefaults upon first read access.

final
Gets the top-level IRows in this table.
readonlyfinal

Methods

Add a label to the given owner using the text as the initial label text and label model parameter and style.

Parameters

owner: IStripe
The owner to add the label to.
text: string
The initial text of the label
layoutParameter?: ILabelModelParameter
The label model parameter instance to use.
style?: ILabelStyle
The style to use for the label
preferredSize?: Size
The initial values to use for the preferredSize.
tag?: ILabel['tag']
The initial tag to assign.

Return Value

ILabel
The newly created label

Implements

ITable.addLabel
Adjusts the preferredSize property of a label to fit the suggested size of its ILabelStyleRenderer.
This implementation uses the style's renderer for the label to determine the preferred rendering size. This is useful after the label's content or style have been changed.

Parameters

label: ILabel
The label to adjust the size for.

See Also

API
autoAdjustPreferredSize
Calculates the preferred size of a label with the given properties.

Parameters

stripe: IStripe
The item that will own the label.
style: ILabelStyle
The label style.
layoutParameter: ILabelModelParameter
The label model parameter.
text: string
The text.
tag: ILabel['tag']
The tag for the label.

Return Value

Size
The size as calculated by the ILabelStyleRenderer.
Removes all stripes from a table.
All existing rows and columns are cleared from table.

Defined in

ITable.clear
Create a clone of this object.

Return Value

Object
A clone of this object.
Called during clone to create a copy of column.
If column implements the ICloneable interface, the column instance is cloned. Otherwise, the original instance is returned unchanged.
protected

Parameters

column: IColumn
The column that should be copied during a clone operation.

Return Value

IColumn
A clone of column if possible. Otherwise, the original reference to column.
Called during clone to create a copy of originalDefaults
This implementation returns an unchanged reference to originalDefaults. If you need to create a deep clone of originalDefaults, you'll have to perform the cloning yourself.
protected

Parameters

originalDefaults: IStripeDefaults
The default settings that should be copied during a clone operation.

Return Value

IStripeDefaults
The original reference to originalDefaults
Called during clone to create a copy of row.
If row implements the ICloneable interface, the row instance is cloned. Otherwise, the original instance is returned unchanged.
protected

Parameters

row: IRow
The row that should be copied during a clone operation.

Return Value

IRow
A clone of row if possible. Otherwise, the original reference to row.
Create a new column as the indexth child of parent with the given parameters.

Parameters

parent: IColumn
The owner of the new column.
width?: number
The actual width of the column.
minWidth?: number
The minimal width of the column.
padding?: Insets
The padding of the column.
style?: IStripeStyle
The style of the column.
tag?: IColumn['tag']
The tag of the column
index?: number
The position in the child list.

Return Value

IColumn
A new column instance
Create a new row as the indexth child of parent with the given parameters.

Parameters

parent: IRow
The owner of the new row.
height?: number
The actual height of the row.
minHeight?: number
The minimal height of the row.
padding?: Insets
The padding of the row.
style?: IStripeStyle
The style of the row.
tag?: IRow['tag']
The tag of the row
index?: number
The position in the child list.

Return Value

IRow
A new row instance
Creates and returns a column as last child of table.
The column will be a part of this table after the method returns. This will trigger the corresponding events. Unspecified parameters default to rowDefaults.

Parameters

width?: number
The actual width of the column.
minWidth?: number
The minimal width of the column.
padding?: Insets
The padding of the column.
style?: IStripeStyle
The style of the column.
tag?: IColumn['tag']
The tag of the column
index?: number
The position in the child list. If omitted, the row will be positioned at the end.

Return Value

IColumn
A newly created column instance

See Also

API
stripe-created
Creates the column defaults.
Creates a columns x rows.
All existing rows and columns are cleared from table.

Parameters

columns: number
The number of columns to test.
rows: number
The number of rows to test.
Creates the label model parameter for a given ILabelOwner.
This implementation uses the label defaults for the table to obtain the parameter instance.

Parameters

stripe: IStripe
The item that is the owner of the label in question.

Return Value

ILabelModelParameter
The default label model parameter to use for newly created labels at the item.

See Also

API
getLayoutParameterInstance
Creates an instance of the default label style for the given stripe.
Delegates to the getStyleInstance method for the given stripe.

Parameters

stripe: IStripe
The item the newly created label will belong to.

Return Value

ILabelStyle
The style instance to use for newly created stripes.
Creates and returns a row as last child of table.
The row will be a part of this table after the method returns. This will trigger the corresponding events. Unspecified parameters default to rowDefaults.

Parameters

height?: number
The actual height of the row.
minHeight?: number
The minimal height of the row.
padding?: Insets
The padding of the row.
style?: IStripeStyle
The style of the row.
tag?: IRow['tag']
The tag of the row
index?: number
The position in the child list. If omitted, the row will be positioned at the end.

Return Value

IRow
A newly created row instance

See Also

API
stripe-created
Creates the row defaults.
Finds a column underneath a certain point.
The columns are tested in bottom-up order.

Parameters

node: INode
The node this table is currently bound to
location: Point
The location to test.
filter?: function(IStripe): boolean
Additional predicate to further restrict the results.

Return Value

IColumn
The topmost column that has been found for the location or null.
Finds a row underneath a certain point.
The rows are tested in bottom-up order.

Parameters

node: INode
The node this table is currently bound to
location: Point
The location to test.
filter?: function(IStripe): boolean
Additional predicate to further restrict the results.

Return Value

IRow
The topmost row that has been found for the location or null.

Defined in

ITable.findRow
Finds all stripes underneath a certain point.
The stripes are always returned in bottom up, rows first order. Note that this method does not take any hitTestRadius into account.

Parameters

node: INode
The node this table is currently bound to
location: Point
The location to test.
stripeTypes: StripeTypes
An enumeration value of StripeTypes to specify the stripe type.
filter?: function(IStripe): boolean
Additional predicate to further restrict the hit test results.

Return Value

IEnumerable<IStripe>
The stripes that have been found for the location or null.

See Also

Developer's Guide
Calculates the relative bounds of a table cell that is determined by column and row
Both column and row must reside in the provided table instance. Otherwise, an ArgumentError is thrown.

Parameters

column: IColumn
The column that determines the cell
row: IRow
The row that determines the cell

Return Value

Rect
The relative bounds of the cell determined by column and row

Throws

Exception ({ name: 'ArgumentError' })
If column and row are part of a different table instance.
Returns an instance that implements the given type or null.
Typically, this method will be called to obtain a different view or aspect of the current instance. This is quite similar to casting or using a super type or interface of this instance, but is not limited to inheritance or compile-time constraints. An instance implementing this method is not required to return non-null implementations for the types, nor does it have to return the same instance any time. Also, it depends on the type and context whether the instance returned stays up to date or needs to be re-obtained for further use.

Parameters

type: Constructor<T>
the type for which an instance shall be returned

Return Value

T
an instance that is assignable to the type or null

Implements

ILookup.lookup
Called after a label has been added to a stripe.
This method raises the label-added event.
protected

Parameters

label: ILabel
The label that has just been added.
Called after a label has changed.
This method raises the label-changed event.
protected

Parameters

label: ILabel
The label that has changed.
Called after a label has been removed from its stripe.
This method raises the label-removed event.
protected

Parameters

owner: ILabelOwner
The old owner of the label.
label: ILabel
The label that has just been removed.
Called after a stripe has changed.
This will trigger the stripe-changed event.
protected

Parameters

owner: IStripe
The original owner
stripe: IStripe
The stripe that has changed.
oldTable: ITable
The original table owner, in case the stripe has been moved between different table instances
Called after a stripe has been created and added to a table.
This method raises the stripe-created event.
protected

Parameters

stripe: IStripe
The stripe that has just been created.
Called after a stripe has been removed from its owner.
This method raises the stripe-removed event.
protected

Parameters

owner: IStripe
The old owner of the stripe.
stripe: IStripe
The stripe that has just been removed.
Removes stripe from its parent container.
This method reparents all children of stripe to the parent of the stripe.

Parameters

stripe: IStripe
The stripe to remove

Implements

ITable.remove
Removes the given label from its owner.
This will trigger the corresponding event.

Parameters

label: ILabel
The label to remove

Throws

Exception ({ name: 'ArgumentError' })
If the label is not associated with this table instance.

Implements

ITable.remove
Removes stripe and all of its descendants from table.
This method does not resize any stripes, use removeRecursivelyWithResize instead.

Parameters

stripe: IStripe
The stripe to remove.

See Also

Developer's Guide
Removes the given stripe and all of its descendants from table and resizes all affected stripes so that the table size does not change if possible.

Parameters

stripe: IStripe
The stripe to remove.

See Also

Developer's Guide
Removes stripe from table and resizes all affected stripes so that the table size does not change if possible.

Parameters

stripe: IStripe
The stripe to remove.

See Also

Developer's Guide
Sets the label model parameter for the given label.

Parameters

label: ILabel
The label.
layoutParameter: ILabelModelParameter
The new parameter.

Throws

Exception ({ name: 'ArgumentError' })
If the parameter cannot be used for this label or if the label is not associated with this table instance.
Sets the preferred size of the label.

Parameters

label: ILabel
The label.
preferredSize: Size
The new preferred size.

Throws

Exception ({ name: 'ArgumentError' })
If the label is not associated with this table instance.

See Also

API
preferredSize
Sets the label text of the given label.

Parameters

label: ILabel
The label to modify
text: string
The new text of the label

Throws

Exception ({ name: 'ArgumentError' })
If the label is not associated with this table instance.

See Also

API
text
Sets the minimum size of stripe.
This method sets the minimumSize of stripe.

Parameters

stripe: IStripe
The stripe to change
minimumSize: number
The new minimum size of the stripe
Sets parent as new parent of row, inserting row at the given index.
The row will be inserted at position index in the child list of the new parent.

Parameters

parent: IRow
row: IRow
index?: number
Sets parent as new parent of column, inserting column at the given index.
The column will be inserted at position index in the child list of the new parent.

Parameters

parent: IColumn
column: IColumn
index?: number
Sets the actual size of stripe.
This method sets the size of stripe.

Parameters

stripe: IStripe
The stripe to change
size: number
The new size of the stripe

Implements

ITable.setSize
Sets the padding of stripe.

Parameters

stripe: IStripe
The stripe to change
padding: Insets
The new padding of the stripe
Sets the style of stripe.

Parameters

stripe: IStripe
The stripe to change
style: IStripeStyle
The new style of the stripe

Implements

ITable.setStyle
Assigns the given style instance by reference to the label.
Style instances can be shared.

Parameters

label: ILabel
The label that will be assigned the new style
style: ILabelStyle
The style instance that will be assigned to the label.

Throws

Exception ({ name: 'ArgumentError' })
If the label is not associated with this table instance.

See Also

API
style

Implements

ITable.setStyle

Events

Occurs when a label has been added to this graph instance.

Properties of

ItemEventArgs<ILabel>
item: T
Gets the item that is the subject of the event.
Occurs when a label has been changed, for instance, if its style has been replaced.

Properties of

ItemEventArgs<ILabel>
item: T
Gets the item that is the subject of the event.
Occurs when a label has been removed from this graph instance.

This event will also be triggered, prior to the removal of the owner of the label.

Implementations may choose to use the LabelEventArgs to carry additional label owner information. The owner property will be set to the owner of the label that owned it before the removal.

Properties of

LabelEventArgs
item: ILabel
Gets the item that is the subject of the event.
owner: ILabelOwner
Gets the owner of the label that owned the label before the event happened.
Occurs when a stripe has been changed, for instance, if its style has been replaced.

Properties of

StripeEventArgs
item: IStripe
Gets the item that is the subject of the event.
parentStripe: IStripe
Gets the parent of the stripe that owned the stripe before the event happened.
table: ITable
Gets the table that owned the stripe before the event happened.
Occurs when a stripe has been added.

Properties of

ItemEventArgs<IStripe>
item: T
Gets the item that is the subject of the event.
Occurs when a stripe has been removed from its parent.

Properties of

StripeEventArgs
item: IStripe
Gets the item that is the subject of the event.
parentStripe: IStripe
Gets the parent of the stripe that owned the stripe before the event happened.
table: ITable
Gets the table that owned the stripe before the event happened.

Constants

Gets an IContextLookup that provides the default implementations returned by an IColumn's lookup.
The provided default implementations can, for example, be used as a fallback when the column lookup is wrapped.
staticreadonly
Gets an IContextLookup that provides the default implementations returned by an IRow's lookup.
The provided default implementations can, for example, be used as a fallback when the row lookup is wrapped.
staticreadonly
Gets an IContextLookup that provides the default implementations returned by an IStripe's lookup.
The provided default implementations can, for example, be used as fallback when the stripe lookup is wrapped.
staticreadonly

Static Methods

Installs the undo support for use with all tables that are bound to nodes in graph.
This method queries the graph for its undo support dynamically whenever undo support is queried in the table. In contrast to installStaticUndoSupport, the undo support installed with this method will thus always be the one which is the currently available support for the graph.
static

Parameters

graph: IGraph
The graph where the nodes exist or will be created/changed and where the undo support should come from.

See Also

Developer's Guide
API
uninstallDynamicUndoSupport, installStaticUndoSupport
Installs the undo support for use with all tables that are bound to nodes in graph.

This method installs the undo support which manages the graph at the time this method is called. In contrast to installDynamicUndoSupport, the installed undo support will not change when the graph's undo support changes.

This method adds undo support both for existing nodes in graph as well as for newly created or changed nodes.

static

Parameters

graph: IGraph
The graph where the nodes exist or will be created/changed.

See Also

Developer's Guide
API
uninstallStaticUndoSupport, installDynamicUndoSupport
Uninstalls the undo support that has previously been installed with installDynamicUndoSupport
static

Parameters

graph: IGraph
The graph where the tables are installed for which the undo support should be cleared.
Uninstalls the undo support that has previously been installed with installStaticUndoSupport
static

Parameters

graph: IGraph
The graph where the tables are installed for which the undo support should be cleared.