EPS Relation Schema: missing lines fix

This commit is contained in:
Adnan
2010-08-20 11:09:37 +05:00
parent 27fe8e4658
commit 75623e5066

View File

@@ -191,10 +191,10 @@ class PMA_EPS
{ {
$this->stringCommands .= $lineWidth . " setlinewidth \n"; $this->stringCommands .= $lineWidth . " setlinewidth \n";
$this->stringCommands .= "newpath \n"; $this->stringCommands .= "newpath \n";
$this->stringCommands .= $x_from . ' ' . $y_from . " moveto \n"; $this->stringCommands .= $x_from . " " . $y_from . " moveto \n";
$this->stringCommands .= $x_to . ' ' . $y_from . " lineto \n"; $this->stringCommands .= "0 " . $y_to . " rlineto \n";
$this->stringCommands .= $x_to . ' ' . $y_to . " lineto \n"; $this->stringCommands .= $x_to . " 0 rlineto \n";
$this->stringCommands .= $x_from . " " . $y_to . " lineto \n"; $this->stringCommands .= "0 -" . $y_to . " rlineto \n";
$this->stringCommands .= "closepath \n"; $this->stringCommands .= "closepath \n";
$this->stringCommands .= "stroke \n"; $this->stringCommands .= "stroke \n";
} }
@@ -524,10 +524,10 @@ class Table_Stats
{ {
global $eps; global $eps;
//echo $this->_tableName.'<br />'; //echo $this->_tableName.'<br />';
//$eps->rect($this->x,$this->y, $eps->rect($this->x,$this->y + 12,
//$this->width,$this->heightCell, $this->width,$this->heightCell,
//2 1
// ); );
$eps->showXY($this->_getTitle(),$this->x + 5,$this->y + 14); $eps->showXY($this->_getTitle(),$this->x + 5,$this->y + 14);
foreach ($this->fields as $field) { foreach ($this->fields as $field) {
$this->currentCell += $this->heightCell; $this->currentCell += $this->heightCell;
@@ -540,8 +540,8 @@ class Table_Stats
$showColor = 'none'; $showColor = 'none';
} }
} }
//$eps->rect($this->x,$this->y + $this->currentCell, $eps->rect($this->x,$this->y + 12 + $this->currentCell,
//$this->width, $this->heightCell,2); $this->width, $this->heightCell,1);
$eps->showXY($field, $this->x + 5, $this->y + 14 + $this->currentCell); $eps->showXY($field, $this->x + 5, $this->y + 14 + $this->currentCell);
} }
} }
@@ -622,8 +622,8 @@ class Relation_Stats
$this->xDest = $dest_pos[1]; $this->xDest = $dest_pos[1];
$this->destDir = 1; $this->destDir = 1;
} }
$this->ySrc = $src_pos[2]; $this->ySrc = $src_pos[2] + 10;
$this->yDest = $dest_pos[2]; $this->yDest = $dest_pos[2] + 10;
} }
/** /**
@@ -669,15 +669,17 @@ class Relation_Stats
} else { } else {
$color = 'black'; $color = 'black';
} }
// draw a line like -- to foreign field
$eps->line($this->xSrc,$this->ySrc, $eps->line($this->xSrc,$this->ySrc,
$this->xSrc + $this->srcDir * $this->wTick,$this->ySrc, $this->xSrc + $this->srcDir * $this->wTick,$this->ySrc,
1 1
); );
// draw a line like -- to master field
$eps->line($this->xDest + $this->destDir * $this->wTick, $this->yDest, $eps->line($this->xDest + $this->destDir * $this->wTick, $this->yDest,
$this->xDest, $this->yDest, $this->xDest, $this->yDest,
1 1
); );
// draw a line that connects to master field line and foreign field line
$eps->line($this->xSrc + $this->srcDir * $this->wTick,$this->ySrc, $eps->line($this->xSrc + $this->srcDir * $this->wTick,$this->ySrc,
$this->xDest + $this->destDir * $this->wTick, $this->yDest, $this->xDest + $this->destDir * $this->wTick, $this->yDest,
1 1
@@ -769,7 +771,6 @@ class PMA_Eps_Relation_Schema extends PMA_Export_Relation_Schema
if ($this->sameWide) { if ($this->sameWide) {
$this->tables[$table]->width = $this->_tablewidth; $this->tables[$table]->width = $this->_tablewidth;
} }
$this->_setMinMax($this->tables[$table]);
} }
$seen_a_relation = false; $seen_a_relation = false;
@@ -799,21 +800,6 @@ class PMA_Eps_Relation_Schema extends PMA_Export_Relation_Schema
exit(); exit();
} }
/**
* Sets X and Y minimum and maximum for a table cell
*
* @param string table The table name
* @return void
* @access private
*/
private function _setMinMax($table)
{
$this->_xMax = max($this->_xMax, $table->x + $table->width);
$this->_yMax = max($this->_yMax, $table->y + $table->height);
$this->_xMin = min($this->_xMin, $table->x);
$this->_yMin = min($this->_yMin, $table->y);
}
/** /**
* Defines relation objects * Defines relation objects
* *
@@ -830,11 +816,9 @@ class PMA_Eps_Relation_Schema extends PMA_Export_Relation_Schema
{ {
if (!isset($this->tables[$masterTable])) { if (!isset($this->tables[$masterTable])) {
$this->tables[$masterTable] = new Table_Stats($masterTable, $font, $fontSize, $this->pageNumber, $this->_tablewidth, false, $showInfo); $this->tables[$masterTable] = new Table_Stats($masterTable, $font, $fontSize, $this->pageNumber, $this->_tablewidth, false, $showInfo);
$this->_setMinMax($this->tables[$masterTable]);
} }
if (!isset($this->tables[$foreignTable])) { if (!isset($this->tables[$foreignTable])) {
$this->tables[$foreignTable] = new Table_Stats($foreignTable,$font,$fontSize,$this->pageNumber, $this->_tablewidth, false, $showInfo); $this->tables[$foreignTable] = new Table_Stats($foreignTable,$font,$fontSize,$this->pageNumber, $this->_tablewidth, false, $showInfo);
$this->_setMinMax($this->tables[$foreignTable]);
} }
$this->_relations[] = new Relation_Stats($this->tables[$masterTable], $masterField, $this->tables[$foreignTable], $foreignField); $this->_relations[] = new Relation_Stats($this->tables[$masterTable], $masterField, $this->tables[$foreignTable], $foreignField);
} }