1 | // Copyright 2004-2007 Jean-Francois Poilpret |
2 | // |
3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
4 | // you may not use this file except in compliance with the License. |
5 | // You may obtain a copy of the License at |
6 | // |
7 | // http://www.apache.org/licenses/LICENSE-2.0 |
8 | // |
9 | // Unless required by applicable law or agreed to in writing, software |
10 | // distributed under the License is distributed on an "AS IS" BASIS, |
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | // See the License for the specific language governing permissions and |
13 | // limitations under the License. |
14 | |
15 | package net.sourceforge.hiveboard.view; |
16 | |
17 | import java.awt.Color; |
18 | import java.awt.Font; |
19 | |
20 | /** |
21 | * Simple POJO to encapsulate preferences related to the full screen mode of |
22 | * HiveBoard, eg matte position, scroll and display time. |
23 | * |
24 | * @author Jean-Francois Poilpret |
25 | */ |
26 | public class FullScreenPrefs |
27 | { |
28 | static public final String FULLSCREEN_PREFS_NAME = "fullscreenPrefs"; |
29 | |
30 | public void setMatteY(double matteY) |
31 | { |
32 | _matteY = matteY; |
33 | } |
34 | public double getMatteY() |
35 | { |
36 | return _matteY; |
37 | } |
38 | |
39 | public void setDisplayTime(int displayTime) |
40 | { |
41 | _displayTime = displayTime; |
42 | } |
43 | public int getDisplayTime() |
44 | { |
45 | return _displayTime; |
46 | } |
47 | |
48 | public void setBackground(Color background) |
49 | { |
50 | _background = background; |
51 | } |
52 | public Color getBackground() |
53 | { |
54 | return _background; |
55 | } |
56 | |
57 | public void setForeground(Color foreground) |
58 | { |
59 | _foreground = foreground; |
60 | } |
61 | public Color getForeground() |
62 | { |
63 | return _foreground; |
64 | } |
65 | |
66 | public void setFont(Font font) |
67 | { |
68 | _font = font; |
69 | } |
70 | public Font getFont() |
71 | { |
72 | return _font; |
73 | } |
74 | |
75 | public void setAutoScroll(boolean autoScroll) |
76 | { |
77 | _autoScroll = autoScroll; |
78 | } |
79 | public boolean isAutoScroll() |
80 | { |
81 | return _autoScroll; |
82 | } |
83 | |
84 | public void setScrollTime(int scrollTime) |
85 | { |
86 | _scrollTime = scrollTime; |
87 | } |
88 | public int getScrollTime() |
89 | { |
90 | return _scrollTime; |
91 | } |
92 | |
93 | static private final int DEFAULT_BACKGROUND = 0x80FFFFFF; |
94 | static private final int DEFAULT_FONT_SIZE = 16; |
95 | static private final int DEFAULT_DISPLAY_TIME = 20000; |
96 | static private final int DEFAULT_SCROLL_TIME = 20000; |
97 | |
98 | // 0.0 means on top, 1.0 means at bottom |
99 | private double _matteY = 1.0; |
100 | // Display time of matted messages (in ms) |
101 | private int _displayTime = DEFAULT_DISPLAY_TIME; |
102 | |
103 | private Color _background = new Color(DEFAULT_BACKGROUND, true); |
104 | private Color _foreground = Color.BLACK; |
105 | private Font _font = new Font("SansSerif", Font.PLAIN, DEFAULT_FONT_SIZE); |
106 | |
107 | private boolean _autoScroll = true; |
108 | // The time to scroll from right to left, used to calculate scrolling speed |
109 | private int _scrollTime = DEFAULT_SCROLL_TIME; |
110 | } |