| •1 |
|
| 2 |
|
| 3 |
|
| •4 |
|
| 5 |
|
| •6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| •11 |
|
| 12 |
|
| 13 |
|
| •14 |
|
| 15 |
|
| •16 |
|
| 17 |
|
| 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 |
|
| 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 |
|
| 65 |
|
| 66 |
public boolean areAllCornersRound() { |
| 67 |
return allCornersAreRound; |
| 68 |
} |
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
public int getColorCodesProcessingMode() { |
| 74 |
return colorCodesProcessingMode; |
| 75 |
} |
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
public int getExportFormat() { |
| 81 |
return exportFormat; |
| 82 |
} |
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
public boolean performSeparationOfCommonEdges() { |
| 88 |
return performSeparationOfCommonEdges; |
| 89 |
} |
| 90 |
|
| •91 |
|
| 92 |
|
| 93 |
|
| 94 |
public int getTagProcessingMode() { |
| 95 |
return tagProcessingMode; |
| 96 |
} |
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
public void setAllCornersAreRound(boolean b) { |
| 102 |
allCornersAreRound = b; |
| 103 |
} |
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
public void setColorCodesProcessingMode(int i) { |
| 109 |
colorCodesProcessingMode = i; |
| 110 |
} |
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
public void setExportFormat(int i) { |
| 116 |
exportFormat = i; |
| 117 |
} |
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
public void setPerformSeparationOfCommonEdges(boolean b) { |
| 123 |
performSeparationOfCommonEdges = b; |
| 124 |
} |
| 125 |
|
| •126 |
|
| 127 |
|
| 128 |
|
| 129 |
public void setTagProcessingMode(int i) { |
| 130 |
tagProcessingMode = i; |
| 131 |
} |
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
public String getInputFilename() { |
| 137 |
return inputFilename; |
| 138 |
} |
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
public String getOutputFilename() { |
| 144 |
return outputFilename; |
| 145 |
} |
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
public void setInputFilename(String string) { |
| 151 |
inputFilename = string; |
| 152 |
} |
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
public void setOutputFilename(String string) { |
| 158 |
outputFilename = string; |
| 159 |
} |
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
public boolean verbose() { |
| 165 |
return beVerbose; |
| 166 |
} |
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
public boolean printDebugOutput() { |
| 172 |
return printDebugOutput; |
| 173 |
} |
| 174 |
|
| 175 |
|
| 176 |
|
| 177 |
|
| 178 |
public void setVerbose(boolean b) { |
| 179 |
beVerbose = b; |
| 180 |
} |
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
public void setPrintDebugOutput(boolean b) { |
| 186 |
printDebugOutput = b; |
| 187 |
} |
| 188 |
|
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
public boolean overwriteFiles() { |
| 193 |
return overwriteFiles; |
| 194 |
} |
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
public void setOverwriteFiles(boolean b) { |
| 200 |
overwriteFiles = b; |
| 201 |
} |
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
public int getTabSize() { |
| 207 |
return tabSize; |
| 208 |
} |
| 209 |
|
| 210 |
|
| 211 |
|
| 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 |
} |