API Reference 0.7.1rikulo_layoutSideInfo

SideInfo class

The side information specified in layout.

Format: #n1 [#n2 [#n3 #n4]]

class SideInfo {
 int top, bottom, left, right;

 SideInfo(String profile, [int defaultValue, SideInfo defaultInfo]) {
   if (profile != null && !profile.isEmpty) {
     List<int> wds = [];
     for (final Match m in _reNum.allMatches(profile)) {
       wds.add(int.parse(m.group(0)));
     }

     switch (wds.length) {
       case 0:
         break;
       case 1:
         top = bottom = left = right = wds[0];
         return;
       case 2:
         top = bottom = wds[0];
         left = right = wds[1];
         return;
       case 3:
         top = wds[0];
         left = right = wds[1];
         bottom = wds[2];
         return;
       default:
         top = wds[0];
         right = wds[1];
         bottom = wds[2];
         left = wds[3];
         return;
     }
   }
   if (defaultInfo != null) {
     top = defaultInfo.top;
     bottom = defaultInfo.bottom;
     left = defaultInfo.left;
     right = defaultInfo.right;
   } else if (defaultValue != null) {
     top = bottom = left = right = defaultValue;
   }
 }

 String toString() {
   return "($left,$top,$right,$bottom)";
 }
}

Constructors

new SideInfo(String profile, [int defaultValue, SideInfo defaultInfo]) #

Creates a new Object instance.

Object instances have no meaningful state, and are only useful through their identity. An Object instance is equal to itself only.

docs inherited from Object
SideInfo(String profile, [int defaultValue, SideInfo defaultInfo]) {
 if (profile != null && !profile.isEmpty) {
   List<int> wds = [];
   for (final Match m in _reNum.allMatches(profile)) {
     wds.add(int.parse(m.group(0)));
   }

   switch (wds.length) {
     case 0:
       break;
     case 1:
       top = bottom = left = right = wds[0];
       return;
     case 2:
       top = bottom = wds[0];
       left = right = wds[1];
       return;
     case 3:
       top = wds[0];
       left = right = wds[1];
       bottom = wds[2];
       return;
     default:
       top = wds[0];
       right = wds[1];
       bottom = wds[2];
       left = wds[3];
       return;
   }
 }
 if (defaultInfo != null) {
   top = defaultInfo.top;
   bottom = defaultInfo.bottom;
   left = defaultInfo.left;
   right = defaultInfo.right;
 } else if (defaultValue != null) {
   top = bottom = left = right = defaultValue;
 }
}

Properties

int bottom #

int top, bottom

int left #

int top, bottom, left
int top, bottom, left, right

int top #

int top

Methods

String toString() #

Returns a string representation of this object.

docs inherited from Object
String toString() {
 return "($left,$top,$right,$bottom)";
}