Debian Codegraph @

src/org/stathissideris/ascii2image/text/AbstractCell.java

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
•1 /**
2 * ditaa - Diagrams Through Ascii Art
3 *
•4 * Copyright (C) 2004-2011 Efstathios Sideris
5 *
•6 * ditaa is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation, either version 3 of
9 * the License, or (at your option) any later version.
10 *
•11 * ditaa is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
•14 * GNU Lesser General Public License for more details.
15 *
•16 * You should have received a copy of the GNU Lesser General Public
17 * License along with ditaa. If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20 package org.stathissideris.ascii2image.text;
21
22 /**
23 *
24 * @author Efstathios Sideris
25 */
26 public class AbstractCell {
27
28 public int rows[][] = new int[3][3];
29 {
30 for(int y = 0; y < 3; y++)
31 for(int x = 0; x < 3; x++)
32 rows[x][y] = 0;
33 }
34
35 static AbstractCell makeHorizontalLine(){
36 AbstractCell result = new AbstractCell();
37 result.rows[0][1] = 1;
38 result.rows[1][1] = 1;
39 result.rows[2][1] = 1;
40 return result;
41 }
42
43 static AbstractCell makeVerticalLine(){
44 AbstractCell result = new AbstractCell();
45 result.rows[1][0] = 1;
46 result.rows[1][1] = 1;
47 result.rows[1][2] = 1;
48 return result;
49 }
50
51 static AbstractCell makeCorner1(){
52 AbstractCell result = new AbstractCell();
53 result.rows[1][1] = 1;
54 result.rows[1][2] = 1;
55 result.rows[2][1] = 1;
56 return result;
57 }
58
59 static AbstractCell makeCorner2(){
60 AbstractCell result = new AbstractCell();
61 result.rows[0][1] = 1;
62 result.rows[1][1] = 1;
63 result.rows[1][2] = 1;
64 return result;
65 }
66
67 static AbstractCell makeCorner3(){
68 AbstractCell result = new AbstractCell();
69 result.rows[0][1] = 1;
70 result.rows[1][1] = 1;
71 result.rows[1][0] = 1;
72 return result;
73 }
74
75 static AbstractCell makeCorner4(){
76 AbstractCell result = new AbstractCell();
77 result.rows[2][1] = 1;
78 result.rows[1][1] = 1;
79 result.rows[1][0] = 1;
80 return result;
81 }
82
83 static AbstractCell makeT(){
84 AbstractCell result = AbstractCell.makeHorizontalLine();
85 result.rows[1][2] = 1;
86 return result;
87 }
88
89 static AbstractCell makeInverseT(){
90 AbstractCell result = AbstractCell.makeHorizontalLine();
91 result.rows[1][0] = 1;
92 return result;
93 }
94
95 static AbstractCell makeK(){
96 AbstractCell result = AbstractCell.makeVerticalLine();
97 result.rows[2][1] = 1;
98 return result;
99 }
100
101 static AbstractCell makeInverseK(){
102 AbstractCell result = AbstractCell.makeVerticalLine();
103 result.rows[0][1] = 1;
104 return result;
105 }
106
107 static AbstractCell makeCross(){
108 AbstractCell result = AbstractCell.makeVerticalLine();
109 result.rows[0][1] = 1;
110 result.rows[2][1] = 1;
111 return result;
112 }
113
114 static AbstractCell makeStar(){
115 AbstractCell result = AbstractCell.makeVerticalLine();
116 for(int y = 0; y < 3; y++)
117 for(int x = 0; x < 3; x++)
118 result.rows[x][y] = 1;
119 return result;
120 }
121
122
123 }