Sets the necessary height for all bands in the report, to hold their children
168816
protected void setBandsFinalHeight() {
        log.debug("Setting bands final height...");

        List<JRBand> bands = new ArrayList<JRBand>();

        Utils.addNotNull(bands, design.getPageHeader());
        Utils.addNotNull(bands, design.getPageFooter());
        Utils.addNotNull(bands, design.getColumnHeader());
        Utils.addNotNull(bands, design.getColumnFooter());
        Utils.addNotNull(bands, design.getSummary());
        Utils.addNotNull(bands, design.getBackground());
        bands.addAll(((JRDesignSection) design.getDetailSection()).getBandsList());
        Utils.addNotNull(bands, design.getLastPageFooter());
        Utils.addNotNull(bands, design.getTitle());
        Utils.addNotNull(bands, design.getPageFooter());
        Utils.addNotNull(bands, design.getNoData());

        for (JRGroup jrgroup : design.getGroupsList()) {
            DJGroup djGroup = (DJGroup) getReferencesMap().get(jrgroup.getName());
            JRDesignSection headerSection = (JRDesignSection) jrgroup.getGroupHeaderSection();
            JRDesignSection footerSection = (JRDesignSection) jrgroup.getGroupFooterSection();
            if (djGroup != null) {
                for (JRBand headerBand : headerSection.getBandsList()) {
                    setBandFinalHeight((JRDesignBand) headerBand, djGroup.getHeaderHeight(), djGroup.isFitHeaderHeightToContent());

                }
                for (JRBand footerBand : footerSection.getBandsList()) {
                    setBandFinalHeight((JRDesignBand) footerBand, djGroup.getFooterHeight(), djGroup.isFitFooterHeightToContent());

                }
            } else {
                bands.addAll(headerSection.getBandsList());
                bands.addAll(footerSection.getBandsList());
            }
        }

        for (JRBand jrDesignBand : bands) {
            setBandFinalHeight((JRDesignBand) jrDesignBand);
        }
    }
845942
def setMaximumHeight(self, height):
        
        super(XView, self).setMaximumHeight(height)
        
        if ( not self.signalsBlocked() ):
            self.sizeConstraintChanged.emit()
353783
public void setHeight(int height)
    {
        content.height = height - border.top - padding.top - padding.bottom - border.bottom;
        bounds.height = height;
        hset = true;
    }
587492
def setCheckedRecords(self, records, column=0, parent=None):
        
        if parent is None:
            for i in range(self.topLevelItemCount()):
                item = self.topLevelItem(i)
                try:
                    has_record = item.record() in records
                except AttributeError:
                    has_record = False
                
                if has_record:
                    item.setCheckState(column, Qt.Checked)
                
                self.setCheckedRecords(records, column, item)
        else:
            for c in range(parent.childCount()):
                item = parent.child(c)
                try:
                    has_record = item.record() in records
                except AttributeError:
                    has_record = False
                
                if has_record:
                    item.setCheckState(column, Qt.Checked)
                
                self.setCheckedRecords(records, column, item)
1186633
def set_size(params = {})
      @width    = params[:width]    if params[:width]
      @height   = params[:height]   if params[:height]
      @x_scale  = params[:x_scale]  if params[:x_scale]
      @y_scale  = params[:y_scale]  if params[:y_scale]
      @x_offset = params[:x_offset] if params[:x_offset]
      @y_offset = params[:y_offset] if params[:y_offset]
    end
621885
def adjustRange(self, recursive=True):
        
        if ( self.adjustmentsBlocked('range') ):
            return
        
        if ( self.itemStyle() == self.ItemStyle.Group ):
            dateStart = self.dateStart()
            dateEnd   = self.dateEnd()
            first     = True
            
            for c in range(self.childCount()):
                child       = self.child(c)
                
                if ( first ):
                    dateStart = child.dateStart()
                    dateEnd   = child.dateEnd()
                    first     = False
                else:
                    dateStart   = min(child.dateStart(), dateStart)
                    dateEnd     = max(child.dateEnd(), dateEnd)
            
            self._dateStart = dateStart
            self._dateEnd   = dateEnd
            
            self.sync()
        
        if ( self.parent() and recursive ):
            self.parent().adjustRange(True)
637625
def report_levels=(given)
      available = self.class.available_report_levels
      levels    = []

      given.each do |level|
        levels << available[level] if available[level]
      end

      if levels.empty?
        levels = default_report_levels
      end

      @report_levels = levels
    end
354012
def resize_children(self):
        """"""
        width = self.width - self.horizontal_padding
        height = self.height - self.vertical_padding

        for sprite, props in (get_props(sprite) for sprite in self.sprites if sprite.visible):
            sprite.alloc_w = width
            sprite.alloc_h = height

            w, h = getattr(sprite, "width", 0), getattr(sprite, "height", 0)
            if hasattr(sprite, "get_height_for_width_size"):
                w2, h2 = sprite.get_height_for_width_size()
                w, h = max(w, w2), max(h, h2)

            w = w * sprite.scale_x + props["margin_left"] + props["margin_right"]
            h = h * sprite.scale_y + props["margin_top"] + props["margin_bottom"]

            sprite.x = self.padding_left + props["margin_left"] + (max(sprite.alloc_w * sprite.scale_x, w) - w) * getattr(sprite, "x_align", 0)
            sprite.y = self.padding_top + props["margin_top"] + (max(sprite.alloc_h * sprite.scale_y, h) - h) * getattr(sprite, "y_align", 0)


        self.__dict__['_children_resize_queued'] = False
