本文整理汇总了PHP中Cell类的典型用法代码示例。如果您正苦于以下问题:PHP Cell类的具体用法?PHP Cell怎么用?PHP Cell使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Cell类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: equals
public function equals(Cell $dst)
{
if ($this == $dst) {
return true;
}
return $this->ch == $dst->getCh() && $this->fg == $dst->getFg() && $this->bg == $dst->getBg();
}
开发者ID:jaytaph,项目名称:TermBox,代码行数:7,代码来源:Cell.php
示例2: addCell
public function addCell(\Cell $cell)
{
if ($this->cellExists($cell->getX(), $cell->getY())) {
throw new \LogicException('tato bunka jiz na hraci plose existuje');
}
$this->cells[$cell->getX()][$cell->getY()] = $cell;
}
开发者ID:TomAtom,项目名称:gameoflife,代码行数:7,代码来源:Desk.php
示例3: draw
/**
* Draw HTML output
*/
function draw()
{
global $c, $sid;
echo '<td colspan="' . $this->cells . '"><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr>';
$widget = new Cell("clc", "", 1, $this->width, 40);
$widget->draw();
echo "</tr><tr>\n";
$widget = new Label("lbl", $this->headline, "headbox", 1);
$widget->draw();
echo "</tr><tr>\n";
$widget = new FormImage($c["docroot"] . "modules/stats/widgets/statsimage.php?sid={$sid}&diagram=" . $this->diagramType . "&width=" . $this->width . "&height=" . $this->height . "&spid=" . $this->spid, $this->width, $this->height, 1);
$widget->draw();
// Draw Legend...
echo "</tr><tr>\n";
$widget = new Cell("clc", "", 1, $this->width, 10);
$widget->draw();
$colors[0] = __RED;
$colors[1] = __BLUE;
$colors[2] = __YELLOW;
$colors[3] = __GREEN;
for ($i = 0; $i < count($this->legend); $i++) {
echo "</tr><tr><td>";
echo '<table width="100%" border="0" cellpadding="2" cellspacing="0"><tr>';
echo '<td width="10">' . ($i + 1) . '.</td>';
echo '<td width="11">';
echo '<table width="11" height="11" border="0" cellspacing="0" cellpadding="0"><tr><td style="background-color:' . $colors[$i] . ';">' . drawSpacer(11, 11) . '</td></tr></table>';
echo '</td>';
echo '<td>' . $this->legend[$i] . '</td>';
echo '</tr></table></td>';
}
echo "</tr></table></td>";
return $this->cells;
}
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:36,代码来源:statsdiagram.php
示例4: createStationTableRow
/**
@param $station<Station>
*/
function createStationTableRow($station, $marker_img, $class_name)
{
global $website;
$station_marker = $station->marker;
$station_name = $station_marker->name;
$marker_link = new MarkerLink($station_marker->getLat(), $station_marker->getLng(), new Image("images/{$marker_img}", 0));
#echo $marker_link->toString() . "<br/>";
$station_row = new Row($station_name, $class_name);
//$station_cell = new Cell(null, null, null, $marker_link);
#echo $station_cell->toString();
#$station_row->addCell($station_cell);
$station_row->addCell(new Cell(null, "stationMarkerLink", "text-align: center", $marker_link));
$station_row->addCell(new Cell("stationName", $station_name));
$lines_cell = new Cell("stationLines");
$lines = $station_marker->getLines();
foreach ($lines as $line) {
foreach ($line->getConnections() as $connection) {
if ($connection->type != "transfer") {
$line_img = $line->img;
$line_url = $website . $line->url;
$link = new Link("javascript:void(0);", new Image(null, null, "images/{$line_img}", $line->name, null, 20), "window.open('{$line_url}');");
//echo $link->toString();
$lines_cell->addData($link);
break;
}
}
}
$station_row->addCell($lines_cell);
#echo "<!--" . $station_row->toString() . "-->";
return $station_row;
}
开发者ID:abc2mit,项目名称:abc2mit.github.io,代码行数:34,代码来源:display_functions.php
示例5: testBorderSize
/**
* Test border size
*/
public function testBorderSize()
{
$object = new Cell();
$value = 120;
$expected = array($value, $value, $value, $value);
$object->setStyleValue('borderSize', $value);
$this->assertEquals($expected, $object->getBorderSize());
}
开发者ID:HaiLeader,项目名称:quizz,代码行数:11,代码来源:CellTest.php
示例6: testCellWithFourNighbours
public function testCellWithFourNighbours()
{
$cell = new Cell();
$cell->livingStatus(true);
$cell->addNighbours(4);
$newCell = $cell->nextGen();
$this->assertFalse($cell->isAlive(), 'This test is okay');
}
开发者ID:hemmerling,项目名称:codingdojo,代码行数:8,代码来源:myclassTest.php
示例7: view_row
function view_row()
{
echo "<tr>";
for ($i = 0; $i <= $this->end_array; $i++) {
$cell_table = new Cell($this->row_array[text][$i], $this->row_array[col][$i], $this->row_array[row][$i], $this->row_array[font][$i]);
$cell_table->view_cell();
}
echo "</tr>";
}
开发者ID:Sergikv,项目名称:delta,代码行数:9,代码来源:class-Row.php
示例8: bindValue
/**
* Bind value to a cell
*
* @param Cell $cell Cell to bind value to
* @param mixed $value Value to bind in cell
* @return boolean
*/
public function bindValue(Cell $cell, $value = null)
{
// sanitize UTF-8 strings
if (is_string($value)) {
$value = Shared_String::SanitizeUTF8($value);
}
// Set value explicit
$cell->setValueExplicit($value, Cell_DataType::dataTypeForValue($value));
// Done!
return true;
}
开发者ID:bestgoodz,项目名称:toko-baju,代码行数:18,代码来源:DefaultValueBinder.php
示例9: draw
/**
* Draw HTML output
*/
function draw()
{
global $c, $sid;
echo '<td colspan="' . $this->cells . '"><table width="600" border="0" cellpadding="0" cellspacing="0"><tr>';
$widget = new Cell("clc", "", 2, $this->width, 20);
$widget->draw();
echo "</tr><tr>\n";
$widget = new Label("lbl", '<br><h3>' . $this->headline . '</h3>', '', 2);
$widget->draw();
echo "</tr>\n";
echo $this->container;
echo "</tr></table></td>";
return $this->cells;
}
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:17,代码来源:statsclickpath.php
示例10: draw
/**
* Draw HTML output
*/
function draw()
{
global $c, $sid;
echo '<td colspan="' . $this->cells . '" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr>';
$widget = new Cell("clc", "", 4, $this->width, 20);
$widget->draw();
echo "</tr><tr>\n";
$widget = new Label("lbl", $this->headline, "stats_headline", 4);
$widget->draw();
echo "</tr>\n";
echo $this->container;
echo "</tr></table></td>";
return $this->cells;
}
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:17,代码来源:topitems.php
示例11: getNeighboursByCell
/**
* Calculates the neighbours of a given cell.
* @param Cell $cell The cell the neighbours should be calculated for.
* @return int Amount of neighbours.
*/
public function getNeighboursByCell(Cell $cell)
{
$y = $cell->getCoordY();
$x = $cell->getCoordX();
$neighbours = 0;
for ($nY = $y - 1; $nY <= $y + 1; $nY++) {
for ($nX = $x - 1; $nX <= $x + 1; $nX++) {
if ($this->getCellByCoords($nX, $nY) && !($nX == $x && $nY == $y)) {
if ($this->getCellByCoords($nX, $nY)->isAlive()) {
$neighbours++;
}
}
}
}
return $neighbours;
}
开发者ID:mspaeth,项目名称:GameOfLife,代码行数:21,代码来源:gamefield.php
示例12: createFromString
public static function createFromString($string)
{
$lines = explode('\\n', $string);
$rows = count($lines);
$cols = strlen($lines[0]);
$player = new Player($cols, $rows);
foreach ($lines as $y => $line) {
foreach (str_split($line) as $x => $char) {
if ($char == '*') {
$cell = new Cell();
$cell->setMature();
$player->university->setObjTo($x, $y, $cell);
}
}
}
return $player;
}
开发者ID:vlikin,项目名称:test_game_of_life,代码行数:17,代码来源:Player.php
示例13: __do_response_reply_count
function __do_response_reply_count($response)
{
global $config, $speak, $segment;
$e = File::E($response->path);
$replies = count(glob(COMMENT . DS . '*_*_' . Date::slug($response->id) . '.{txt,hold}', GLOB_NOSORT | GLOB_BRACE));
$t = Jot::icon('reply-all') . ' ' . $replies;
$tt = array('title' => $replies . ' ' . ($replies === 1 ? $speak->{$segment[0] . '_reply'} : $speak->{$segment[0] . '_replies'}));
echo ($e === 'hold' || $replies === 0 ? Cell::span($t, $tt) : Cell::a($config->manager->slug . '/' . $segment[0] . '?filter=parent%3A' . $response->id, $t, null, $tt)) . ' · ';
}
开发者ID:tovic,项目名称:comment-reply-plugin-for-mecha-cms,代码行数:9,代码来源:__launch.php
示例14: expand
/**
* Include specified cell
* @param Cell $cell
* @return Range
*/
public function expand(Cell $cell)
{
if ($cell->getRow() > $this->rowTo) {
$this->setRowTo($cell->getRow());
}
if ($cell->getCol() > $this->colTo) {
$this->setColTo($cell->getCol());
}
return $this;
}
开发者ID:maxakawizard,项目名称:xls-writer,代码行数:15,代码来源:Range.php
示例15: setNextStatesForDeathCellsInNeigbohrOfLiveCells
private function setNextStatesForDeathCellsInNeigbohrOfLiveCells()
{
$cells = $this->desk->getCells();
foreach ($cells as $cell) {
$x = $cell->getX();
$y = $cell->getY();
foreach ($this->desk->getNeigbohrsCoordinates($x, $y) as $coords) {
if (!$this->desk->cellExists($coords[0], $coords[1])) {
$countOfAliveNeighbors = $this->desk->getCountOfLiveCellsInNeigbohr($coords[0], $coords[1]);
$nextStateOfNonExistingCell = $this->rules->getNextState($countOfAliveNeighbors, false);
if ($nextStateOfNonExistingCell === true) {
$newLiveCell = new \Cell($coords[0], $coords[1], false);
$newLiveCell->setNextState($nextStateOfNonExistingCell);
$this->desk->addCell($newLiveCell);
}
}
}
}
}
开发者ID:TomAtom,项目名称:gameoflife,代码行数:19,代码来源:Game.php
示例16: draw
/**
* Draw HTML output
*/
function draw()
{
global $c, $sid, $lang;
echo '<td colspan="3"><table width="100%" border="0" cellpadding="3" cellspacing="0"><tr>';
$widget = new Cell("clc", "", 2, $this->width, 20);
$widget->draw();
echo "</tr><tr>\n";
echo '<td colspan="2"align="right"> </td>';
echo '<td align="right">';
$lbi = new Button("action", $lang->get("print", "print"), "navelement", "button", "window.open('" . $_SERVER['REQUEST_URI'] . "&print=1');");
$lbi->draw();
echo " ";
$lbi = new Button("action", $lang->get("refresh", "refresh"), "navelement", "button", "document.location.href = document.location.href;");
$lbi->draw();
retain("action", "");
retain("sid", $sid);
echo "</td></tr></table></td>";
return $this->cells;
}
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:22,代码来源:print_button.php
示例17: sieve
public static function sieve($input, $paramPredicate)
{
$x = $input->first();
$cell = new Cell($x, null);
$cell->cdr = function () use($input, $paramPredicate, $x) {
return Cell::sieve($input->rest()->filter(function ($n) use($paramPredicate, $x) {
return $paramPredicate($n, $x);
}), $paramPredicate);
};
return $cell;
}
开发者ID:possientis,项目名称:Prog,代码行数:11,代码来源:primes.php
示例18: countOfLiveNeigbohrs
/**
* @test
*/
public function countOfLiveNeigbohrs()
{
$cell = new \Cell(1, 1, true);
$this->object->addCell($cell);
$this->assertEquals(1, $this->object->getCountOfLiveCellsInNeigbohr(1, 2));
$this->assertEquals(1, $this->object->getCountOfLiveCellsInNeigbohr(1, 0));
$this->assertEquals(0, $this->object->getCountOfLiveCellsInNeigbohr(1, 1));
$this->assertEquals(1, $this->object->getCountOfLiveCellsInNeigbohr(2, 2));
$this->assertEquals(0, $this->object->getCountOfLiveCellsInNeigbohr(10, 10));
}
开发者ID:TomAtom,项目名称:gameoflife,代码行数:13,代码来源:DeskTest.php
示例19: draw
/**
* Draw HTML output
*/
function draw()
{
global $c, $sid, $lang;
echo '<form name="form1">';
echo '<td colspan="' . $this->cells . '"><table width="100%" border="0" cellpadding="3" cellspacing="0"><tr>';
$widget = new Cell("clc", "", 2, $this->width, 20);
$widget->draw();
echo "</tr><tr>\n";
$widget = new Label("lbl", $this->headline, "stats_headline", 2);
$widget->draw();
echo "</tr>\n";
echo "<tr><td colspan=\"" . $this->cells . "\" class=\"bcopy\">" . $lang->get("pta", "Select page to analyze:") . "</td></tr>";
echo "<tr>";
$this->sps->draw();
echo "<td> ";
$lbi = new LinkButton("action", $lang->get("go", "Go"), "navelement", "submit");
$lbi->draw();
retain("action", "");
retain("sid", $sid);
echo "</td></tr></table></td>";
echo "</form>";
return $this->cells;
}
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:26,代码来源:page_selector.php
示例20: parseRow
/**
* Parse row
* @return array
*/
protected function parseRow()
{
$content = [];
if ($this->reader->hasHeader) {
$this->initHeader();
}
$cells = $this->row->getCellIterator();
$i = 0;
foreach ($cells as $this->cell) {
$header = $this->reader->hasHeader ? $this->header[$i] : $i;
if ($this->needParsed($header, $i)) {
$content[$header] = $this->cell->getValue();
}
$i++;
}
return $content;
}
开发者ID:forehalo,项目名称:excel-worker,代码行数:21,代码来源:ExcelWorkerParser.php
注:本文中的Cell类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论