DBVIEW
src/org/dbview/utils/dot/label/GridByRow.java
00001 /*
00002         DbView - Graph Visualization
00003     Copyright (C) 2012  Denis BEURIVE
00004 
00005     This program is free software: you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation, either version 3 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017 */
00018 
00019 /**
00020  * @author Denis Beurive
00021  */
00022 package org.dbview.utils.dot.label;
00023 
00024 import java.util.ArrayList;
00025 
00026 /**
00027  * The class represents a node's label that describes a grid.
00028  * The grid's content is provided by a set of rows.
00029  * @author Denis Beurive
00030  */
00031 public class GridByRow  extends AbstractGrid
00032 {
00033     /**
00034      * List of rows.
00035      */
00036     private ArrayList<ArrayList<String>> __lines   = new ArrayList<ArrayList<String>>();
00037 
00038     /**
00039      * This method adds a row to the grid.
00040      * @param in_line Row to add.
00041      */
00042     public void add(ArrayList<String> in_line) { this.__lines.add(in_line); }
00043 
00044     /**
00045      * This method returns a string that represents the grid.
00046      * @return The method returns a string that represents the grid.
00047      */
00048     public String toString()
00049     {
00050         if (0 == this._rankdir_.compareTo("TB"))
00051         {
00052             return this._vRows_(this.__lines);
00053         }
00054 
00055         return this._hRows_(this.__lines);
00056     }
00057 }