1032813
public void setChild(int idx, int alphabetSize, Node<I> child) {
        if (children == null) {
            children = new ResizingArrayStorage<>(Node.class, alphabetSize);
        }
        children.array[idx] = child;
    }
1108971
public function setup(): void
    {
        $this->rtl = I18N::direction() === 'rtl';

        $this->rkeywords = '';

        // I18N: This is a report footer. %s is the name of the application.
        $this->generated_by = I18N::translate('Generated by %s', Webtrees::NAME . ' ' . Webtrees::VERSION);

        // Paper size - defaults to A4 if the report fails to define a size.
        [$this->page_width, $this->page_height] = self::PAPER_SIZES[$this->page_format] ?? self::PAPER_SIZES['A4'];
    }
117155
private void setBandFinalHeight(JRDesignBand band, int currHeigth, boolean fitToContent) {
        if (band != null) {
            int finalHeight = LayoutUtils.findVerticalOffset(band);
            //noinspection StatementWithEmptyBody
            if (finalHeight < currHeigth && !fitToContent) {
                //nothing
            } else {
                band.setHeight(finalHeight);
            }
        }

    }
451190
def _divide_heigths(self, cli, write_position):
        
        if not self.children:
            return []

        # Calculate heights.
        given_dimensions = self.get_dimensions(cli) if self.get_dimensions else None

        def get_dimension_for_child(c, index):
            if given_dimensions and given_dimensions[index] is not None:
                return given_dimensions[index]
            else:
                return c.preferred_height(cli, write_position.width, write_position.extended_height)

        dimensions = [get_dimension_for_child(c, index) for index, c in enumerate(self.children)]

        # Sum dimensions
        sum_dimensions = sum_layout_dimensions(dimensions)

        # If there is not enough space for both.
        # Don't do anything.
        if sum_dimensions.min > write_position.extended_height:
            return

        # Find optimal sizes. (Start with minimal size, increase until we cover
        # the whole height.)
        sizes = [d.min for d in dimensions]

        child_generator = take_using_weights(
            items=list(range(len(dimensions))),
            weights=[d.weight for d in dimensions])

        i = next(child_generator)

        while sum(sizes) < min(write_position.extended_height, sum_dimensions.preferred):
            # Increase until we meet at least the 'preferred' size.
            if sizes[i] < dimensions[i].preferred:
                sizes[i] += 1
            i = next(child_generator)

        if not any([cli.is_returning, cli.is_exiting, cli.is_aborting]):
            while sum(sizes) < min(write_position.height, sum_dimensions.max):
                # Increase until we use all the available space. (or until "max")
                if sizes[i] < dimensions[i].max:
                    sizes[i] += 1
                i = next(child_generator)

        return sizes
25464
function(items, heightRatio) {
            if(!heightRatio) return;

            for(var i = 0; i < items.length; i++) {
                items[i].relativeHeight = heightRatio * (items[i].diffWithNextRelativePos ? items[i].diffWithNextRelativePos : 0);
            }
        }
141004
def place(self):
        """"""
        self.place_children()
        self.canvas.append(self.parent.canvas,
                           float(self.left), float(self.top))
533115
def _set_topMargin(self, value):
        
        bounds = self.bounds
        if bounds is None:
            self.height = value
        else:
            xMin, yMin, xMax, yMax = bounds
            self.height = yMax + value
96951
protected function setChildrenCategory()
    {
        $this->data_children = array();

        foreach ($this->data_categories as $item) {
            if (in_array($this->data_category['category_id'], $item['parents'])) {
                $this->data_children[] = $item;
            }
        }
    }
630766
protected void setWhenNoDataBand() {
        log.debug("setting up WHEN NO DATA band");
        String whenNoDataText = getReport().getWhenNoDataText();
        Style style = getReport().getWhenNoDataStyle();
        if (whenNoDataText == null || "".equals(whenNoDataText))
            return;
        JRDesignBand band = new JRDesignBand();
        getDesign().setNoData(band);

        JRDesignTextField text = new JRDesignTextField();
        JRDesignExpression expression = ExpressionUtils.createStringExpression("\"" + whenNoDataText + "\"");
        text.setExpression(expression);

        if (style == null) {
            style = getReport().getOptions().getDefaultDetailStyle();
        }

        if (getReport().isWhenNoDataShowTitle()) {
            LayoutUtils.copyBandElements(band, getDesign().getTitle());
            LayoutUtils.copyBandElements(band, getDesign().getPageHeader());
        }
        if (getReport().isWhenNoDataShowColumnHeader())
            LayoutUtils.copyBandElements(band, getDesign().getColumnHeader());

        int offset = LayoutUtils.findVerticalOffset(band);
        text.setY(offset);
        applyStyleToElement(style, text);
        text.setWidth(getReport().getOptions().getPrintableWidth());
        text.setHeight(50);
        band.addElement(text);
        log.debug("OK setting up WHEN NO DATA band");

    }