1 /* $RCSfile$
2  * $Author: hansonr $
3  * $Date: 2006-08-22 03:13:40 -0500 (Tue, 22 Aug 2006) $
4  * $Revision: 5412 $
5 
6  *
7  * Copyright (C) 2002-2005  The Jmol Development Team
8  *
9  * Contact: jmol-developers@lists.sf.net
10  *
11  *  This library is free software; you can redistribute it and/or
12  *  modify it under the terms of the GNU Lesser General Public
13  *  License as published by the Free Software Foundation; either
14  *  version 2.1 of the License, or (at your option) any later version.
15  *
16  *  This library is distributed in the hope that it will be useful,
17  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19  *  Lesser General License for more details.
20  *
21  *  You should have received a copy of the GNU Lesser General Public
22  *  License along with this library; if not, write to the Free Software
23  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
24  */
25 
26 package org.jmol.shape;
27 
28 
29 import javajs.util.BS;
30 import org.jmol.util.BSUtil;
31 import org.jmol.util.C;
32 
33 public class Halos extends AtomShape {
34 
35   public short colixSelection = C.USE_PALETTE;
36 
37   public BS bsHighlight;
38   public short colixHighlight = C.RED;
39 
initState()40   void initState() {
41     translucentAllowed = false;
42   }
43 
44   @Override
setProperty(String propertyName, Object value, BS bs)45   public void setProperty(String propertyName, Object value, BS bs) {
46     if ("translucency" == propertyName)
47       return;
48     if ("argbSelection" == propertyName) {
49       colixSelection = C.getColix(((Integer) value).intValue());
50       return;
51     }
52     if ("argbHighlight" == propertyName) {
53       colixHighlight = C.getColix(((Integer) value).intValue());
54       return;
55     }
56     if ("highlight" == propertyName) {
57       bsHighlight = (BS) value;
58       return;
59     }
60 
61     if (propertyName == "deleteModelAtoms") {
62       BSUtil.deleteBits(bsHighlight, bs);
63       // pass through to AtomShape
64     }
65 
66     setPropAS(propertyName, value, bs);
67   }
68 
69   @Override
setModelVisibilityFlags(BS bs)70   public void setModelVisibilityFlags(BS bs) {
71     BS bsSelected = (vwr.getSelectionHalosEnabled() ? vwr.bsA() : null);
72     for (int i = ac; --i >= 0;)
73       if (atoms[i] != null)
74       atoms[i].setShapeVisibility(vf, bsSelected != null && bsSelected.get(i)
75           || mads != null && mads[i] != 0);
76   }
77 
78 //  @Override
79 //  public String getShapeState() {
80 //    // not implemented -- see org.jmol.viewer.StateCreator
81 //    return null;
82 //  }
83 //
84 }
85