Add OK and Cancel button for grid editing
[phpmyadmin/arisferyanto.git] / libraries / schema / Dia_Relation_Schema.class.php
blob89a54f9d706b43f1a0b507f924bbb600edb32f91
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @package PhpMyAdmin
6 */
8 require_once "Export_Relation_Schema.class.php";
10 /**
11 * This Class inherits the XMLwriter class and
12 * helps in developing structure of DIA Schema Export
14 * @access public
15 * @see http://php.net/manual/en/book.xmlwriter.php
17 class PMA_DIA extends XMLWriter
19 public $title;
20 public $author;
21 public $font;
22 public $fontSize;
24 /**
25 * The "PMA_DIA" constructor
27 * Upon instantiation This starts writing the Dia XML document
29 * @return void
30 * @see XMLWriter::openMemory(),XMLWriter::setIndent(),XMLWriter::startDocument()
32 function __construct()
34 $this->openMemory();
36 * Set indenting using three spaces,
37 * so output is formatted
40 $this->setIndent(true);
41 $this->setIndentString(' ');
43 * Create the XML document
46 $this->startDocument('1.0', 'UTF-8');
49 /**
50 * Starts Dia Document
52 * dia document starts by first initializing dia:diagram tag
53 * then dia:diagramdata contains all the attributes that needed
54 * to define the document, then finally a Layer starts which
55 * holds all the objects.
57 * @param string $paper the size of the paper/document
58 * @param float $topMargin top margin of the paper/document in cm
59 * @param float $bottomMargin bottom margin of the paper/document in cm
60 * @param float $leftMargin left margin of the paper/document in cm
61 * @param float $rightMargin right margin of the paper/document in cm
62 * @param string $portrait document will be portrait or landscape
64 * @return void
66 * @access public
67 * @see XMLWriter::startElement(),XMLWriter::writeAttribute(),XMLWriter::writeRaw()
69 function startDiaDoc($paper,$topMargin,$bottomMargin,$leftMargin,$rightMargin,$portrait)
71 if ($portrait == 'P') {
72 $isPortrait='true';
73 } else {
74 $isPortrait='false';
76 $this->startElement('dia:diagram');
77 $this->writeAttribute('xmlns:dia', 'http://www.lysator.liu.se/~alla/dia/');
78 $this->startElement('dia:diagramdata');
79 $this->writeRaw(
80 '<dia:attribute name="background">
81 <dia:color val="#ffffff"/>
82 </dia:attribute>
83 <dia:attribute name="pagebreak">
84 <dia:color val="#000099"/>
85 </dia:attribute>
86 <dia:attribute name="paper">
87 <dia:composite type="paper">
88 <dia:attribute name="name">
89 <dia:string>#' . $paper . '#</dia:string>
90 </dia:attribute>
91 <dia:attribute name="tmargin">
92 <dia:real val="' . $topMargin . '"/>
93 </dia:attribute>
94 <dia:attribute name="bmargin">
95 <dia:real val="' . $bottomMargin . '"/>
96 </dia:attribute>
97 <dia:attribute name="lmargin">
98 <dia:real val="' . $leftMargin . '"/>
99 </dia:attribute>
100 <dia:attribute name="rmargin">
101 <dia:real val="' . $rightMargin . '"/>
102 </dia:attribute>
103 <dia:attribute name="is_portrait">
104 <dia:boolean val="' . $isPortrait . '"/>
105 </dia:attribute>
106 <dia:attribute name="scaling">
107 <dia:real val="1"/>
108 </dia:attribute>
109 <dia:attribute name="fitto">
110 <dia:boolean val="false"/>
111 </dia:attribute>
112 </dia:composite>
113 </dia:attribute>
114 <dia:attribute name="grid">
115 <dia:composite type="grid">
116 <dia:attribute name="width_x">
117 <dia:real val="1"/>
118 </dia:attribute>
119 <dia:attribute name="width_y">
120 <dia:real val="1"/>
121 </dia:attribute>
122 <dia:attribute name="visible_x">
123 <dia:int val="1"/>
124 </dia:attribute>
125 <dia:attribute name="visible_y">
126 <dia:int val="1"/>
127 </dia:attribute>
128 <dia:composite type="color"/>
129 </dia:composite>
130 </dia:attribute>
131 <dia:attribute name="color">
132 <dia:color val="#d8e5e5"/>
133 </dia:attribute>
134 <dia:attribute name="guides">
135 <dia:composite type="guides">
136 <dia:attribute name="hguides"/>
137 <dia:attribute name="vguides"/>
138 </dia:composite>
139 </dia:attribute>');
140 $this->endElement();
141 $this->startElement('dia:layer');
142 $this->writeAttribute('name', 'Background');
143 $this->writeAttribute('visible', 'true');
144 $this->writeAttribute('active', 'true');
149 * Ends Dia Document
151 * @return void
152 * @access public
153 * @see XMLWriter::endElement(),XMLWriter::endDocument()
155 function endDiaDoc()
157 $this->endElement();
158 $this->endDocument();
162 * Output Dia Document for download
164 * @param string $fileName name of the dia document
166 * @return void
167 * @access public
168 * @see XMLWriter::flush()
170 function showOutput($fileName)
172 if (ob_get_clean()) {
173 ob_end_clean();
175 $output = $this->flush();
176 PMA_download_header(
177 $fileName . '.dia', 'application/x-dia-diagram', strlen($output)
179 print $output;
184 * Table preferences/statistics
186 * This class preserves the table co-ordinates,fields
187 * and helps in drawing/generating the Tables in dia XML document.
189 * @name Table_Stats
190 * @see PMA_DIA
192 class Table_Stats
195 * Defines properties
197 public $tableName;
198 public $fields = array();
199 public $x, $y;
200 public $primary = array();
201 public $tableId;
202 public $tableColor;
205 * The "Table_Stats" constructor
207 * @param string $tableName The table name
208 * @param integer $pageNumber The current page number (from the
209 * $cfg['Servers'][$i]['table_coords'] table)
210 * @param boolean $showKeys Whether to display ONLY keys or not
212 * @return void
214 * @global object The current dia document
215 * @global array The relations settings
216 * @global string The current db name
218 * @see PMA_DIA
220 function __construct($tableName, $pageNumber, $showKeys = false)
222 global $dia, $cfgRelation, $db;
224 $this->tableName = $tableName;
225 $sql = 'DESCRIBE ' . PMA_backquote($tableName);
226 $result = PMA_DBI_try_query($sql, null, PMA_DBI_QUERY_STORE);
227 if (!$result || !PMA_DBI_num_rows($result)) {
228 $dia->dieSchema(
229 $pageNumber, "DIA",
230 sprintf(__('The %s table doesn\'t exist!'), $tableName)
234 * load fields
235 * check to see if it will load all fields or only the foreign keys
237 if ($showKeys) {
238 $indexes = PMA_Index::getFromTable($this->tableName, $db);
239 $all_columns = array();
240 foreach ($indexes as $index) {
241 $all_columns = array_merge(
242 $all_columns,
243 array_flip(array_keys($index->getColumns()))
246 $this->fields = array_keys($all_columns);
247 } else {
248 while ($row = PMA_DBI_fetch_row($result)) {
249 $this->fields[] = $row[0];
253 $sql = 'SELECT x, y FROM '
254 . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.'
255 . PMA_backquote($cfgRelation['table_coords'])
256 . ' WHERE db_name = \'' . PMA_sqlAddSlashes($db) . '\''
257 . ' AND table_name = \'' . PMA_sqlAddSlashes($tableName) . '\''
258 . ' AND pdf_page_number = ' . $pageNumber;
259 $result = PMA_query_as_controluser($sql, false, PMA_DBI_QUERY_STORE);
260 if (! $result || ! PMA_DBI_num_rows($result)) {
261 $dia->dieSchema(
262 $pageNumber,
263 "DIA",
264 sprintf(
265 __('Please configure the coordinates for table %s'),
266 $tableName
270 list($this->x, $this->y) = PMA_DBI_fetch_row($result);
271 $this->x = (double) $this->x;
272 $this->y = (double) $this->y;
274 * displayfield
276 $this->displayfield = PMA_getDisplayField($db, $tableName);
278 * index
280 $result = PMA_DBI_query(
281 'SHOW INDEX FROM ' . PMA_backquote($tableName) . ';',
282 null,
283 PMA_DBI_QUERY_STORE
285 if (PMA_DBI_num_rows($result) > 0) {
286 while ($row = PMA_DBI_fetch_assoc($result)) {
287 if ($row['Key_name'] == 'PRIMARY') {
288 $this->primary[] = $row['Column_name'];
293 * Every object in Dia document needs an ID to identify
294 * so, we used a static variable to keep the things unique
296 PMA_Dia_Relation_Schema::$objectId += 1;
297 $this->tableId = PMA_Dia_Relation_Schema::$objectId;
301 * Do draw the table
303 * Tables are generated using object type Database - Table
304 * primary fields are underlined in tables. Dia object
305 * is used to generate the XML of Dia Document. Database Table
306 * Object and their attributes are involved in the combination
307 * of displaing Database - Table on Dia Document.
309 * @param boolean $changeColor Whether to show color for tables text or not
310 * if changeColor is true then an array of $listOfColors will be used to choose
311 * the random colors for tables text we can change/add more colors to this array
313 * @return void
315 * @global object The current Dia document
317 * @access public
318 * @see PMA_DIA
320 public function tableDraw($changeColor)
322 global $dia;
324 if ($changeColor) {
325 $listOfColors = array(
326 'FF0000',
327 '000099',
328 '00FF00'
330 shuffle($listOfColors);
331 $this->tableColor = '#' . $listOfColors[0] . '';
332 } else {
333 $this->tableColor = '#000000';
336 $factor = 0.1;
338 $dia->startElement('dia:object');
339 $dia->writeAttribute('type', 'Database - Table');
340 $dia->writeAttribute('version', '0');
341 $dia->writeAttribute('id', '' . $this->tableId . '');
342 $dia->writeRaw(
343 '<dia:attribute name="obj_pos">
344 <dia:point val="'
345 . ($this->x * $factor) . ',' . ($this->y * $factor) . '"/>
346 </dia:attribute>
347 <dia:attribute name="obj_bb">
348 <dia:rectangle val="'
349 .($this->x * $factor) . ',' . ($this->y * $factor) . ';9.97,9.2"/>
350 </dia:attribute>
351 <dia:attribute name="meta">
352 <dia:composite type="dict"/>
353 </dia:attribute>
354 <dia:attribute name="elem_corner">
355 <dia:point val="'
356 . ($this->x * $factor) . ',' . ($this->y * $factor) . '"/>
357 </dia:attribute>
358 <dia:attribute name="elem_width">
359 <dia:real val="5.9199999999999999"/>
360 </dia:attribute>
361 <dia:attribute name="elem_height">
362 <dia:real val="3.5"/>
363 </dia:attribute>
364 <dia:attribute name="text_colour">
365 <dia:color val="' . $this->tableColor . '"/>
366 </dia:attribute>
367 <dia:attribute name="line_colour">
368 <dia:color val="#000000"/>
369 </dia:attribute>
370 <dia:attribute name="fill_colour">
371 <dia:color val="#ffffff"/>
372 </dia:attribute>
373 <dia:attribute name="line_width">
374 <dia:real val="0.10000000000000001"/>
375 </dia:attribute>
376 <dia:attribute name="name">
377 <dia:string>#' . $this->tableName . '#</dia:string>
378 </dia:attribute>
379 <dia:attribute name="comment">
380 <dia:string>##</dia:string>
381 </dia:attribute>
382 <dia:attribute name="visible_comment">
383 <dia:boolean val="false"/>
384 </dia:attribute>
385 <dia:attribute name="tagging_comment">
386 <dia:boolean val="false"/>
387 </dia:attribute>
388 <dia:attribute name="underline_primary_key">
389 <dia:boolean val="true"/>
390 </dia:attribute>
391 <dia:attribute name="bold_primary_keys">
392 <dia:boolean val="true"/>
393 </dia:attribute>
394 <dia:attribute name="normal_font">
395 <dia:font family="monospace" style="0" name="Courier"/>
396 </dia:attribute>
397 <dia:attribute name="name_font">
398 <dia:font family="sans" style="80" name="Helvetica-Bold"/>
399 </dia:attribute>
400 <dia:attribute name="comment_font">
401 <dia:font family="sans" style="0" name="Helvetica"/>
402 </dia:attribute>
403 <dia:attribute name="normal_font_height">
404 <dia:real val="0.80000000000000004"/>
405 </dia:attribute>
406 <dia:attribute name="name_font_height">
407 <dia:real val="0.69999999999999996"/>
408 </dia:attribute>
409 <dia:attribute name="comment_font_height">
410 <dia:real val="0.69999999999999996"/>
411 </dia:attribute>'
414 $dia->startElement('dia:attribute');
415 $dia->writeAttribute('name', 'attributes');
417 foreach ($this->fields as $field) {
418 $dia->writeRaw(
419 '<dia:composite type="table_attribute">
420 <dia:attribute name="name">
421 <dia:string>#' . $field . '#</dia:string>
422 </dia:attribute>
423 <dia:attribute name="type">
424 <dia:string>##</dia:string>
425 </dia:attribute>
426 <dia:attribute name="comment">
427 <dia:string>##</dia:string>
428 </dia:attribute>'
430 unset($pm);
431 $pm = 'false';
432 if (in_array($field, $this->primary)) {
433 $pm = 'true';
435 if ($field == $this->displayfield) {
436 $pm = 'false';
438 $dia->writeRaw(
439 '<dia:attribute name="primary_key">
440 <dia:boolean val="' . $pm . '"/>
441 </dia:attribute>
442 <dia:attribute name="nullable">
443 <dia:boolean val="false"/>
444 </dia:attribute>
445 <dia:attribute name="unique">
446 <dia:boolean val="' . $pm . '"/>
447 </dia:attribute>
448 </dia:composite>'
451 $dia->endElement();
452 $dia->endElement();
457 * Relation preferences/statistics
459 * This class fetches the table master and foreign fields positions
460 * and helps in generating the Table references and then connects
461 * master table's master field to foreign table's foreign key
462 * in dia XML document.
464 * @name Relation_Stats
465 * @see PMA_DIA
467 class Relation_Stats
470 * Defines properties
472 public $srcConnPointsRight;
473 public $srcConnPointsLeft;
474 public $destConnPointsRight;
475 public $destConnPointsLeft;
476 public $masterTableId;
477 public $foreignTableId;
478 public $masterTablePos;
479 public $foreignTablePos;
480 public $referenceColor;
483 * The "Relation_Stats" constructor
485 * @param string $master_table The master table name
486 * @param string $master_field The relation field in the master table
487 * @param string $foreign_table The foreign table name
488 * @param string $foreign_field The relation field in the foreign table
490 * @return void
492 * @see Relation_Stats::_getXy
494 function __construct($master_table, $master_field, $foreign_table, $foreign_field)
496 $src_pos = $this->_getXy($master_table, $master_field);
497 $dest_pos = $this->_getXy($foreign_table, $foreign_field);
498 $this->srcConnPointsLeft = $src_pos[0];
499 $this->srcConnPointsRight = $src_pos[1];
500 $this->destConnPointsLeft = $dest_pos[0];
501 $this->destConnPointsRight = $dest_pos[1];
502 $this->masterTablePos = $src_pos[2];
503 $this->foreignTablePos = $dest_pos[2];
504 $this->masterTableId = $master_table->tableId;
505 $this->foreignTableId = $foreign_table->tableId;
509 * Each Table object have connection points
510 * which is used to connect to other objects in Dia
511 * we detect the position of key in fields and
512 * then determines its left and right connection
513 * points.
515 * @param string $table The current table name
516 * @param string $column The relation column name
518 * @return array Table right,left connection points and key position
520 * @access private
522 private function _getXy($table, $column)
524 $pos = array_search($column, $table->fields);
525 // left, right, position
526 $value = 12;
527 if ($pos != 0) {
528 return array($pos + $value + $pos, $pos + $value + $pos + 1, $pos);
530 return array($pos + $value , $pos + $value + 1, $pos);
534 * Draws relation references
536 * connects master table's master field to foreign table's
537 * forein field using Dia object type Database - Reference
538 * Dia object is used to generate the XML of Dia Document.
539 * Database reference Object and their attributes are involved
540 * in the combination of displaing Database - reference on Dia Document.
542 * @param boolean $changeColor Whether to use one color per relation or not
543 * if changeColor is true then an array of $listOfColors will be used to choose
544 * the random colors for references lines. we can change/add more colors to this
546 * @return void
548 * @global object The current Dia document
550 * @access public
551 * @see PMA_PDF
553 public function relationDraw($changeColor)
555 global $dia;
557 PMA_Dia_Relation_Schema::$objectId += 1;
559 * if source connection points and destination connection
560 * points are same then return it false and don't draw that
561 * relation
563 if ( $this->srcConnPointsRight == $this->destConnPointsRight) {
564 if ( $this->srcConnPointsLeft == $this->destConnPointsLeft) {
565 return false;
569 if ($changeColor) {
570 $listOfColors = array(
571 'FF0000',
572 '000099',
573 '00FF00'
575 shuffle($listOfColors);
576 $this->referenceColor = '#' . $listOfColors[0] . '';
577 } else {
578 $this->referenceColor = '#000000';
581 $dia->writeRaw(
582 '<dia:object type="Database - Reference" version="0" id="'
583 . PMA_Dia_Relation_Schema::$objectId . '">
584 <dia:attribute name="obj_pos">
585 <dia:point val="3.27,18.9198"/>
586 </dia:attribute>
587 <dia:attribute name="obj_bb">
588 <dia:rectangle val="2.27,8.7175;17.7679,18.9198"/>
589 </dia:attribute>
590 <dia:attribute name="meta">
591 <dia:composite type="dict"/>
592 </dia:attribute>
593 <dia:attribute name="orth_points">
594 <dia:point val="3.27,18.9198"/>
595 <dia:point val="2.27,18.9198"/>
596 <dia:point val="2.27,14.1286"/>
597 <dia:point val="17.7679,14.1286"/>
598 <dia:point val="17.7679,9.3375"/>
599 <dia:point val="16.7679,9.3375"/>
600 </dia:attribute>
601 <dia:attribute name="orth_orient">
602 <dia:enum val="0"/>
603 <dia:enum val="1"/>
604 <dia:enum val="0"/>
605 <dia:enum val="1"/>
606 <dia:enum val="0"/>
607 </dia:attribute>
608 <dia:attribute name="orth_autoroute">
609 <dia:boolean val="true"/>
610 </dia:attribute>
611 <dia:attribute name="text_colour">
612 <dia:color val="#000000"/>
613 </dia:attribute>
614 <dia:attribute name="line_colour">
615 <dia:color val="' . $this->referenceColor . '"/>
616 </dia:attribute>
617 <dia:attribute name="line_width">
618 <dia:real val="0.10000000000000001"/>
619 </dia:attribute>
620 <dia:attribute name="line_style">
621 <dia:enum val="0"/>
622 <dia:real val="1"/>
623 </dia:attribute>
624 <dia:attribute name="corner_radius">
625 <dia:real val="0"/>
626 </dia:attribute>
627 <dia:attribute name="end_arrow">
628 <dia:enum val="22"/>
629 </dia:attribute>
630 <dia:attribute name="end_arrow_length">
631 <dia:real val="0.5"/>
632 </dia:attribute>
633 <dia:attribute name="end_arrow_width">
634 <dia:real val="0.5"/>
635 </dia:attribute>
636 <dia:attribute name="start_point_desc">
637 <dia:string>#1#</dia:string>
638 </dia:attribute>
639 <dia:attribute name="end_point_desc">
640 <dia:string>#n#</dia:string>
641 </dia:attribute>
642 <dia:attribute name="normal_font">
643 <dia:font family="monospace" style="0" name="Courier"/>
644 </dia:attribute>
645 <dia:attribute name="normal_font_height">
646 <dia:real val="0.59999999999999998"/>
647 </dia:attribute>
648 <dia:connections>
649 <dia:connection handle="0" to="'
650 . $this->masterTableId . '" connection="'
651 . $this->srcConnPointsRight . '"/>
652 <dia:connection handle="1" to="'
653 . $this->foreignTableId . '" connection="'
654 . $this->destConnPointsRight . '"/>
655 </dia:connections>
656 </dia:object>'
662 * Dia Relation Schema Class
664 * Purpose of this class is to generate the Dia XML Document
665 * which is used for representing the database diagrams in Dia IDE
666 * This class uses Database Table and Reference Objects of Dia and with
667 * the combination of these objects actually helps in preparing Dia XML.
669 * Dia XML is generated by using XMLWriter php extension and this class
670 * inherits Export_Relation_Schema class has common functionality added
671 * to this class
673 * @name Dia_Relation_Schema
675 class PMA_Dia_Relation_Schema extends PMA_Export_Relation_Schema
678 * Defines properties
680 private $_tables = array();
681 private $_relations = array();
682 private $_topMargin = 2.8222000598907471;
683 private $_bottomMargin = 2.8222000598907471;
684 private $_leftMargin = 2.8222000598907471;
685 private $_rightMargin = 2.8222000598907471;
686 public static $objectId = 0;
689 * The "PMA_Dia_Relation_Schema" constructor
691 * Upon instantiation This outputs the Dia XML document
692 * that user can download
694 * @return void
695 * @see PMA_DIA,Table_Stats,Relation_Stats
697 function __construct()
699 global $dia,$db;
701 $this->setPageNumber($_POST['pdf_page_number']);
702 $this->setShowGrid(isset($_POST['show_grid']));
703 $this->setShowColor($_POST['show_color']);
704 $this->setShowKeys(isset($_POST['show_keys']));
705 $this->setOrientation(isset($_POST['orientation']));
706 $this->setPaper($_POST['paper']);
707 $this->setExportType($_POST['export_type']);
709 $dia = new PMA_DIA();
710 $dia->startDiaDoc(
711 $this->paper, $this->_topMargin, $this->_bottomMargin,
712 $this->_leftMargin, $this->_rightMargin, $this->orientation
714 $alltables = $this->getAllTables($db, $this->pageNumber);
715 foreach ($alltables as $table) {
716 if (! isset($this->tables[$table])) {
717 $this->tables[$table] = new Table_Stats(
718 $table, $this->pageNumber, $this->showKeys
723 $seen_a_relation = false;
724 foreach ($alltables as $one_table) {
725 $exist_rel = PMA_getForeigners($db, $one_table, '', 'both');
726 if ($exist_rel) {
727 $seen_a_relation = true;
728 foreach ($exist_rel as $master_field => $rel) {
729 /* put the foreign table on the schema only if selected
730 * by the user
731 * (do not use array_search() because we would have to
732 * to do a === false and this is not PHP3 compatible)
734 if (in_array($rel['foreign_table'], $alltables)) {
735 $this->_addRelation(
736 $one_table, $master_field, $rel['foreign_table'],
737 $rel['foreign_field'], $this->showKeys
743 $this->_drawTables($this->showColor);
745 if ($seen_a_relation) {
746 $this->_drawRelations($this->showColor);
748 $dia->endDiaDoc();
749 $dia->showOutput($db . '-' . $this->pageNumber);
750 exit();
754 * Defines relation objects
756 * @param string $masterTable The master table name
757 * @param string $masterField The relation field in the master table
758 * @param string $foreignTable The foreign table name
759 * @param string $foreignField The relation field in the foreign table
760 * @param bool $showKeys Whether to display ONLY keys or not
762 * @return void
764 * @access private
765 * @see Table_Stats::__construct(),Relation_Stats::__construct()
767 private function _addRelation($masterTable, $masterField, $foreignTable, $foreignField, $showKeys)
769 if (! isset($this->tables[$masterTable])) {
770 $this->tables[$masterTable] = new Table_Stats(
771 $masterTable, $this->pageNumber, $showKeys
774 if (! isset($this->tables[$foreignTable])) {
775 $this->tables[$foreignTable] = new Table_Stats(
776 $foreignTable, $this->pageNumber, $showKeys
779 $this->_relations[] = new Relation_Stats(
780 $this->tables[$masterTable], $masterField,
781 $this->tables[$foreignTable], $foreignField
786 * Draws relation references
788 * connects master table's master field to
789 * foreign table's forein field using Dia object
790 * type Database - Reference
792 * @param boolean $changeColor Whether to use one color per relation or not
794 * @return void
796 * @access private
797 * @see Relation_Stats::relationDraw()
799 private function _drawRelations($changeColor)
801 foreach ($this->_relations as $relation) {
802 $relation->relationDraw($changeColor);
807 * Draws tables
809 * Tables are generated using Dia object type Database - Table
810 * primary fields are underlined and bold in tables
812 * @param boolean $changeColor Whether to show color for tables text or not
814 * @return void
816 * @access private
817 * @see Table_Stats::tableDraw()
819 private function _drawTables($changeColor)
821 foreach ($this->tables as $table) {
822 $table->tableDraw($changeColor);