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
31 * in the process of creating XML.
33 public class StructureViewerModel
43 private boolean alignWithPanel;
45 private boolean colourWithAlignPanel;
47 private boolean colourByViewer;
49 private String stateData = "";
51 private String viewId;
53 // CHIMERA or JMOL (for projects from Jalview 2.9 on)
56 private Map<File, StructureData> fileData = new HashMap<File, StructureData>();
58 public class StructureData
60 private String filePath;
64 private List<SequenceI> seqList;
66 // TODO and possibly a list of chains?
69 * Constructor given structure file path and id.
71 * Curiously, only called by Jalview2XML.
76 public StructureData(String pdbFile, String id)
78 this.filePath = pdbFile;
80 this.seqList = new ArrayList<SequenceI>();
83 public String getFilePath()
88 protected void setFilePath(String filePath)
90 this.filePath = filePath;
93 public String getPdbId()
98 protected void setPdbId(String pdbId)
103 public List<SequenceI> getSeqList()
108 protected void setSeqList(List<SequenceI> seqList)
110 this.seqList = seqList;
114 public StructureViewerModel(int x, int y, int width, int height,
115 boolean alignWithPanel, boolean colourWithAlignPanel,
116 boolean colourByViewer, String viewId, String type)
121 this.height = height;
122 this.alignWithPanel = alignWithPanel;
123 this.colourWithAlignPanel = colourWithAlignPanel;
124 this.colourByViewer = colourByViewer;
125 this.viewId = viewId;
134 protected void setX(int x)
144 protected void setY(int y)
149 public int getWidth()
154 protected void setWidth(int width)
159 public int getHeight()
164 public void setHeight(int height)
166 this.height = height;
169 public boolean isAlignWithPanel()
171 return alignWithPanel;
174 public void setAlignWithPanel(boolean alignWithPanel)
176 this.alignWithPanel = alignWithPanel;
179 public boolean isColourWithAlignPanel()
181 return colourWithAlignPanel;
184 public void setColourWithAlignPanel(boolean colourWithAlignPanel)
186 this.colourWithAlignPanel = colourWithAlignPanel;
189 public boolean isColourByViewer()
191 return colourByViewer;
194 public void setColourByViewer(boolean colourByViewer)
196 this.colourByViewer = colourByViewer;
199 public String getStateData()
204 public void setStateData(String stateData)
206 this.stateData = stateData;
209 public Map<File, StructureData> getFileData()
214 protected void setFileData(Map<File, StructureData> fileData)
216 this.fileData = fileData;
219 public String getViewId()
224 public String getType()