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