parseAlignment function

Alignment parseAlignment(
  1. MetaObject context,
  2. Alignment defaultvalue,
  3. TreeNode node,
  4. String property
)

Implementation

Alignment parseAlignment(MetaObject context,
    Alignment defaultvalue, TreeNode node, String property) {

  var str = parseObject(context, 'center', node, property);
  if (str == "topLeft") return Alignment.topLeft;
  if (str == "topCenter") return Alignment.topCenter;
  if (str == "topRight") return Alignment.topRight;
  if (str == "centerLeft") return Alignment.centerLeft;
  if (str == "center") return Alignment.center;
  if (str == "centerRight") return Alignment.centerRight;
  if (str == "bottomLeft") return Alignment.bottomLeft;
  if (str == "bottomCenter") return Alignment.bottomCenter;
  if (str == "bottomRight") return Alignment.bottomRight;
  return defaultvalue;
}