1 package org.openscience.jmol.app.janocchio;
2 
3 import java.awt.Image;
4 import java.util.Map;
5 
6 import org.jmol.modelset.Atom;
7 import org.jmol.viewer.Viewer;
8 
9 /**
10  * Implements some lost interfaces. It was a way to streamline the JavaScript;
11  * Not an especially good idea, I know.
12  *
13  */
14 public class NMR_Viewer extends Viewer {
15 
NMR_Viewer(Map<String, Object> info)16   public NMR_Viewer(Map<String, Object> info) {
17     super(info);
18   }
19 
getDisplayModelIndex()20   public int getDisplayModelIndex() {
21     return am.cmi;
22   }
23 
getAtomNumber(int atomIndex)24   public int getAtomNumber(int atomIndex) {
25     return ms.at[atomIndex].getAtomNumber();
26   }
27 
getAtomName(int atomIndex)28   public String getAtomName(int atomIndex) {
29     return ms.at[atomIndex].getAtomName();
30   }
31 
getModelCount()32   public int getModelCount() {
33     return ms.mc;
34   }
35 
getAtomCount()36   public int getAtomCount() {
37     return ms.ac;
38   }
39 
getBondCount()40   public int getBondCount() {
41     return ms.bondCount;
42   }
43 
setSelectionHalos(boolean b)44   public void setSelectionHalos(boolean b) {
45     setSelectionHalosEnabled(b);
46   }
47 
getScreenImage()48   public Image getScreenImage() {
49     return (Image) getScreenImageBuffer(null, true);
50   }
51 
getAtomAt(int i)52   public Atom getAtomAt(int i) {
53     return ms.at[i];
54   }
55 
getCurrentModelIndex()56   public int getCurrentModelIndex() {
57     return am.cmi;
58   }
59 
indexInFrame(Atom atom)60   public int indexInFrame(Atom atom) {
61     return atom.i - ms.am[atom.mi].firstAtomIndex;
62   }
63 
setFrameModelInfo(String key, Object value)64   public void setFrameModelInfo(String key, Object value) {
65     ms.getModelAuxiliaryInfo(getCurrentModelIndex()).put(key,  value);
66   }
67 
getFrameModelInfo(String key)68   public Object getFrameModelInfo(String key) {
69     return ms.getModelAuxiliaryInfo(getCurrentModelIndex()).get(key);
70   }
71 
getFrameAtomIndex(int i)72   public int getFrameAtomIndex(int i) {
73     return i - getFrameBase(i);
74   }
75 
getFrameBase(int i)76   public int getFrameBase(int i) {
77     return ms.am[ms.at[i].mi].firstAtomIndex;
78   }
79 
80 
81 }
82