From: Michael T H. <mic...@us...> - 2003-08-12 18:42:37
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol In directory sc8-pr-cvs1:/tmp/cvs-serv23184/src/org/openscience/jmol Modified Files: ClientAtomAdapter.java DeprecatedAtomAdapter.java DisplayControl.java Distributor.java LabelManager.java Log Message: eliminated AtomColors and tweaked ClientAtomAdapter interface Index: ClientAtomAdapter.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/ClientAtomAdapter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ClientAtomAdapter.java 12 Aug 2003 14:38:42 -0000 1.1 +++ ClientAtomAdapter.java 12 Aug 2003 18:18:09 -0000 1.2 @@ -35,10 +35,10 @@ public final static int COLORSCHEME_MAX = 2; public int getAtomicNumber(Object clientAtom); - public String getAtomicSymbol(Object clientAtom); - public String getAtomTypeName(Object clientAtom); - public double getVanderwaalsRadius(Object clientAtom); + public String getAtomicSymbol(int atomicNumber, Object clientAtom); + public String getAtomTypeName(int atomicNumber, Object clientAtom); + public double getVanderwaalsRadius(int atomicNumber, Object clientAtom); public Point3d getPoint3d(Object clientAtom); public ProteinProp getProteinProp(Object clientAtom); - public Color getColor(Object clientAtom, int colorScheme); + public Color getColor(int atomicNumber, Object clientAtom, int colorScheme); } Index: DeprecatedAtomAdapter.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/DeprecatedAtomAdapter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- DeprecatedAtomAdapter.java 12 Aug 2003 14:38:42 -0000 1.1 +++ DeprecatedAtomAdapter.java 12 Aug 2003 18:18:09 -0000 1.2 @@ -45,15 +45,15 @@ return ((Atom)clientAtom).getAtomicNumber(); } - public String getAtomicSymbol(Object clientAtom) { + public String getAtomicSymbol(int atomicNumber, Object clientAtom) { return ((Atom)clientAtom).getSymbol(); } - public String getAtomTypeName(Object clientAtom) { + public String getAtomTypeName(int atomicNumber, Object clientAtom) { return ((Atom)clientAtom).getAtomTypeName(); } - public double getVanderwaalsRadius(Object clientAtom) { + public double getVanderwaalsRadius(int atomicNumber, Object clientAtom) { return ((Atom)clientAtom).getVanderwaalsRadius(); } @@ -65,7 +65,7 @@ return ((Atom)clientAtom).getProteinProp(); } - public Color getColor(Object clientAtom, int colorScheme) { + public Color getColor(int atomicNumber, Object clientAtom, int colorScheme) { if (colorScheme >= colorSchemes.length || colorSchemes[colorScheme] == null) colorScheme = 0; Index: DisplayControl.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/DisplayControl.java,v retrieving revision 1.119 retrieving revision 1.120 diff -u -r1.119 -r1.120 --- DisplayControl.java 12 Aug 2003 14:52:20 -0000 1.119 +++ DisplayControl.java 12 Aug 2003 18:18:09 -0000 1.120 @@ -1567,19 +1567,24 @@ return labelManager.styleLabel; } - public String getLabelAtom(Object clientAtom) { + public String getLabelAtom(int atomicNumber, Object clientAtom, + int atomIndex) { return labelManager.getLabelAtom(labelManager.styleLabel, - (Atom)clientAtom); + atomicNumber, clientAtom, atomIndex); } - public String getLabelAtom(byte styleLabel, Object clientAtom) { - return labelManager.getLabelAtom(styleLabel, - (Atom)clientAtom); + public String getLabelAtom(byte styleLabel, + int atomicNumber, Object clientAtom, + int atomIndex) { + return labelManager.getLabelAtom(styleLabel, atomicNumber, clientAtom, + atomIndex); } - public String getLabelAtom(String strLabel, Object clientAtom) { - return labelManager.getLabelAtom(strLabel, - (Atom)clientAtom); + public String getLabelAtom(String strLabel, + int atomicNumber, Object clientAtom, + int atomIndex) { + return labelManager.getLabelAtom(strLabel, atomicNumber, clientAtom, + atomIndex); } public void setLabelFontSize(int points) { @@ -1671,16 +1676,16 @@ return clientAtomAdapter.getAtomicNumber(clientAtom); } - public String getAtomicSymbol(Object clientAtom) { - return clientAtomAdapter.getAtomicSymbol(clientAtom); + public String getAtomicSymbol(int atomicNumber, Object clientAtom) { + return clientAtomAdapter.getAtomicSymbol(atomicNumber, clientAtom); } - public String getAtomTypeName(Object clientAtom) { - return clientAtomAdapter.getAtomTypeName(clientAtom); + public String getAtomTypeName(int atomicNumber, Object clientAtom) { + return clientAtomAdapter.getAtomTypeName(atomicNumber, clientAtom); } - public double getVanderwaalsRadius(Object clientAtom) { - return clientAtomAdapter.getVanderwaalsRadius(clientAtom); + public double getVanderwaalsRadius(int atomicNumber, Object clientAtom) { + return clientAtomAdapter.getVanderwaalsRadius(atomicNumber, clientAtom); } public Point3d getPoint3d(Object clientAtom) { @@ -1691,12 +1696,14 @@ return clientAtomAdapter.getProteinProp(clientAtom); } - public short getColixAtom(Object clientAtom) { - return Colix.getColix(clientAtomAdapter.getColor(clientAtom, - colorManager.modeAtomColorProfile)); + public short getColixAtom(int atomicNumber, Object clientAtom) { + return Colix.getColix(clientAtomAdapter.getColor( + atomicNumber, clientAtom, colorManager.modeAtomColorProfile)); } - public short getColixAtom(byte mode, Object clientAtom) { - return Colix.getColix(clientAtomAdapter.getColor(clientAtom, mode)); + public short getColixAtom(int atomicNumber, Object clientAtom, byte scheme) { + return Colix.getColix(clientAtomAdapter.getColor(atomicNumber, + clientAtom, + scheme)); } } Index: Distributor.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/Distributor.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- Distributor.java 12 Aug 2003 14:38:42 -0000 1.17 +++ Distributor.java 12 Aug 2003 18:18:09 -0000 1.18 @@ -90,7 +90,9 @@ while (iter.hasNext()) { AtomShape atomShape = iter.next(); atomShape.setLabel(control.getLabelAtom(styleLabel, - atomShape.clientAtom)); + atomShape.atomicNumber, + atomShape.clientAtom, + atomShape.atomIndex)); } } @@ -98,7 +100,9 @@ while (iter.hasNext()) { AtomShape atomShape = iter.next(); atomShape.setLabel(control.getLabelAtom(strLabel, - atomShape.clientAtom)); + atomShape.atomicNumber, + atomShape.clientAtom, + atomShape.atomIndex)); } } @@ -108,7 +112,8 @@ while (iter.hasNext()) { AtomShape atomShape = iter.next(); if (colixDots == 0) - colixT = control.getColixAtom(atomShape.clientAtom); + colixT = control.getColixAtom(atomShape.atomicNumber, + atomShape.clientAtom); atomShape.setColixMarDots(colixT, marDots); } } Index: LabelManager.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/LabelManager.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- LabelManager.java 21 Jul 2003 20:19:22 -0000 1.11 +++ LabelManager.java 12 Aug 2003 18:18:09 -0000 1.12 @@ -78,27 +78,30 @@ this.pointsLabelFontSize = points; } - public String getLabelAtom(byte styleLabel, Atom atom) { + public String getLabelAtom(byte styleLabel, + int atomicNumber, Object clientAtom, + int atomIndex) { String label = null; switch (styleLabel) { case DisplayControl.SYMBOLS: - label = atom.getSymbol(); + label = control.getAtomicSymbol(atomicNumber, clientAtom); break; case DisplayControl.TYPES: - label = atom.getAtomTypeName(); + label = control.getAtomTypeName(atomicNumber, clientAtom); break; case DisplayControl.NUMBERS: - // Note that this is incremented by one for display purposes - label = "" + (atom.getAtomNumber() + 1); + label = "" + atomIndex; break; } return label; } - public String getLabelAtom(String strFormat, Atom atom) { + public String getLabelAtom(String strFormat, + int atomicNumber, Object clientAtom, + int atomIndex) { if (strFormat == null || strFormat.equals("")) return null; - ProteinProp pprop = atom.getProteinProp(); + ProteinProp pprop = control.getProteinProp(clientAtom); String strLabel = ""; String strExpansion = ""; int ich = 0; @@ -117,11 +120,11 @@ ch = strFormat.charAt(ich++); switch (ch) { case 'i': - strExpansion = "" + atom.getAtomNumber() + 1; + strExpansion = "" + atomIndex; break; case 'a': // FIXME -- mth -- a is not the same as e case 'e': - strExpansion = atom.getSymbol(); + strExpansion = control.getAtomicSymbol(atomicNumber, clientAtom); break; case 'b': // these two are the same case 't': |