Starsector API
Loading...
Searching...
No Matches
ContactTagSpec.java
Go to the documentation of this file.
1package com.fs.starfarer.api.loading;
2
3import java.awt.Color;
4
5import org.json.JSONObject;
6
7public class ContactTagSpec {
8
9// "name":"Important",
10// "color":"buttonShortcut",
11// "width":120,
12// "putFirst":true,
13// "sort":10,
14
15 private String tag;
16 private String name;
17 private Color color;
18 private float width;
19 private boolean putFirst;
20 private float sort;
21 public ContactTagSpec(String tag, Color color, JSONObject json) {
22 this.tag = tag;
23 this.color = color;
24
25 name = json.optString("name", null);
26 width = (float) json.optDouble("width", 0);
27 putFirst = json.optBoolean("putFirst", false);
28 sort = (float) json.optDouble("sort", 0);
29 }
30
31
32 public String getTag() {
33 return tag;
34 }
35 public void setTag(String tag) {
36 this.tag = tag;
37 }
38 public String getName() {
39 return name;
40 }
41 public void setName(String name) {
42 this.name = name;
43 }
44 public Color getColor() {
45 return color;
46 }
47 public void setColor(Color color) {
48 this.color = color;
49 }
50 public float getWidth() {
51 return width;
52 }
53 public void setWidth(float width) {
54 this.width = width;
55 }
56 public boolean isPutFirst() {
57 return putFirst;
58 }
59 public void setPutFirst(boolean putFirst) {
60 this.putFirst = putFirst;
61 }
62 public float getSort() {
63 return sort;
64 }
65 public void setSort(float sort) {
66 this.sort = sort;
67 }
68
69
70
71
72}
ContactTagSpec(String tag, Color color, JSONObject json)