Clover icon

Coverage Report

  1. Project Clover database Mon Nov 11 2024 17:27:16 GMT
  2. Package jalview.datamodel

File StructureViewerModel.java

 

Coverage histogram

../../img/srcFileCovDistChart8.png
20% 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
0.880%
StructureViewerModel.StructureData 57 9 7
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  40 toggle public StructureData(String pdbFile, String id)
74    {
75  40 this.filePath = pdbFile;
76  40 this.pdbId = id;
77  40 this.seqList = new ArrayList<SequenceI>();
78    }
79   
 
80  47 toggle public String getFilePath()
81    {
82  47 return filePath;
83    }
84   
 
85  0 toggle protected void setFilePath(String filePath)
86    {
87  0 this.filePath = filePath;
88    }
89   
 
90  7 toggle public String getPdbId()
91    {
92  7 return pdbId;
93    }
94   
 
95  0 toggle protected void setPdbId(String pdbId)
96    {
97  0 this.pdbId = pdbId;
98    }
99   
 
100  200 toggle public List<SequenceI> getSeqList()
101    {
102  200 return seqList;
103    }
104   
 
105  0 toggle protected void setSeqList(List<SequenceI> seqList)
106    {
107  0 this.seqList = seqList;
108    }
109    }
110   
 
111  40 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  40 this.x = x;
116  40 this.y = y;
117  40 this.width = width;
118  40 this.height = height;
119  40 this.alignWithPanel = alignWithPanel;
120  40 this.colourWithAlignPanel = colourWithAlignPanel;
121  40 this.colourByViewer = colourByViewer;
122  40 this.viewId = viewId;
123  40 this.type = type;
124    }
125   
 
126  12 toggle public int getX()
127    {
128  12 return x;
129    }
130   
 
131  0 toggle protected void setX(int x)
132    {
133  0 this.x = x;
134    }
135   
 
136  12 toggle public int getY()
137    {
138  12 return y;
139    }
140   
 
141  0 toggle protected void setY(int y)
142    {
143  0 this.y = y;
144    }
145   
 
146  12 toggle public int getWidth()
147    {
148  12 return width;
149    }
150   
 
151  0 toggle protected void setWidth(int width)
152    {
153  0 this.width = width;
154    }
155   
 
156  12 toggle public int getHeight()
157    {
158  12 return height;
159    }
160   
 
161  0 toggle public void setHeight(int height)
162    {
163  0 this.height = height;
164    }
165   
 
166  120 toggle public boolean isAlignWithPanel()
167    {
168  120 return alignWithPanel;
169    }
170   
 
171  80 toggle public void setAlignWithPanel(boolean alignWithPanel)
172    {
173  80 this.alignWithPanel = alignWithPanel;
174    }
175   
 
176  120 toggle public boolean isColourWithAlignPanel()
177    {
178  120 return colourWithAlignPanel;
179    }
180   
 
181  80 toggle public void setColourWithAlignPanel(boolean colourWithAlignPanel)
182    {
183  80 this.colourWithAlignPanel = colourWithAlignPanel;
184    }
185   
 
186  120 toggle public boolean isColourByViewer()
187    {
188  120 return colourByViewer;
189    }
190   
 
191  80 toggle public void setColourByViewer(boolean colourByViewer)
192    {
193  80 this.colourByViewer = colourByViewer;
194    }
195   
 
196  87 toggle public String getStateData()
197    {
198  87 return stateData;
199    }
200   
 
201  30 toggle public void setStateData(String stateData)
202    {
203  30 this.stateData = stateData;
204    }
205   
 
206  167 toggle public Map<File, StructureData> getFileData()
207    {
208  167 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  7 toggle public String getType()
222    {
223  7 return this.type;
224    }
225    }