OSDN Git Service

c34843f0beceb492c0636dd9e2126ba1206d7476
[jindolf/Jindolf.git] / src / main / java / jp / sfjp / jindolf / data / DialogPref.java
1 /*
2  * dialog preferences
3  *
4  * License : The MIT License
5  * Copyright(c) 2009 olyutorskii
6  */
7
8 package jp.sfjp.jindolf.data;
9
10 /**
11  * 発言表示設定。
12  */
13 public class DialogPref{
14
15     private boolean useBodyImage = false;
16     private boolean useMonoImage = false;
17     private boolean isSimpleMode = false;
18     private boolean alignBaloonWidth = false;
19
20     /**
21      * コンストラクタ。
22      */
23     public DialogPref(){
24         super();
25         return;
26     }
27
28     /**
29      * デカキャラモードを使うか否か状態を返す。
30      * @return デカキャラモードを使うならtrue
31      */
32     public boolean useBodyImage(){
33         return this.useBodyImage;
34     }
35
36     /**
37      * 遺影モードを使うか否か状態を返す。
38      * @return 遺影モードを使うならtrue
39      */
40     public boolean useMonoImage(){
41         return this.useMonoImage;
42     }
43
44     /**
45      * シンプル表示モードを使うか否か状態を返す。
46      * @return シンプルモードならtrue
47      */
48     public boolean isSimpleMode(){
49         return this.isSimpleMode;
50     }
51
52     /**
53      * バルーン幅揃えモードを使うか否か状態を返す。
54      * @return バルーン幅揃えモードならtrue
55      */
56     public boolean alignBaloonWidth(){
57         return this.alignBaloonWidth;
58     }
59
60     /**
61      * デカキャラモードの設定を行う。
62      * @param setting 有効にするならtrue
63      */
64     public void setBodyImageSetting(boolean setting){
65         this.useBodyImage = setting;
66         return;
67     }
68
69     /**
70      * 遺影モードの設定を行う。
71      * @param setting 有効にするならtrue
72      */
73     public void setMonoImageSetting(boolean setting){
74         this.useMonoImage = setting;
75         return;
76     }
77
78     /**
79      * シンプルモードの設定を行う。
80      * @param setting 有効にするならtrue
81      */
82     public void setSimpleMode(boolean setting){
83         this.isSimpleMode = setting;
84         return;
85     }
86
87     /**
88      * バルーン幅揃えの設定を行う。
89      * @param setting バルーン幅を揃えたいならtrue
90      */
91     public void setAlignBalooonWidthSetting(boolean setting){
92         this.alignBaloonWidth = setting;
93         return;
94     }
95
96     /**
97      * {@inheritDoc}
98      * @param obj {@inheritDoc}
99      * @return {@inheritDoc}
100      */
101     @Override
102     public boolean equals(Object obj){
103         if(obj instanceof DialogPref) return false;
104         DialogPref target = (DialogPref) obj;
105
106         if(this.useBodyImage     != target.useBodyImage)     return false;
107         if(this.useMonoImage     != target.useMonoImage)     return false;
108         if(this.isSimpleMode     != target.isSimpleMode)     return false;
109         if(this.alignBaloonWidth != target.alignBaloonWidth) return false;
110
111         return true;
112     }
113
114     /**
115      * {@inheritDoc}
116      * @return {@inheritDoc}
117      */
118     @Override
119     public int hashCode(){
120         int hash;
121         hash  = Boolean.valueOf(this.useBodyImage)    .hashCode() << 0;
122         hash ^= Boolean.valueOf(this.useMonoImage)    .hashCode() << 4;
123         hash ^= Boolean.valueOf(this.isSimpleMode)    .hashCode() << 8;
124         hash ^= Boolean.valueOf(this.alignBaloonWidth).hashCode() << 12;
125         return hash;
126     }
127
128 }