\r
import java.util.*;\r
import java.awt.Color;\r
+import jalview.io.AppletFormatAdapter;\r
\r
\r
public class PDBfile extends jalview.io.FileParse {\r
public Vector chains = new Vector();\r
Vector lineArray = new Vector();\r
- String id;\r
+ public String id;\r
\r
public PDBfile(String[] lines) {\r
for (int i = 0; i < lines.length; i++)\r
lineArray.addElement(lines[i]);\r
\r
- noLines = lineArray.size();\r
parse();\r
}\r
\r
\r
BufferedReader dataIn;\r
\r
- if (inType.equals("File")) {\r
+\r
+ if (inType.equals(AppletFormatAdapter.FILE)) {\r
dataIn = new BufferedReader(new FileReader(inFile));\r
}\r
- else if(inType.equals("Paste"))\r
+ else if(inType.equals(AppletFormatAdapter.PASTE))\r
{\r
dataIn = new BufferedReader(new StringReader(inFile));\r
}\r
- else {\r
+ else if (inType.equalsIgnoreCase(AppletFormatAdapter.CLASSLOADER))\r
+ {\r
+ java.io.InputStream is = getClass().getResourceAsStream("/" +\r
+ inFile);\r
+\r
+ dataIn = new BufferedReader(new java.io.InputStreamReader(is));\r
+ }\r
+ else\r
+ {\r
URL url = new URL(inFile);\r
- this.fileSize = 0;\r
dataIn = new BufferedReader(new InputStreamReader(url.openStream()));\r
}\r
\r
lineArray.addElement(line);\r
}\r
\r
- noLines = lineArray.size();\r
\r
parse();\r
lineArray = null;\r