../../../ibm_ilog/diagram/gfxlayout/StackLayout.html
ibm_ilog.diagram.gfxlayout.StackLayout
dojo.require("ibm_ilog.diagram.gfxlayout.StackLayout");
The StackLayout class arranges children of a container as a horizontal or vertical stack
depending on the value of its horizontal property. By default, a StackLayout has a vertical flow.
An horizontal stack layout align its children vertically in the computed layout slot according to
their 'valign' (one of the 'top', 'center', 'bottom' and 'stretch' values) and their 'margins' properties.
Respectively, a vertical stack layout align its children horizontally in the computed layout slot according to
their 'halign' (one of the 'left', 'center', 'right' and 'stretch' values) and their 'margins' properties.
The StackLayout class defines the paddingLeft, paddingRight, paddingTop and paddingBottom properties
to specify the internal margins of the panel from which the children are positioned. A convenient global padding
property is also defined to set the same padding in all directions.
Space between children can be adjusted using the gap property.
Property Summary
Method Summary
- adjustBBox(bbox) Returns the container bbox adjusted according to the constraints of this layout.
- computePreferredSize(proposedSize) Computes the preferred size of the associated container according to the layout strategy.
- constructor(args) Creates and initializes a new ibm_ilog.diagram.gfxlayout.Layout instance.
args : Object : a mixin set of parameters.
- doLayout(contBounds) Applies this layout to the associated container.
- getConfig() Gets the current configuration of this layout instance.
Description:
This method returns a descriptor of this layout current configuration
as well as the type information so that it can be passed to the Group.setLayout() method
(for example to make a copy the layout of a Group).
- inLayout() Indicates whether this layout is in a layout session.
- invalidate() Invalidates this layout.
- layoutChildren(contBounds) Lays out the children of the associated container.
- placeChildInSlot(shape, slotBounds, hAlign, vAlign) Places the specified object in the given slotBounds.
- setGap(value) Sets the items gap.
- setHorizontal(value) Sets the stack orientation.
- setPadding(value) Sets the padding of this layout.
Event Summary
Attached Objects
Properties
Methods
Returns the container bbox adjusted according to the constraints of this layout.
Parameter | Type | Description |
---|
bbox | dojox.gfx.Rectangle | Rectangle: the bounding box of the associated container. |
Computes the preferred size of the associated container according to the layout strategy.
Parameter | Type | Description |
---|
proposedSize | Size | |
Creates and initializes a new ibm_ilog.diagram.gfxlayout.Layout instance.
args : Object : a mixin set of parameters.
Parameter | Type | Description |
---|
args | | |
Applies this layout to the associated container.
Parameter | Type | Description |
---|
contBounds | Rect | |
Object
An object that represents the layout current configuration.
Gets the current configuration of this layout instance.
Description:
This method returns a descriptor of this layout current configuration
as well as the type information so that it can be passed to the Group.setLayout() method
(for example to make a copy the layout of a Group).
Indicates whether this layout is in a layout session.
This method post a layout request to the layout engine.
Lays out the children of the associated container.
Parameter | Type | Description |
---|
contBounds | Size | |
This method should be invoked by layout implementation to place a shape within
the given slot bounds, taking into account the vertical and horizontal alignment
contraints of the shape (specified by means of the 'valign' and 'halign' properties
on the shape object) and the margins, if any (specified by means of the 'margins'
property.
shape : dojox.gfx.Shape: the shape.
slotBounds : Rectangle : the slot bounds (i.e the bounds where the shape must lie in)
Parameter | Type | Description |
---|
shape | dojox.gfx.Shape | |
slotBounds | dojox.gfx.Rectangle | |
hAlign | Boolean | : indicates whether the shape must be aligned horizontally according to
the value of its halign property. |
vAlign | Boolean | : indicates whether the shape must be aligned vertically according to
the value of its valign property. |
Sets the items gap.
Parameter | Type | Description |
---|
value | Integer | Integer: the gap between each items. |
Sets the stack orientation.
Parameter | Type | Description |
---|
value | Boolean | Boolean: true for an horizontal layout, false otherwise. |
This property is used to set the internal margins of this layout.
The value can either be a 4-elements array whose items match
respectively the left, top, right and bottom paddings ; or one integer
that is applied to all paddings.
Parameter | Type | Description |
---|
value | | |
Events
This method should be called by layout subclasses when a property change needs
the layout to be refreshed.