2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
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.
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.
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.
21 package jalview.datamodel;
24 import java.util.ArrayList;
25 import java.util.HashMap;
26 import java.util.List;
30 * A data bean to hold stored data about a structure viewer.
32 public class StructureViewerModel
42 private boolean alignWithPanel;
44 private boolean colourWithAlignPanel;
46 private boolean colourByViewer;
48 private String stateData = "";
50 private String viewId;
52 // CHIMERA or JMOL (for projects from Jalview 2.9 on)
55 private Map<File, StructureData> fileData = new HashMap<File, StructureData>();
57 public class StructureData
59 private String filePath;
63 private List<SequenceI> seqList;
65 // TODO and possibly a list of chains?
68 * Constructor given structure file path and id.
73 public StructureData(String pdbFile, String id)
75 this.filePath = pdbFile;
77 this.seqList = new ArrayList<SequenceI>();
80 public String getFilePath()
85 protected void setFilePath(String filePath)
87 this.filePath = filePath;
90 public String getPdbId()
95 protected void setPdbId(String pdbId)
100 public List<SequenceI> getSeqList()
105 protected void setSeqList(List<SequenceI> seqList)
107 this.seqList = seqList;
111 public StructureViewerModel(int x, int y, int width, int height,
112 boolean alignWithPanel, boolean colourWithAlignPanel,
113 boolean colourByViewer, String viewId, String type)
118 this.height = height;
119 this.alignWithPanel = alignWithPanel;
120 this.colourWithAlignPanel = colourWithAlignPanel;
121 this.colourByViewer = colourByViewer;
122 this.viewId = viewId;
131 protected void setX(int x)
141 protected void setY(int y)
146 public int getWidth()
151 protected void setWidth(int width)
156 public int getHeight()
161 public void setHeight(int height)
163 this.height = height;
166 public boolean isAlignWithPanel()
168 return alignWithPanel;
171 public void setAlignWithPanel(boolean alignWithPanel)
173 this.alignWithPanel = alignWithPanel;
176 public boolean isColourWithAlignPanel()
178 return colourWithAlignPanel;
181 public void setColourWithAlignPanel(boolean colourWithAlignPanel)
183 this.colourWithAlignPanel = colourWithAlignPanel;
186 public boolean isColourByViewer()
188 return colourByViewer;
191 public void setColourByViewer(boolean colourByViewer)
193 this.colourByViewer = colourByViewer;
196 public String getStateData()
201 public void setStateData(String stateData)
203 this.stateData = stateData;
206 public Map<File, StructureData> getFileData()
211 protected void setFileData(Map<File, StructureData> fileData)
213 this.fileData = fileData;
216 public String getViewId()
221 public String getType()