-------------------------------------------------------------------------
500614
private void paint(Object parent, String name, Point point, GraphicsContext graphics) {
		if (!point.isEmpty()) {
			paint(parent, name + ".coordinate0", point.getCoordinate(), graphics);
		}
	}
670056
public function init()
    {
        parent::init();

        if (is_array($this->pager) && !ArrayHelper::keyExists('class', $this->pager)) {
            $this->pager = [
                'class' => LinkPager::class,
            ];
        }
    }
1104178
private function checkDefinitions(): void {
    // Add many to many stuff if necessary
    foreach($this->unchecked as $def) {
      foreach($def->many_to_many as $relation) {
        //echo "Processing many to many for {$def->name}\n";

        // Set up left keys
        $related = $this->defs[$relation->entity_left];

        if(empty($relation->id_left)) {
          //echo "Setting {$relation->alias_join} id_left to {$related->id->alias}\n";
          $relation->idLeft($related->id->alias);
        }

        if(empty($relation->key_left)) {
          //echo "Setting {$relation->alias_join} key_left to " . keyify($related->name) . "\n";
          $relation->keyLeft(keyify($related->name));
        }
        //

        // Set up right keys
        $related = $this->defs[$relation->entity_right];

        if(empty($relation->id_right)) {
          //echo "Setting {$relation->alias_join} id_right to {$related->id->alias}\n";
          $relation->idRight($related->id->alias);
        }

        if(empty($relation->key_right)) {
          //echo "Setting {$relation->alias_join} key_right to " . keyify($related->name) . "\n";
          $relation->keyRight(keyify($related->name));
        }
        //

        // Left side relations
        $related = $this->defs[$relation->entity_left];

        //echo "Adding {$related->name} hasManyThrough {$relation->alias_join} to {$relation->alias_right}\n";
        $related->hasManyThrough(pluralize($relation->alias_right), $relation->entity_join, $relation->entity_right)
          ->idLocal($relation->id_left)
          ->idForeign($relation->id_right)
          ->keyLocal($relation->key_left)
          ->keyForeign($relation->key_right)
        ;

        if(!array_key_exists($relation->alias_join, $def->has_many)) {
          //echo "Adding {$related->name} hasMany {$def->name}\n";
          $related->hasMany($relation->alias_join, $def->full_name)
            ->localKey  ($relation->id_left)
            ->foreignKey($relation->key_left)
          ;
        }

        if(!array_key_exists($relation->alias_left, $def->belongs_to)) {
          //echo "Adding {$def->name} belongsTo {$related->name}\n";
          $def->belongsTo($relation->alias_left, $related->full_name);
        }
        //

        // Right side relations
        $related = $this->defs[$relation->entity_right];

        //echo "Adding {$related->name} hasManyThrough {$relation->alias_join} to {$relation->alias_left}\n";
        $related->hasManyThrough(pluralize($relation->alias_left), $relation->entity_join, $relation->entity_left)
          ->idLocal($relation->id_right)
          ->idForeign($relation->id_left)
          ->keyLocal($relation->key_right)
          ->keyForeign($relation->key_left)
        ;

        if(!array_key_exists($relation->alias_join, $def->has_many)) {
          //echo "Adding {$related->name} hasMany {$def->name}\n";
          $related->hasMany($relation->alias_join, $def->full_name)
            ->localKey  ($relation->id_right)
            ->foreignKey($relation->key_right)
          ;
        }

        if(!array_key_exists($relation->alias_right, $def->belongs_to)) {
          //echo "Adding {$def->name} belongsTo {$related->name}\n";
          $def->belongsTo($relation->alias_right, $related->full_name);
        }
        //
      }
    }

    // Add has many stuff if necessary
    foreach($this->unchecked as $def) {
      foreach($def->has_many as $relation) {
        //echo "Processing has many for {$def->name}\n";

        $related = $this->defs[$relation->foreign_entity];

        if(empty($relation->local_key)) {
          //echo "Setting {$relation->alias} local_key to {$def->id->alias}\n";
          $relation->localKey($def->id->alias);
        }

        if(empty($relation->foreign_key)) {
          //echo "Setting {$relation->alias} foreign_key to " . keyify($related->name) . "\n";
          $relation->foreignKey(keyify($related->name));
        }
      }
    }

    // Add belongs to stuff if necessary
    foreach($this->unchecked as $def) {
      foreach($def->belongs_to as $relation) {
        //echo "Processing belongs to for {$def->name}\n";

        $related = $this->defs[$relation->foreign_entity];

        if(empty($relation->local_key)) {
          //echo "Setting {$relation->alias} local_key to " . keyify($related->name) . "\n";
          $relation->localKey(keyify($related->name));
        }

        if(empty($relation->foreign_key)) {
          //echo "Setting {$relation->alias} foreign_key to {$def->id->alias}\n";
          $relation->foreignKey($related->id->alias);
        }

        if(!array_key_exists($relation->local_key, $related->required)) {
          //echo "Adding {$def->name} column {$relation->local_key} of type {$related->id->type}\n";
          $def->required($relation->local_key, $related->id->type);
        }
      }
    }

    // We've checked everything in the queue.  Clear it out.
    $this->unchecked = [];
  }
