]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.document.server.io/src/org/simantics/document/server/io/SimpleFont.java
Sync git svn branch with SVN repository r33269.
[simantics/platform.git] / bundles / org.simantics.document.server.io / src / org / simantics / document / server / io / SimpleFont.java
1 package org.simantics.document.server.io;\r
2 \r
3 public class SimpleFont implements IFont {\r
4 \r
5         private final String family;\r
6         private final String style;\r
7         private final int height;\r
8 \r
9         public SimpleFont(String family, String style, int height) {\r
10                 this.family = family;\r
11                 this.style = style;\r
12                 this.height = height;\r
13         }\r
14 \r
15         @Override\r
16         public int hashCode() {\r
17                 final int prime = 31;\r
18                 int result = 1;\r
19                 result = prime * result + ((family == null) ? 0 : family.hashCode());\r
20                 result = prime * result + height;\r
21                 result = prime * result + ((style == null) ? 0 : style.hashCode());\r
22                 return result;\r
23         }\r
24 \r
25         @Override\r
26         public boolean equals(Object obj) {\r
27                 if (this == obj)\r
28                         return true;\r
29                 if (obj == null)\r
30                         return false;\r
31                 if (getClass() != obj.getClass())\r
32                         return false;\r
33                 SimpleFont other = (SimpleFont) obj;\r
34                 if (family == null) {\r
35                         if (other.family != null)\r
36                                 return false;\r
37                 } else if (!family.equals(other.family))\r
38                         return false;\r
39                 if (height != other.height)\r
40                         return false;\r
41                 if (style == null) {\r
42                         if (other.style != null)\r
43                                 return false;\r
44                 } else if (!style.equals(other.style))\r
45                         return false;\r
46                 return true;\r
47         }\r
48 \r
49         @Override\r
50         public String getFamily() {\r
51                 return family;\r
52         }\r
53 \r
54         @Override\r
55         public String getStyle() {\r
56                 return style;\r
57         }\r
58 \r
59         @Override\r
60         public int getHeight() {\r
61                 return height;\r
62         }\r
63         \r
64 }\r