JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / src / jalview / datamodel / StructureViewerModel.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 StructureViewerModel
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 String viewId;
31
32   // CHIMERA or JMOL (for projects from Jalview 2.9 on)
33   private String type;
34
35   private Map<File, StructureData> fileData = new HashMap<File, StructureData>();
36
37   public class StructureData
38   {
39     private String filePath;
40
41     private String pdbId;
42
43     private List<SequenceI> seqList;
44     // TODO and possibly a list of chains?
45
46     /**
47      * Constructor given structure file path and id.
48      * 
49      * @param pdbFile
50      * @param id
51      */
52     public StructureData(String pdbFile, String id)
53     {
54       this.filePath = pdbFile;
55       this.pdbId = id;
56       this.seqList = new ArrayList<SequenceI>();
57     }
58
59     public String getFilePath()
60     {
61       return filePath;
62     }
63
64     protected void setFilePath(String filePath)
65     {
66       this.filePath = filePath;
67     }
68
69     public String getPdbId()
70     {
71       return pdbId;
72     }
73
74     protected void setPdbId(String pdbId)
75     {
76       this.pdbId = pdbId;
77     }
78
79     public List<SequenceI> getSeqList()
80     {
81       return seqList;
82     }
83
84     protected void setSeqList(List<SequenceI> seqList)
85     {
86       this.seqList = seqList;
87     }
88   }
89
90   public StructureViewerModel(int x, int y, int width, int height,
91           boolean alignWithPanel, boolean colourWithAlignPanel,
92           boolean colourByViewer, String viewId, String type)
93   {
94     this.x = x;
95     this.y = y;
96     this.width = width;
97     this.height = height;
98     this.alignWithPanel = alignWithPanel;
99     this.colourWithAlignPanel = colourWithAlignPanel;
100     this.colourByViewer = colourByViewer;
101     this.viewId = viewId;
102     this.type = type;
103   }
104
105   public int getX()
106   {
107     return x;
108   }
109
110   protected void setX(int x)
111   {
112     this.x = x;
113   }
114
115   public int getY()
116   {
117     return y;
118   }
119
120   protected void setY(int y)
121   {
122     this.y = y;
123   }
124
125   public int getWidth()
126   {
127     return width;
128   }
129
130   protected void setWidth(int width)
131   {
132     this.width = width;
133   }
134
135   public int getHeight()
136   {
137     return height;
138   }
139
140   public void setHeight(int height)
141   {
142     this.height = height;
143   }
144
145   public boolean isAlignWithPanel()
146   {
147     return alignWithPanel;
148   }
149
150   public void setAlignWithPanel(boolean alignWithPanel)
151   {
152     this.alignWithPanel = alignWithPanel;
153   }
154
155   public boolean isColourWithAlignPanel()
156   {
157     return colourWithAlignPanel;
158   }
159
160   public void setColourWithAlignPanel(boolean colourWithAlignPanel)
161   {
162     this.colourWithAlignPanel = colourWithAlignPanel;
163   }
164
165   public boolean isColourByViewer()
166   {
167     return colourByViewer;
168   }
169
170   public void setColourByViewer(boolean colourByViewer)
171   {
172     this.colourByViewer = colourByViewer;
173   }
174
175   public String getStateData()
176   {
177     return stateData;
178   }
179
180   public void setStateData(String stateData)
181   {
182     this.stateData = stateData;
183   }
184
185   public Map<File, StructureData> getFileData()
186   {
187     return fileData;
188   }
189
190   protected void setFileData(Map<File, StructureData> fileData)
191   {
192     this.fileData = fileData;
193   }
194
195   public String getViewId()
196   {
197     return this.viewId;
198   }
199
200   public String getType()
201   {
202     return this.type;
203   }
204 }