Debian Codegraph @

src/org/stathissideris/ascii2image/core/ProcessingOptions.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.core;
21
22 import java.util.HashMap;
23
24 import org.stathissideris.ascii2image.graphics.CustomShapeDefinition;
25
26 /**
27 * @author Efstathios Sideris
28 *
29 */
30 public class ProcessingOptions {
31
32 private HashMap<String, CustomShapeDefinition> customShapes = new HashMap<String, CustomShapeDefinition>();
33
34 private boolean beVerbose = false;
35 private boolean printDebugOutput = false;
36 private boolean overwriteFiles = false;
37 private boolean performSeparationOfCommonEdges = true;
38 private boolean allCornersAreRound = false;
•39
40 public static final int USE_TAGS = 0;
41 public static final int RENDER_TAGS = 1;
42 public static final int IGNORE_TAGS = 2;
43 private int tagProcessingMode = USE_TAGS;
44
45 public static final int USE_COLOR_CODES = 0;
46 public static final int RENDER_COLOR_CODES = 1;
47 public static final int IGNORE_COLOR_CODES = 2;
48 private int colorCodesProcessingMode = USE_COLOR_CODES;
49
50 public static final int FORMAT_JPEG = 0;
51 public static final int FORMAT_PNG = 1;
52 public static final int FORMAT_GIF = 2;
53 private int exportFormat = FORMAT_PNG;
54
55 public static final int DEFAULT_TAB_SIZE = 8;
56 private int tabSize = DEFAULT_TAB_SIZE;
57
58 private String inputFilename;
59 private String outputFilename;
60
61 private String characterEncoding = null;
62
63 /**
64 * @return
65 */
66 public boolean areAllCornersRound() {
67 return allCornersAreRound;
68 }
69
70 /**
71 * @return
72 */
73 public int getColorCodesProcessingMode() {
74 return colorCodesProcessingMode;
75 }
76
77 /**
78 * @return
79 */
80 public int getExportFormat() {
81 return exportFormat;
82 }
83
84 /**
85 * @return
86 */
87 public boolean performSeparationOfCommonEdges() {
88 return performSeparationOfCommonEdges;
89 }
90
•91 /**
92 * @return
93 */
94 public int getTagProcessingMode() {
95 return tagProcessingMode;
96 }
97
98 /**
99 * @param b
100 */
101 public void setAllCornersAreRound(boolean b) {
102 allCornersAreRound = b;
103 }
104
105 /**
106 * @param i
107 */
108 public void setColorCodesProcessingMode(int i) {
109 colorCodesProcessingMode = i;
110 }
111
112 /**
113 * @param i
114 */
115 public void setExportFormat(int i) {
116 exportFormat = i;
117 }
118
119 /**
120 * @param b
121 */
122 public void setPerformSeparationOfCommonEdges(boolean b) {
123 performSeparationOfCommonEdges = b;
124 }
125
•126 /**
127 * @param i
128 */
129 public void setTagProcessingMode(int i) {
130 tagProcessingMode = i;
131 }
132
133 /**
134 * @return
135 */
136 public String getInputFilename() {
137 return inputFilename;
138 }
139
140 /**
141 * @return
142 */
143 public String getOutputFilename() {
144 return outputFilename;
145 }
146
147 /**
148 * @param string
149 */
150 public void setInputFilename(String string) {
151 inputFilename = string;
152 }
153
154 /**
155 * @param string
156 */
157 public void setOutputFilename(String string) {
158 outputFilename = string;
159 }
160
161 /**
162 * @return
163 */
164 public boolean verbose() {
165 return beVerbose;
166 }
167
168 /**
169 * @return
170 */
171 public boolean printDebugOutput() {
172 return printDebugOutput;
173 }
174
175 /**
176 * @param b
177 */
178 public void setVerbose(boolean b) {
179 beVerbose = b;
180 }
181
182 /**
183 * @param b
184 */
185 public void setPrintDebugOutput(boolean b) {
186 printDebugOutput = b;
187 }
188
189 /**
190 * @return
191 */
192 public boolean overwriteFiles() {
193 return overwriteFiles;
194 }
195
196 /**
197 * @param b
198 */
199 public void setOverwriteFiles(boolean b) {
200 overwriteFiles = b;
201 }
202
203 /**
204 * @return
205 */
206 public int getTabSize() {
207 return tabSize;
208 }
209
210 /**
211 * @param i
212 */
213 public void setTabSize(int i) {
214 tabSize = i;
215 }
216
217 public String getCharacterEncoding() {
218 return characterEncoding;
219 }
220
221 public void setCharacterEncoding(String characterEncoding) {
222 this.characterEncoding = characterEncoding;
223 }
224
225 public HashMap<String, CustomShapeDefinition> getCustomShapes() {
226 return customShapes;
227 }
228
229 public void setCustomShapes(HashMap<String, CustomShapeDefinition> customShapes) {
230 this.customShapes = customShapes;
231 }
232
233 public void putAllInCustomShapes(HashMap<String, CustomShapeDefinition> customShapes) {
234 this.customShapes.putAll(customShapes);
235 }
236
237 public CustomShapeDefinition getFromCustomShapes(String tagName){
238 return customShapes.get(tagName);
239 }
240
241
242
243 }