comparison src/viewer_swing/java/com/glavsoft/viewer/UiSettingsData.java @ 52:472a9bcacb21 draft default tip

TightVNC 2.7.1.0
author you@cr.ie.u-ryukyu.ac.jp
date Wed, 07 Aug 2013 19:01:17 +0900
parents
children
comparison
equal deleted inserted replaced
0:4689cc86d6cb 52:472a9bcacb21
1 // Copyright (C) 2010, 2011, 2012, 2013 GlavSoft LLC.
2 // All rights reserved.
3 //
4 //-------------------------------------------------------------------------
5 // This file is part of the TightVNC software. Please visit our Web site:
6 //
7 // http://www.tightvnc.com/
8 //
9 // This program is free software; you can redistribute it and/or modify
10 // it under the terms of the GNU General Public License as published by
11 // the Free Software Foundation; either version 2 of the License, or
12 // (at your option) any later version.
13 //
14 // This program is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
18 //
19 // You should have received a copy of the GNU General Public License along
20 // with this program; if not, write to the Free Software Foundation, Inc.,
21 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 //-------------------------------------------------------------------------
23 //
24
25 package com.glavsoft.viewer;
26
27 import com.glavsoft.viewer.swing.LocalMouseCursorShape;
28
29 import java.io.Serializable;
30
31 /**
32 * @author dime at tightvnc.com
33 */
34 public class UiSettingsData implements Serializable {
35 private static final long serialVersionUID = 1L;
36 private double scalePercent;
37 private LocalMouseCursorShape mouseCursorShape;
38 private boolean fullScreen;
39
40
41 public UiSettingsData() {
42 scalePercent = 100;
43 mouseCursorShape = LocalMouseCursorShape.DOT;
44 fullScreen = false;
45 }
46
47 public UiSettingsData(double scalePercent, LocalMouseCursorShape mouseCursorShape, boolean fullScreen) {
48 this.scalePercent = scalePercent;
49 this.mouseCursorShape = mouseCursorShape;
50 this.fullScreen = fullScreen;
51 }
52
53 public UiSettingsData(UiSettingsData other) {
54 this(other.getScalePercent(), other.getMouseCursorShape(), other.isFullScreen());
55 }
56
57 public double getScalePercent() {
58 return scalePercent;
59 }
60
61 public boolean setScalePercent(double scalePercent) {
62 if (this.scalePercent != scalePercent) {
63 this.scalePercent = scalePercent;
64 return true;
65 }
66 return false;
67 }
68
69
70 public LocalMouseCursorShape getMouseCursorShape() {
71 return mouseCursorShape;
72 }
73
74 public boolean setMouseCursorShape(LocalMouseCursorShape mouseCursorShape) {
75 if (this.mouseCursorShape != mouseCursorShape && mouseCursorShape != null) {
76 this.mouseCursorShape = mouseCursorShape;
77 return true;
78 }
79 return false;
80 }
81
82 public boolean isFullScreen() {
83 return fullScreen;
84 }
85
86 public boolean setFullScreen(boolean fullScreen) {
87 if (this.fullScreen != fullScreen) {
88 this.fullScreen = fullScreen;
89 return true;
90 }
91 return false;
92 }
93
94 @Override
95 public String toString() {
96 return "UiSettingsData{" +
97 "scalePercent=" + scalePercent +
98 ", mouseCursorShape=" + mouseCursorShape +
99 ", fullScreen=" + fullScreen +
100 '}';
101 }
102 }