| 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.core; |
| 22 |
|
| 23 |
import java.util.HashMap; |
| 24 |
|
| 25 |
import org.stathissideris.ascii2image.graphics.CustomShapeDefinition; |
| 26 |
|
| 27 |
/** |
| 28 |
* |
| 29 |
* @author Efstathios Sideris |
| 30 |
*/ |
| 31 |
public class RenderingOptions { |
| 32 |
|
| 33 |
private HashMap<String, CustomShapeDefinition> customShapes; |
| 34 |
|
| 35 |
private boolean dropShadows = true; |
| 36 |
private boolean renderDebugLines = false; |
| 37 |
private boolean antialias = true; |
| 38 |
|
| 39 |
private int cellWidth = 10; |
| 40 |
private int cellHeight = 14; |
| 41 |
|
| 42 |
private float scale = 1; |
| 43 |
|
| 44 |
/** |
| 45 |
* @return |
| 46 |
*/ |
| 47 |
public int getCellHeight() { |
| 48 |
return cellHeight; |
| 49 |
} |
| 50 |
|
| 51 |
/** |
| 52 |
* @return |
| 53 |
*/ |
| 54 |
public int getCellWidth() { |
| 55 |
return cellWidth; |
| 56 |
} |
| 57 |
|
| 58 |
/** |
| 59 |
* @return |
| 60 |
*/ |
| 61 |
public boolean dropShadows() { |
| 62 |
return dropShadows; |
| 63 |
} |
| 64 |
|
| 65 |
/** |
| 66 |
* @return |
| 67 |
*/ |
| 68 |
public boolean renderDebugLines() { |
| 69 |
return renderDebugLines; |
| 70 |
} |
| 71 |
|
| 72 |
/** |
| 73 |
* @return |
| 74 |
*/ |
| 75 |
public float getScale() { |
| 76 |
return scale; |
| 77 |
} |
| 78 |
|
| 79 |
/** |
| 80 |
* @param b |
| 81 |
*/ |
| 82 |
public void setDropShadows(boolean b) { |
| 83 |
dropShadows = b; |
| 84 |
} |
| 85 |
|
| 86 |
/** |
| 87 |
* @param b |
| 88 |
*/ |
| 89 |
public void setRenderDebugLines(boolean b) { |
| 90 |
renderDebugLines = b; |
| 91 |
} |
| 92 |
|
| 93 |
/** |
| 94 |
* @param f |
| 95 |
*/ |
| 96 |
public void setScale(float f) { |
| 97 |
scale = f; |
| 98 |
cellWidth *= scale; |
| 99 |
cellHeight *= scale; |
| 100 |
} |
| 101 |
|
| 102 |
/** |
| 103 |
* @return |
| 104 |
*/ |
| 105 |
public boolean performAntialias() { |
| 106 |
return antialias; |
| 107 |
} |
| 108 |
|
| 109 |
/** |
| 110 |
* @param b |
| 111 |
*/ |
| 112 |
public void setAntialias(boolean b) { |
| 113 |
antialias = b; |
| 114 |
} |
| 115 |
|
| 116 |
} |