1 package net.sf.openrocket.gui.print;
5 import net.sf.openrocket.util.AbstractChangeSource;
8 * A class containing all printing settings.
10 public class PrintSettings extends AbstractChangeSource {
12 private Color templateFillColor = Color.LIGHT_GRAY;
13 private Color templateBorderColor = Color.DARK_GRAY;
15 private PaperSize paperSize = PaperSize.getDefault();
16 private PaperOrientation paperOrientation = PaperOrientation.PORTRAIT;
19 public Color getTemplateFillColor() {
20 return templateFillColor;
23 public void setTemplateFillColor(Color templateFillColor) {
24 // Implicitly tests against setting null
25 if (templateFillColor.equals(this.templateFillColor)) {
28 this.templateFillColor = templateFillColor;
32 public Color getTemplateBorderColor() {
33 return templateBorderColor;
36 public void setTemplateBorderColor(Color templateBorderColor) {
37 // Implicitly tests against setting null
38 if (templateBorderColor.equals(this.templateBorderColor)) {
41 this.templateBorderColor = templateBorderColor;
45 public PaperSize getPaperSize() {
49 public void setPaperSize(PaperSize paperSize) {
50 if (paperSize.equals(this.paperSize)) {
53 this.paperSize = paperSize;
57 public PaperOrientation getPaperOrientation() {
58 return paperOrientation;
61 public void setPaperOrientation(PaperOrientation orientation) {
62 if (orientation.equals(paperOrientation)) {
65 this.paperOrientation = orientation;
72 * Load settings from the specified print settings.
73 * @param settings the settings to load
75 public void loadFrom(PrintSettings settings) {
76 this.templateFillColor = settings.templateFillColor;
77 this.templateBorderColor = settings.templateBorderColor;
78 this.paperSize = settings.paperSize;
79 this.paperOrientation = settings.paperOrientation;
85 public String toString() {
86 return "PrintSettings [templateFillColor=" + templateFillColor + ", templateBorderColor=" + templateBorderColor + ", paperSize=" + paperSize + ", paperOrientation=" + paperOrientation + "]";