1 /*
2 * File: ViewConfiguration.java
3 * Copyright (c) 2004-2007 Peter Kliem (Peter.Kliem@jaret.de)
4 * A commercial license is available, see http://www.jaret.de.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (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 package de.jaret.util.ui.timebars;
21
22 import de.jaret.util.date.JaretDate;
23
24 /**
25 * Configuration information for printing the model of a timebarviewer.
26 *
27 * @author Peter Kliem
28 * @version $Id: ViewConfiguration.java 800 2008-12-27 22:27:33Z kliem $
29 */
30 public class ViewConfiguration {
31 /** seconds rendered per page. */
32 private int _secondsPerPage;
33 /** start date for rendering. */
34 private JaretDate _startDate;
35 /** end date for rendering. */
36 private JaretDate _endDate;
37 /** fooer text. */
38 private String _footLine;
39 /** name of the print. */
40 private String _name;
41 /** true for y axis drawn on each page. */
42 private boolean _repeatYAxis = false;
43 /** true for x axis dran on every page. */
44 private boolean _repeatScale = false;
45
46 /**
47 * Retrieve the name of the viewconfiguraion. The name will be used as the name of the print job (if set).
48 *
49 * @return name of the vc
50 */
51 public String getName() {
52 return _name;
53 }
54
55 /**
56 * Set the name of the view configuration. The name will be used as the name of the print job (if set).
57 *
58 * @param name The name to set.
59 */
60 public void setName(String name) {
61 _name = name;
62 }
63
64 /**
65 * Retrieve the number of seconds that shoul dbe printed on the first page.
66 *
67 * @return number of seconds to be printed on the first page.
68 */
69 public int getSecondsPerPage() {
70 return _secondsPerPage;
71 }
72
73 /**
74 * The seconds per page determine the scale of the print. The value denotes the number of seconds on the first page
75 * (the page that includes the yaxis). On subsequent pages without y axis (if repeatYAxis is set to false) there
76 * will be more seconds on a page.
77 *
78 * @param secondsPerPage seconds to print on the first page
79 */
80 public void setSecondsPerPage(int secondsPerPage) {
81 _secondsPerPage = secondsPerPage;
82 }
83
84 /**
85 * @return Returns the startDate.
86 */
87 public JaretDate getStartDate() {
88 return _startDate;
89 }
90
91 /**
92 * Set the start date of the region to print.
93 *
94 * @param startDate The startDate to set.
95 */
96 public void setStartDate(JaretDate startDate) {
97 _startDate = startDate;
98 }
99
100 /**
101 * Retrieve the end date for parinting.
102 *
103 * @return Returns the endDate or <code>null</code> for printing to the end of available data
104 */
105 public JaretDate getEndDate() {
106 return _endDate;
107 }
108
109 /**
110 * Set the end date of the region to print.
111 *
112 * @param endDate The endDate to set or <code>null</code> for printing to the end of available data
113 */
114 public void setEndDate(JaretDate endDate) {
115 _endDate = endDate;
116 }
117
118 /**
119 * @return Returns the footLine.
120 */
121 public String getFootLine() {
122 return _footLine;
123 }
124
125 /**
126 * @param footLine The footLine to set.
127 */
128 public void setFootLine(String footLine) {
129 _footLine = footLine;
130 }
131
132 /**
133 * @return Returns the repeatScale.
134 */
135 public boolean getRepeatScale() {
136 return _repeatScale;
137 }
138
139 /**
140 * @param repeatScale The repeatScale to set.
141 */
142 public void setRepeatScale(boolean repeatScale) {
143 _repeatScale = repeatScale;
144 }
145
146 /**
147 * @return Returns the repeatYAxis.
148 */
149 public boolean getRepeatYAxis() {
150 return _repeatYAxis;
151 }
152
153 /**
154 * @param repeatYAxis The repeatYAxis to set.
155 */
156 public void setRepeatYAxis(boolean repeatYAxis) {
157 _repeatYAxis = repeatYAxis;
158 }
159
160 }