Object layoutConstraint = null;
if (layoutDef instanceof SequenceLayoutDef)
{
if (((SequenceLayoutDef)layoutDef).getOrientation().content() != SequenceLayoutOrientation.STACKED)
{
SequenceLayoutConstraintDef def = (SequenceLayoutConstraintDef)childShapePresentation.getLayoutConstraint();
layoutConstraint = new SapphireSequenceLayoutConstraint(def);
}
else
{
SapphireStackLayoutConstraint constraint = null;
if (childShapePresentation.getLayoutConstraint() != null)
{
SequenceLayoutConstraintDef constraintDef =
(SequenceLayoutConstraintDef)childShapePresentation.getLayoutConstraint();
if (constraintDef != null)
{
constraint = new SapphireStackLayoutConstraint(
constraintDef.getHorizontalAlignment().content(),
constraintDef.getVerticalAlignment().content(),
constraintDef.getMarginTop().content(),
constraintDef.getMarginBottom().content(),
constraintDef.getMarginLeft().content(),
constraintDef.getMarginRight().content());
}
}
layoutConstraint = constraint != null ? constraint : new SapphireStackLayoutConstraint();
}
}