IBM ILOG Dojo Diagrammer 1.1 API Documentation
Legend: Array Boolean Constructor Date DomNode Error Function Namespace Number Object RegExp Singleton String

ibm_ilog.diagram.gfxlayout.StackLayout (version 1.1-SNAPSHOT)

Object » ibm_ilog.diagram.gfxlayout.Layout » 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

gap
horizontal
padding
paddingBottom
paddingLeft
paddingRight
paddingTop

Methods

adjustBBox
Returns the container bbox adjusted according to the constraints of this layout.
ParameterTypeDescription
bboxdojox.gfx.RectangleRectangle: the bounding box of the associated container.
computePreferredSize
Computes the preferred size of the associated container according to the layout strategy.
ParameterTypeDescription
proposedSizeSize
constructor
Creates and initializes a new ibm_ilog.diagram.gfxlayout.Layout instance. args : Object : a mixin set of parameters.
ParameterTypeDescription
args
doLayout
Applies this layout to the associated container.
ParameterTypeDescription
contBoundsRect
getConfig
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).
inLayout
Indicates whether this layout is in a layout session.
invalidate

This method post a layout request to the layout engine.

layoutChildren
Lays out the children of the associated container.
ParameterTypeDescription
contBoundsSize
placeChildInSlot

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)

ParameterTypeDescription
shapedojox.gfx.Shape
slotBoundsdojox.gfx.Rectangle
hAlignBoolean: indicates whether the shape must be aligned horizontally according to the value of its halign property.
vAlignBoolean: indicates whether the shape must be aligned vertically according to the value of its valign property.
setGap
Sets the items gap.
ParameterTypeDescription
valueIntegerInteger: the gap between each items.
setHorizontal
Sets the stack orientation.
ParameterTypeDescription
valueBooleanBoolean: true for an horizontal layout, false otherwise.
setPadding

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.

ParameterTypeDescription
value

Events

onLayoutPropertyChanged

This method should be called by layout subclasses when a property change needs the layout to be refreshed.