Clover icon

jalviewX

  1. Project Clover database Wed Oct 31 2018 15:13:58 GMT
  2. Package jalview.datamodel

File StructureViewerModel.java

 

Coverage histogram

../../img/srcFileCovDistChart8.png
19% of files have more coverage

Code metrics

0
38
28
2
225
150
28
0.74
1.36
14
1

Classes

Class Line # Actions
StructureViewerModel 32 29 21 10
0.880%
StructureViewerModel.StructureData 57 9 7 6
0.62562.5%
 

Contributing tests

This file is covered by 6 tests. .

Source view

1    /*
2    * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3    * Copyright (C) $$Year-Rel$$ The Jalview Authors
4    *
5    * This file is part of Jalview.
6    *
7    * Jalview is free software: you can redistribute it and/or
8    * modify it under the terms of the GNU General Public License
9    * as published by the Free Software Foundation, either version 3
10    * of the License, or (at your option) any later version.
11    *
12    * Jalview is distributed in the hope that it will be useful, but
13    * WITHOUT ANY WARRANTY; without even the implied warranty
14    * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15    * PURPOSE. See the GNU General Public License for more details.
16    *
17    * You should have received a copy of the GNU General Public License
18    * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19    * The Jalview Authors are detailed in the 'AUTHORS' file.
20    */
21    package jalview.datamodel;
22   
23    import java.io.File;
24    import java.util.ArrayList;
25    import java.util.HashMap;
26    import java.util.List;
27    import java.util.Map;
28   
29    /**
30    * A data bean to hold stored data about a structure viewer.
31    */
 
32    public class StructureViewerModel
33    {
34    private int x;
35   
36    private int y;
37   
38    private int width;
39   
40    private int height;
41   
42    private boolean alignWithPanel;
43   
44    private boolean colourWithAlignPanel;
45   
46    private boolean colourByViewer;
47   
48    private String stateData = "";
49   
50    private String viewId;
51   
52    // CHIMERA or JMOL (for projects from Jalview 2.9 on)
53    private String type;
54   
55    private Map<File, StructureData> fileData = new HashMap<File, StructureData>();
56   
 
57    public class StructureData
58    {
59    private String filePath;
60   
61    private String pdbId;
62   
63    private List<SequenceI> seqList;
64   
65    // TODO and possibly a list of chains?
66   
67    /**
68    * Constructor given structure file path and id.
69    *
70    * @param pdbFile
71    * @param id
72    */
 
73  60 toggle public StructureData(String pdbFile, String id)
74    {
75  60 this.filePath = pdbFile;
76  60 this.pdbId = id;
77  60 this.seqList = new ArrayList<SequenceI>();
78    }
79   
 
80  68 toggle public String getFilePath()
81    {
82  68 return filePath;
83    }
84   
 
85  0 toggle protected void setFilePath(String filePath)
86    {
87  0 this.filePath = filePath;
88    }
89   
 
90  8 toggle public String getPdbId()
91    {
92  8 return pdbId;
93    }
94   
 
95  0 toggle protected void setPdbId(String pdbId)
96    {
97  0 this.pdbId = pdbId;
98    }
99   
 
100  300 toggle public List<SequenceI> getSeqList()
101    {
102  300 return seqList;
103    }
104   
 
105  0 toggle protected void setSeqList(List<SequenceI> seqList)
106    {
107  0 this.seqList = seqList;
108    }
109    }
110   
 
111  60 toggle public StructureViewerModel(int x, int y, int width, int height,
112    boolean alignWithPanel, boolean colourWithAlignPanel,
113    boolean colourByViewer, String viewId, String type)
114    {
115  60 this.x = x;
116  60 this.y = y;
117  60 this.width = width;
118  60 this.height = height;
119  60 this.alignWithPanel = alignWithPanel;
120  60 this.colourWithAlignPanel = colourWithAlignPanel;
121  60 this.colourByViewer = colourByViewer;
122  60 this.viewId = viewId;
123  60 this.type = type;
124    }
125   
 
126  28 toggle public int getX()
127    {
128  28 return x;
129    }
130   
 
131  0 toggle protected void setX(int x)
132    {
133  0 this.x = x;
134    }
135   
 
136  28 toggle public int getY()
137    {
138  28 return y;
139    }
140   
 
141  0 toggle protected void setY(int y)
142    {
143  0 this.y = y;
144    }
145   
 
146  28 toggle public int getWidth()
147    {
148  28 return width;
149    }
150   
 
151  0 toggle protected void setWidth(int width)
152    {
153  0 this.width = width;
154    }
155   
 
156  28 toggle public int getHeight()
157    {
158  28 return height;
159    }
160   
 
161  0 toggle public void setHeight(int height)
162    {
163  0 this.height = height;
164    }
165   
 
166  180 toggle public boolean isAlignWithPanel()
167    {
168  180 return alignWithPanel;
169    }
170   
 
171  120 toggle public void setAlignWithPanel(boolean alignWithPanel)
172    {
173  120 this.alignWithPanel = alignWithPanel;
174    }
175   
 
176  180 toggle public boolean isColourWithAlignPanel()
177    {
178  180 return colourWithAlignPanel;
179    }
180   
 
181  120 toggle public void setColourWithAlignPanel(boolean colourWithAlignPanel)
182    {
183  120 this.colourWithAlignPanel = colourWithAlignPanel;
184    }
185   
 
186  180 toggle public boolean isColourByViewer()
187    {
188  180 return colourByViewer;
189    }
190   
 
191  120 toggle public void setColourByViewer(boolean colourByViewer)
192    {
193  120 this.colourByViewer = colourByViewer;
194    }
195   
 
196  128 toggle public String getStateData()
197    {
198  128 return stateData;
199    }
200   
 
201  50 toggle public void setStateData(String stateData)
202    {
203  50 this.stateData = stateData;
204    }
205   
 
206  240 toggle public Map<File, StructureData> getFileData()
207    {
208  240 return fileData;
209    }
210   
 
211  0 toggle protected void setFileData(Map<File, StructureData> fileData)
212    {
213  0 this.fileData = fileData;
214    }
215   
 
216  2 toggle public String getViewId()
217    {
218  2 return this.viewId;
219    }
220   
 
221  16 toggle public String getType()
222    {
223  16 return this.type;
224    }
225    }