DGP - merged printing support from branch
[debian/openrocket] / src / net / sf / openrocket / gui / print / TemplateProperties.java
1 /*
2  * TemplateProperties.java
3  */
4 package net.sf.openrocket.gui.print;
5
6 import javax.swing.UIManager;
7 import java.awt.Color;
8
9 /**
10  * This class is responsible for managing various properties of print templates (fin, nose cone, transitions, etc.).
11  */
12 public class TemplateProperties {
13
14     /**
15      * The property that defines the fill color.
16      */
17     public static final String TEMPLATE_FILL_COLOR_PROPERTY = "template.fill.color";
18
19     /**
20      * The property that defines the line color.
21      */
22     public static final String TEMPLATE_LINE_COLOR_PROPERTY = "template.line.color";
23
24     /**
25      * Get the current fill color.
26      * 
27      * @return  a color to be used as the fill in template shapes
28      */
29     public static Color getFillColor () {
30         Color fillColor = UIManager.getColor(TemplateProperties.TEMPLATE_FILL_COLOR_PROPERTY);
31         if (fillColor == null) {
32             fillColor = Color.lightGray;
33         }
34         return fillColor;
35     }
36
37     /**
38      * Get the current line color.
39      * 
40      * @return  a color to be used as the line in template shapes
41      */
42     public static Color getLineColor () {
43         Color lineColor = UIManager.getColor(TemplateProperties.TEMPLATE_LINE_COLOR_PROPERTY);
44         if (lineColor == null) {
45             lineColor = Color.darkGray;
46         }
47         return lineColor;
48     }
49 }