138043
private void calcOffsets()
    {
        //Find the longest line
        int rowidx[] = new int[rows.size()];
        int maxCells = 0;
        for (int r = 0; r < rows.size(); r++)
        {
            int count = rows.elementAt(r).getCellCount();
            if (count > maxCells) maxCells = count;
            rowidx[r] = 0;
            rows.elementAt(r).rewind();
        }
        
        //determine the cell positions
        int col = 0;
        boolean cell_found = true;
        while (cell_found)
        {
            cell_found = false;
            int r = 0;
            while (r < rows.size())
            {
                TableRowBox row = rows.elementAt(r);
                if (row.hasNext())
                {
                    cell_found = true;
                    if (rowidx[r] <= col) //we are not in the middle of some colspan for this row
                    {
                        //get the current element
                        TableCellBox cell = row.next();
                        //set the new position
                        cell.setCellPosition(rowidx[r], r);
                        //move the row indices
                        for (int nr = r; nr < r + cell.getRowspan(); nr++)
                        {
                            if (nr < rows.size())
                            {
                                rowidx[nr] += cell.getColspan();
                                if (rowidx[nr] > numCols) numCols = rowidx[nr]; 
                            }
                            else
                                cell.rowspan--;
                        }
                        r += cell.getRowspan();
                    }
                    else
                        r++;
                }
                else
                    r++;
            }
            col++;
        }    
        //build the cell array
        for (int i = 0; i < rows.size(); i++)
            rows.elementAt(i).rewind();
        cells = new TableCellBox[numCols][rows.size()];
        for (int c = 0; c < maxCells; c++)
        {
            for (int r = 0; r < rows.size(); r++)
            {
                TableRowBox row = rows.elementAt(r);
                if (row.hasNext())
                {
                    TableCellBox cell = row.next();
                    if (cell.getRow() + cell.getRowspan() > rows.size())
                        cell.setRowspan(rows.size() - cell.getRow());
                    if (cell.getColumn() + cell.getColspan() > numCols)
                        cell.setColspan(numCols - cell.getColumn());
                    
                    int endrow = cell.getRow() + cell.getRowspan();
                    int endcol = cell.getColumn() + cell.getColspan();
                    //add it to the mesh
                    for (int nr = cell.getRow(); nr < endrow; nr++)
                        for (int nc = cell.getColumn(); nc < endcol; nc++)
                            cells[nc][nr] = cell;
                }
            }
        }
    }
1058597
function () {
        while (this.head !== null) {
            var temp = this.head;
            this.head = this.head.next();   // use next() the instead of "_next", otherwise it will loop forever
            temp._list = null;
            temp._next = null;
            temp._prev = null;
        }

        this.head = null;
        this.size = 0;
    }
379123
public function initialize()
    {
        $this->initializeConnections();
        $this->_table and $this->setSource($this->_table);
        $this->keepSnapshots(true);
    }
