From 1d21f595873869193bd4821e1af9c4eb56c5f158 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 19 Jan 2015 17:17:07 +0000 Subject: [PATCH] JAL-1636 typed collections now in ResidueProperties --- src/jalview/ext/jmol/JalviewJmolBinding.java | 11 ++++------- src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java | 8 ++------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/jalview/ext/jmol/JalviewJmolBinding.java b/src/jalview/ext/jmol/JalviewJmolBinding.java index 921e521..30998bd 100644 --- a/src/jalview/ext/jmol/JalviewJmolBinding.java +++ b/src/jalview/ext/jmol/JalviewJmolBinding.java @@ -46,7 +46,6 @@ import java.awt.event.ComponentListener; import java.io.File; import java.net.URL; import java.security.AccessControlException; -import java.util.Enumeration; import java.util.Hashtable; import java.util.List; import java.util.Map; @@ -1400,17 +1399,15 @@ public abstract class JalviewJmolBinding extends SequenceStructureBindingModel i return; } - String res; int index; Color col; jmolHistory(false); // TODO: Switch between nucleotide or aa selection expressions - Enumeration en = ResidueProperties.aa3Hash.keys(); - StringBuffer command = new StringBuffer("select *;color white;"); - while (en.hasMoreElements()) + StringBuilder command = new StringBuilder(128); + command.append("select *;color white;"); + for (String res : ResidueProperties.aa3Hash.keySet()) { - res = en.nextElement().toString(); - index = ((Integer) ResidueProperties.aa3Hash.get(res)).intValue(); + index = ResidueProperties.aa3Hash.get(res).intValue(); if (index > 20) { continue; diff --git a/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java b/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java index 7230baf..4975e3e 100644 --- a/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java +++ b/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java @@ -43,7 +43,6 @@ import java.awt.Color; import java.awt.event.ComponentEvent; import java.io.File; import java.util.ArrayList; -import java.util.Enumeration; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; @@ -1225,20 +1224,17 @@ public abstract class JalviewChimeraBinding extends return; } - String res; int index; Color col; // Chimera expects RBG values in the range 0-1 final double normalise = 255D; viewerCommandHistory(false); // TODO: Switch between nucleotide or aa selection expressions - Enumeration en = ResidueProperties.aa3Hash.keys(); StringBuilder command = new StringBuilder(128); command.append("color white;"); - while (en.hasMoreElements()) + for (String res : ResidueProperties.aa3Hash.keySet()) { - res = en.nextElement().toString(); - index = ((Integer) ResidueProperties.aa3Hash.get(res)).intValue(); + index = ResidueProperties.aa3Hash.get(res).intValue(); if (index > 20) { continue; -- 1.7.10.2