Lines Matching refs:Density
734 * @param {Mosaic.Density=} opt_maxDensity Layout density.
739 this.maxDensity_ = opt_maxDensity || Mosaic.Density.createHighest();
790 this.density_ = Mosaic.Density.createLowest();
865 // It starts with the lowest density and increases it until the layout
866 // fits into the viewport. If it does not fit even at the highest density,
867 // the layout continues with the highest density.
871 // It starts with the current global density and decreases it until the column
910 // Max density reached, commit if tentative, just continue if dry run.
916 // Rollback the entire layout, retry with higher density.
1150 * Representation of the layout density.
1152 * @param {number} horizontal Horizontal density, number tiles per row.
1153 * @param {number} vertical Vertical density, frequency of rows forced to
1157 Mosaic.Density = function(horizontal, vertical) {
1163 * Minimal horizontal density (tiles per row).
1165 Mosaic.Density.MIN_HORIZONTAL = 1;
1168 * Minimal horizontal density (tiles per row).
1170 Mosaic.Density.MAX_HORIZONTAL = 3;
1173 * Minimal vertical density: force 1 out of 2 rows to containt a single tile.
1175 Mosaic.Density.MIN_VERTICAL = 2;
1178 * Maximal vertical density: force 1 out of 3 rows to containt a single tile.
1180 Mosaic.Density.MAX_VERTICAL = 3;
1183 * @return {Mosaic.Density} Lowest density.
1185 Mosaic.Density.createLowest = function() {
1186 return new Mosaic.Density(
1187 Mosaic.Density.MIN_HORIZONTAL,
1188 Mosaic.Density.MIN_VERTICAL /* ignored when horizontal is at min */);
1192 * @return {Mosaic.Density} Highest density.
1194 Mosaic.Density.createHighest = function() {
1195 return new Mosaic.Density(
1196 Mosaic.Density.MAX_HORIZONTAL,
1197 Mosaic.Density.MAX_VERTICAL);
1201 * @return {Mosaic.Density} A clone of this density object.
1203 Mosaic.Density.prototype.clone = function() {
1204 return new Mosaic.Density(this.horizontal, this.vertical);
1208 * @param {Mosaic.Density} that The other object.
1211 Mosaic.Density.prototype.equals = function(that) {
1217 * Increases the density to the next level.
1219 Mosaic.Density.prototype.increase = function() {
1220 if (this.horizontal === Mosaic.Density.MIN_HORIZONTAL ||
1221 this.vertical === Mosaic.Density.MAX_VERTICAL) {
1222 console.assert(this.horizontal < Mosaic.Density.MAX_HORIZONTAL);
1224 this.vertical = Mosaic.Density.MIN_VERTICAL;
1231 * Decreases horizontal density.
1233 Mosaic.Density.prototype.decreaseHorizontal = function() {
1234 console.assert(this.horizontal > Mosaic.Density.MIN_HORIZONTAL);
1243 Mosaic.Density.prototype.isRowComplete = function(tileCount, rowIndex) {
1257 * @param {Mosaic.Density} density Layout density.
1261 density) {
1267 this.density_ = density;
1499 console.assert(this.getTileCount() < Mosaic.Density.MAX_HORIZONTAL);