807856
public function init()
    {
        parent::init();

        $this->configs = array_replace_recursive($this->configs, ['dataProvider' => $this->dataProvider]);
        $this->configs = array_replace_recursive($this->configs, ['columns' => $this->columns]);
        $this->configs = array_replace_recursive($this->configs, ['dataProvider' => $this->dataProvider]);
        $this->configs = array_replace_recursive($this->configs, ['filterModel' => $this->filterModel]);
        $this->configs = array_replace_recursive($this->configs, ['filterModel' => $this->pjax]);

        if ('' != $this->id) {
            $this->configs = array_replace_recursive($this->configs, ['id' => $this->id]);
        }

        GridViewAsset::register($this->getView());
    }
289324
public function initialize()
    {
        $this->where  = new WhereClause($this);
        $this->order  = new OrderClause($this);
        $this->limit  = new LimitClause($this);
        $this->joins  = new JoinClause($this);
    }
1293703
public function initialize() {
        parent::initialize();

        $this->addClauses([
            self::DISTINCT_ON   => 'DISTINCT ON (%s)',
            self::JOIN_STRAIGHT => 'INNER JOIN %s ON %s',
            self::MATCH         => '%s',
            self::NOT_REGEXP    => '%s !~* ?',
            self::RETURNING     => 'RETURNING %s',
            self::REGEXP        => '%s ~* ?',
            self::RLIKE         => '%s ~* ?',
            self::UNIQUE_KEY    => 'UNIQUE (%2$s)',
            self::WITH          => '%s'
        ]);

        $this->addKeywords([
            self::CONCURRENTLY      => 'CONCURRENTLY',
            self::CONTINUE_IDENTITY => 'CONTINUE IDENTITY',
            self::DELETE_ROWS       => 'DELETE ROWS',
            self::DROP              => 'DROP',
            self::FOR_SHARE_LOCK    => 'FOR SHARE',
            self::FOR_UPDATE_LOCK   => 'FOR UPDATE',
            self::INHERITS          => 'INHERITS',
            self::IS_GLOBAL         => 'GLOBAL',
            self::LOCAL             => 'LOCAL',
            self::MATCH_FULL        => 'MATCH FULL',
            self::MATCH_PARTIAL     => 'MATCH PARTIAL',
            self::MATCH_SIMPLE      => 'MATCH SIMPLE',
            self::ON_COMMIT         => 'ON COMMIT',
            self::ONLY              => 'ONLY',
            self::PRESERVE_ROWS     => 'PRESERVE ROWS',
            self::RESTART_IDENTITY  => 'RESTART IDENTITY',
            self::SET_DEFAULT       => 'SET DEFAULT',
            self::TABLESPACE        => 'TABLESPACE',
            self::UNIQUE            => 'UNIQUE',
            self::UNLOGGED          => 'UNLOGGED',
            self::WITH_OIDS         => 'WITH OIDS',
            self::WITHOUT_OIDS      => 'WITHOUT OIDS'
        ]);

        $this->addStatements([
            Query::INSERT        => new Statement('INSERT INTO {table} {fields} VALUES {values}'),
            Query::SELECT        => new Statement('SELECT {distinct} {fields} FROM {table} {joins} {where} {groupBy} {having} {compounds} {orderBy} {limit} {lock}'),
            Query::UPDATE        => new Statement('UPDATE {only} {table} SET {fields} {where}'),
            Query::DELETE        => new Statement('DELETE FROM {only} {table} {joins} {where}'),
            Query::TRUNCATE      => new Statement('TRUNCATE {only} {table} {identity} {action}'),
            Query::CREATE_TABLE  => new Statement("CREATE {type} {temporary} {unlogged} TABLE IF NOT EXISTS {table} (\n{columns}{keys}\n) {options}"),
            Query::CREATE_INDEX  => new Statement('CREATE {type} INDEX {concurrently} {index} ON {table} ({fields})'),
            Query::DROP_TABLE    => new Statement('DROP TABLE IF EXISTS {table} {action}'),
            Query::DROP_INDEX    => new Statement('DROP INDEX {concurrently} IF EXISTS {index} {action}')
        ]);
    }
