Lines Matching defs:lr

476         LayoutResult lr = createLayoutResult();
477 prepareForLayout(lr);
481 doLTRColumnLayout(lr, getLTRColumnAlignment());
483 doRTLColumnLayout(lr, getRTLColumnAlignment());
487 doLTRComplexLayout(lr, getLTRColumnAlignment());
489 doRTLComplexLayout(lr, getRTLColumnAlignment());
493 alignAccCheckAndArrowVertically(lr);
494 return lr;
516 protected void prepareForLayout(LayoutResult lr) {
517 lr.checkRect.width = checkSize.maxWidth;
518 lr.accRect.width = accSize.maxWidth;
519 lr.arrowRect.width = arrowSize.maxWidth;
526 private void alignAccCheckAndArrowVertically(LayoutResult lr) {
527 lr.accRect.y = (int)(lr.labelRect.y
528 + (float)lr.labelRect.height/2
529 - (float)lr.accRect.height/2);
530 fixVerticalAlignment(lr, lr.accRect);
532 lr.arrowRect.y = (int)(lr.labelRect.y
533 + (float)lr.labelRect.height/2
534 - (float)lr.arrowRect.height/2);
535 lr.checkRect.y = (int)(lr.labelRect.y
536 + (float)lr.labelRect.height/2
537 - (float)lr.checkRect.height/2);
538 fixVerticalAlignment(lr, lr.arrowRect);
539 fixVerticalAlignment(lr, lr.checkRect);
547 private void fixVerticalAlignment(LayoutResult lr, Rectangle r) {
555 lr.checkRect.y += delta;
556 lr.iconRect.y += delta;
557 lr.textRect.y += delta;
558 lr.accRect.y += delta;
559 lr.arrowRect.y += delta;
560 lr.labelRect.y += delta;
564 private void doLTRColumnLayout(LayoutResult lr, ColumnAlignment alignment) {
567 lr.iconRect.width = iconSize.maxWidth;
568 lr.textRect.width = textSize.maxWidth;
572 calcXPositionsLTR(viewRect.x, leadingGap, gap, lr.checkRect,
573 lr.iconRect, lr.textRect);
576 if (lr.checkRect.width > 0) { // there is the afterCheckIconGap
577 lr.iconRect.x += afterCheckIconGap - gap;
578 lr.textRect.x += afterCheckIconGap - gap;
582 lr.arrowRect, lr.accRect);
585 int textOffset = lr.textRect.x - viewRect.x;
587 lr.textRect.x += minTextOffset - textOffset;
590 alignRects(lr, alignment);
595 calcTextAndIconYPositions(lr);
598 lr.setLabelRect(lr.textRect.union(lr.iconRect));
601 private void doLTRComplexLayout(LayoutResult lr, ColumnAlignment alignment) {
602 lr.labelRect.width = labelSize.maxWidth;
605 calcXPositionsLTR(viewRect.x, leadingGap, gap, lr.checkRect,
606 lr.labelRect);
609 if (lr.checkRect.width > 0) { // there is the afterCheckIconGap
610 lr.labelRect.x += afterCheckIconGap - gap;
614 leadingGap, gap, lr.arrowRect, lr.accRect);
617 int labelOffset = lr.labelRect.x - viewRect.x;
619 lr.labelRect.x += minTextOffset - labelOffset;
622 alignRects(lr, alignment);
625 calcLabelYPosition(lr);
627 layoutIconAndTextInLabelRect(lr);
630 private void doRTLColumnLayout(LayoutResult lr, ColumnAlignment alignment) {
633 lr.iconRect.width = iconSize.maxWidth;
634 lr.textRect.width = textSize.maxWidth;
638 lr.checkRect, lr.iconRect, lr.textRect);
641 if (lr.checkRect.width > 0) { // there is the gap after check icon
642 lr.iconRect.x -= afterCheckIconGap - gap;
643 lr.textRect.x -= afterCheckIconGap - gap;
646 calcXPositionsLTR(viewRect.x, leadingGap, gap, lr.arrowRect,
647 lr.accRect);
651 - (lr.textRect.x + lr.textRect.width);
653 lr.textRect.x -= minTextOffset - textOffset;
656 alignRects(lr, alignment);
661 calcTextAndIconYPositions(lr);
664 lr.setLabelRect(lr.textRect.union(lr.iconRect));
667 private void doRTLComplexLayout(LayoutResult lr, ColumnAlignment alignment) {
668 lr.labelRect.width = labelSize.maxWidth;
672 lr.checkRect, lr.labelRect);
675 if (lr.checkRect.width > 0) { // there is the gap after check icon
676 lr.labelRect.x -= afterCheckIconGap - gap;
679 calcXPositionsLTR(viewRect.x, leadingGap, gap, lr.arrowRect, lr.accRect);
683 - (lr.labelRect.x + lr.labelRect.width);
685 lr.labelRect.x -= minTextOffset - labelOffset;
688 alignRects(lr, alignment);
691 calcLabelYPosition(lr);
693 layoutIconAndTextInLabelRect(lr);
696 private void alignRects(LayoutResult lr, ColumnAlignment alignment) {
697 alignRect(lr.checkRect, alignment.getCheckAlignment(),
699 alignRect(lr.iconRect, alignment.getIconAlignment(),
701 alignRect(lr.textRect, alignment.getTextAlignment(),
703 alignRect(lr.accRect, alignment.getAccAlignment(),
705 alignRect(lr.arrowRect, alignment.getArrowAlignment(),
716 protected void layoutIconAndTextInLabelRect(LayoutResult lr) {
717 lr.setTextRect(new Rectangle());
718 lr.setIconRect(new Rectangle());
721 verticalTextPosition, horizontalTextPosition, lr.labelRect,
722 lr.iconRect, lr.textRect, gap);
751 private void calcTextAndIconYPositions(LayoutResult lr) {
753 lr.textRect.y = (int)(viewRect.y
754 + (float)lr.labelRect.height/2
755 - (float)lr.textRect.height/2);
756 lr.iconRect.y = (int)(viewRect.y
757 + (float)lr.labelRect.height/2
758 - (float)lr.iconRect.height/2);
760 lr.textRect.y = (int)(viewRect.y
762 - (float)lr.textRect.height/2);
763 lr.iconRect.y = (int)(viewRect.y
765 - (float)lr.iconRect.height/2);
768 lr.textRect.y = (int)(viewRect.y
770 - (float)lr.labelRect.height/2
771 - (float)lr.textRect.height/2);
772 lr.iconRect.y = (int)(viewRect.y
774 - (float)lr.labelRect.height/2
775 - (float)lr.iconRect.height/2);
783 private void calcLabelYPosition(LayoutResult lr) {
785 lr.labelRect.y = viewRect.y;
787 lr.labelRect.y = (int)(viewRect.y
789 - (float)lr.labelRect.height/2);
791 lr.labelRect.y = viewRect.y + viewRect.height
792 - lr.labelRect.height;