Merge branch 'features/JAL-1588saveChimeraSession' into develop
[jalview.git] / src / jalview / datamodel / ViewerData.java
1 package jalview.datamodel;
2
3 import java.io.File;
4 import java.util.ArrayList;
5 import java.util.HashMap;
6 import java.util.List;
7 import java.util.Map;
8
9 /**
10  * A data bean to hold stored data about a structure viewer.
11  */
12 public class ViewerData
13 {
14   private int x;
15
16   private int y;
17
18   private int width;
19
20   private int height;
21
22   private boolean alignWithPanel;
23
24   private boolean colourWithAlignPanel;
25
26   private boolean colourByViewer;
27
28   private String stateData = "";
29
30   private Map<File, StructureData> fileData = new HashMap<File, StructureData>();
31
32   public class StructureData
33   {
34     private String filePath;
35
36     private String pdbId;
37
38     private List<SequenceI> seqList;
39
40     // TODO and possibly a list of chains?
41
42     /**
43      * Constructor given structure file path and id.
44      * 
45      * @param pdbFile
46      * @param id
47      */
48     public StructureData(String pdbFile, String id)
49     {
50       this.filePath = pdbFile;
51       this.pdbId = id;
52       this.seqList = new ArrayList<SequenceI>();
53     }
54
55     public String getFilePath()
56     {
57       return filePath;
58     }
59
60     protected void setFilePath(String filePath)
61     {
62       this.filePath = filePath;
63     }
64
65     public String getPdbId()
66     {
67       return pdbId;
68     }
69
70     protected void setPdbId(String pdbId)
71     {
72       this.pdbId = pdbId;
73     }
74
75     public List<SequenceI> getSeqList()
76     {
77       return seqList;
78     }
79
80     protected void setSeqList(List<SequenceI> seqList)
81     {
82       this.seqList = seqList;
83     }
84   }
85
86   public ViewerData(int x, int y, int width, int height,
87           boolean alignWithPanel, boolean colourWithAlignPanel,
88           boolean colourByViewer)
89   {
90     this.x = x;
91     this.y = y;
92     this.width = width;
93     this.height = height;
94     this.alignWithPanel = alignWithPanel;
95     this.colourWithAlignPanel = colourWithAlignPanel;
96     this.colourByViewer = colourByViewer;
97   }
98
99   public int getX()
100   {
101     return x;
102   }
103
104   protected void setX(int x)
105   {
106     this.x = x;
107   }
108
109   public int getY()
110   {
111     return y;
112   }
113
114   protected void setY(int y)
115   {
116     this.y = y;
117   }
118
119   public int getWidth()
120   {
121     return width;
122   }
123
124   protected void setWidth(int width)
125   {
126     this.width = width;
127   }
128
129   public int getHeight()
130   {
131     return height;
132   }
133
134   public void setHeight(int height)
135   {
136     this.height = height;
137   }
138
139   public boolean isAlignWithPanel()
140   {
141     return alignWithPanel;
142   }
143
144   public void setAlignWithPanel(boolean alignWithPanel)
145   {
146     this.alignWithPanel = alignWithPanel;
147   }
148
149   public boolean isColourWithAlignPanel()
150   {
151     return colourWithAlignPanel;
152   }
153
154   public void setColourWithAlignPanel(boolean colourWithAlignPanel)
155   {
156     this.colourWithAlignPanel = colourWithAlignPanel;
157   }
158
159   public boolean isColourByViewer()
160   {
161     return colourByViewer;
162   }
163
164   public void setColourByViewer(boolean colourByViewer)
165   {
166     this.colourByViewer = colourByViewer;
167   }
168
169   public String getStateData()
170   {
171     return stateData;
172   }
173
174   public void setStateData(String stateData)
175   {
176     this.stateData = stateData;
177   }
178
179   public Map<File, StructureData> getFileData()
180   {
181     return fileData;
182   }
183
184   protected void setFileData(Map<File, StructureData> fileData)
185   {
186     this.fileData = fileData;
187   }
188
189 }