1123840
public function init()
    {
        parent::init();
        $this->db = Instance::ensure($this->db, Connection::className());
        if ($this->cache !== null) {
            $this->cache = Instance::ensure($this->cache, Cache::className());
        }
    }
245242
private function init()
    {
        /** @var $genericDevice \Wurfl\Device\ModelDeviceInterface */
        $genericDevice = $this->getDevice(WurflConstants::GENERIC);

        if (!is_null($genericDevice)) {
            $this->capabilitiesName       = array_keys($genericDevice->getCapabilities());
            $this->groupIDCapabilitiesMap = $genericDevice->getGroupIdCapabilitiesNameMap();
        }
    }
1174745
public function onBeforeWrite()
    {
        if (!$this->isInDB()) {
            $this->CreatorID = Member::currentUserID();
        }

        if (!$this->VersionNumber) {
            $versions = DataObject::get(
                'FileVersion', sprintf('"FileID" = %d', $this->FileID)
            );

            if ($versions) {
                $this->VersionNumber = $versions->Count() + 1;
            } else {
                $this->VersionNumber = 1;
            }
        }

        if (!$this->Filename) {
            $this->Filename = $this->saveCurrentVersion();
        }

        parent::onBeforeWrite();
    }
836456
public function init()
    {
        parent::init();
        if (!isset($this->translations['yii']) && !isset($this->translations['yii*'])) {
            $this->translations['yii'] = [
                '__class' => PhpMessageSource::class,
                'sourceLanguage' => 'en-US',
                'basePath' => '@yii/messages',
            ];
        }

        if (!isset($this->translations['app']) && !isset($this->translations['app*'])) {
            $this->translations['app'] = [
                '__class' => PhpMessageSource::class,
                'sourceLanguage' => $this->app->sourceLanguage,
                'basePath' => '@app/messages',
            ];
        }
    }
536938
public function initialize()
    {

        $this->length = null;
        $this->life = null;
        $this->autoApprove = false;
        $this->expires = null;

    }
168113
@Override
  public void aggregate()
  {
    final IndexedInts keys = keySelector.getRow();
    for (int i = 0; i < valueSelectors.length; i++) {
      values[i] = valueSelectors[i].getDouble();
    }
    synchronized (this) {
      for (int i = 0, keysSize = keys.size(); i < keysSize; i++) {
        final String key = keySelector.lookupName(keys.get(i));
        sketch.update(key, values);
      }
    }
  }
1142015
public function init()
    {
        parent::init();

        if (!$this->our_field) {
            $this->our_field = $this->link;
        }

        if (!$this->owner->hasField($this->our_field)) {
            $this->owner->addField($this->our_field, [
                'type'              => $this->type,
                'reference'         => $this,
                'system'            => $this->system,
                'join'              => $this->join,
                'default'           => $this->default,
                'never_persist'     => $this->never_persist,
                'read_only'         => $this->read_only,
                'caption'           => $this->caption,
                'ui'                => $this->ui,
                'mandatory'         => $this->mandatory,
                'required'          => $this->required,
                'typecast'          => $this->typecast,
                'serialize'         => $this->serialize,
                'persist_format'    => $this->persist_format,
                'persist_timezone'  => $this->persist_timezone,
                'dateTimeClass'     => $this->dateTimeClass,
                'dateTimeZoneClass' => $this->dateTimeZoneClass,
            ]);
        }
    }
98103
protected function onInit()
    {
        $this->groupColumns = $this->parseGroups(Utility::get($this->params, "by"));
        $this->sumColumns = $this->parseGroups(Utility::get($this->params, "sum"));
        $this->countColumns = $this->parseGroups(Utility::get($this->params, "count"));
        $this->avgColumns = $this->parseGroups(Utility::get($this->params, "avg"));
        $this->minColumns = $this->parseGroups(Utility::get($this->params, "min"));
        $this->maxColumns = $this->parseGroups(Utility::get($this->params, "max"));

        $this->sort = Utility::get($this->params, "sort", true);
        $this->gData = array();
        $this->cData = array();
    }