Debian Codegraph @

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

raw symbols ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 /*
2 * DiTAA - Diagrams Through Ascii Art
3 *
4 * Copyright (C) 2004 Efstathios Sideris
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program 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 General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 *
20 */
21 package org.stathissideris.ascii2image.text;
22
23 /**
24 *
25 * @author Efstathios Sideris
26 */
27 public class AbstractCell {
28
29 public int rows[][] = new int[3][3];
30 {
31 for(int y = 0; y < 3; y++)
32 for(int x = 0; x < 3; x++)
33 rows[x][y] = 0;
34 }
35
36 static AbstractCell makeHorizontalLine(){
37 AbstractCell result = new AbstractCell();
38 result.rows[0][1] = 1;
39 result.rows[1][1] = 1;
40 result.rows[2][1] = 1;
41 return result;
42 }
43
44 static AbstractCell makeVerticalLine(){
45 AbstractCell result = new AbstractCell();
46 result.rows[1][0] = 1;
47 result.rows[1][1] = 1;
48 result.rows[1][2] = 1;
49 return result;
50 }
51
52 static AbstractCell makeCorner1(){
53 AbstractCell result = new AbstractCell();
54 result.rows[1][1] = 1;
55 result.rows[1][2] = 1;
56 result.rows[2][1] = 1;
57 return result;
58 }
59
60 static AbstractCell makeCorner2(){
61 AbstractCell result = new AbstractCell();
62 result.rows[0][1] = 1;
63 result.rows[1][1] = 1;
64 result.rows[1][2] = 1;
65 return result;
66 }
67
68 static AbstractCell makeCorner3(){
69 AbstractCell result = new AbstractCell();
70 result.rows[0][1] = 1;
71 result.rows[1][1] = 1;
72 result.rows[1][0] = 1;
73 return result;
74 }
75
76 static AbstractCell makeCorner4(){
77 AbstractCell result = new AbstractCell();
78 result.rows[2][1] = 1;
79 result.rows[1][1] = 1;
80 result.rows[1][0] = 1;
81 return result;
82 }
83
84 static AbstractCell makeT(){
85 AbstractCell result = AbstractCell.makeHorizontalLine();
86 result.rows[1][2] = 1;
87 return result;
88 }
89
90 static AbstractCell makeInverseT(){
91 AbstractCell result = AbstractCell.makeHorizontalLine();
92 result.rows[1][0] = 1;
93 return result;
94 }
95
96 static AbstractCell makeK(){
97 AbstractCell result = AbstractCell.makeVerticalLine();
98 result.rows[2][1] = 1;
99 return result;
100 }
101
102 static AbstractCell makeInverseK(){
103 AbstractCell result = AbstractCell.makeVerticalLine();
104 result.rows[0][1] = 1;
105 return result;
106 }
107
108 static AbstractCell makeCross(){
109 AbstractCell result = AbstractCell.makeVerticalLine();
110 result.rows[0][1] = 1;
111 result.rows[2][1] = 1;
112 return result;
113 }
114
115 static AbstractCell makeStar(){
116 AbstractCell result = AbstractCell.makeVerticalLine();
117 for(int y = 0; y < 3; y++)
118 for(int x = 0; x < 3; x++)
119 result.rows[x][y] = 1;
120 return result;
121 }
122
123
124 }