* along with this program; if not, write to the Free Software\r
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA\r
*/\r
-\r
package jalview.schemes;\r
\r
import jalview.datamodel.*;\r
-import java.util.*;\r
+\r
import java.awt.*;\r
\r
+import java.util.*;\r
+\r
+\r
public class PIDColourScheme extends ResidueColourScheme {\r
public Color[] pidColours;\r
public float[] thresholds;\r
-\r
SequenceGroup group;\r
\r
public PIDColourScheme() {\r
- this.pidColours = ResidueProperties.pidColours;\r
- this.thresholds = ResidueProperties.pidThresholds;\r
+ this.pidColours = ResidueProperties.pidColours;\r
+ this.thresholds = ResidueProperties.pidThresholds;\r
}\r
\r
+ public Color findColour(String s, int j) {\r
+ if ((threshold != 0) && !aboveThreshold(s, j)) {\r
+ return Color.white;\r
+ }\r
\r
+ Color c = Color.white;\r
+ Hashtable hash = (Hashtable) consensus.elementAt(j);\r
\r
- public Color findColour(String s, int j) {\r
+ double sc = 0;\r
\r
- if( threshold!=0 && !aboveThreshold(s,j))\r
- return Color.white;\r
+ if ((Integer.parseInt(hash.get("maxCount").toString()) != -1) &&\r
+ hash.contains(s)) {\r
+ sc = (((Integer) hash.get(s)).intValue() * 100.0) / ((Integer) hash.get(\r
+ "size")).intValue();\r
\r
- Color c = Color.white;\r
- Hashtable hash = (Hashtable)consensus.elementAt(j);\r
+ // MC Should be isGap\r
+ if (!jalview.util.Comparison.isGap((s.charAt(0)))) {\r
+ for (int i = 0; i < thresholds.length; i++) {\r
+ if (sc > thresholds[i]) {\r
+ c = pidColours[i];\r
\r
- double sc = 0;\r
- if ( Integer.parseInt( hash.get("maxCount").toString() ) != -1 && hash.contains(s))\r
- {\r
- sc = ( (Integer) hash.get(s)).intValue() * 100.0 / ((Integer)hash.get("size")).intValue() ;\r
- // MC Should be isGap\r
- if (!jalview.util.Comparison.isGap((s.charAt(0))))\r
- {\r
- for (int i = 0; i < thresholds.length; i++)\r
- {\r
- if (sc > thresholds[i])\r
- {\r
- c = pidColours[i];\r
- break;\r
+ break;\r
+ }\r
+ }\r
}\r
- }\r
}\r
\r
- }\r
- return c;\r
- }\r
+ return c;\r
+ }\r
}\r