X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FUserColourScheme.java;h=660441e2fecf2ae8ff089a740bb8c5e1a0f12cba;hb=133e5d7be0ca295fd4ac4ccfa6c82165c795ea80;hp=bc5e8ea4f3dbe6f385a673a957b3d8df14254305;hpb=85867b5d46751cfce6500002e098a431fec0950e;p=jalview.git diff --git a/src/jalview/schemes/UserColourScheme.java b/src/jalview/schemes/UserColourScheme.java index bc5e8ea..660441e 100755 --- a/src/jalview/schemes/UserColourScheme.java +++ b/src/jalview/schemes/UserColourScheme.java @@ -1,5 +1,6 @@ -/* Jalview - a java multiple alignment editor - * Copyright (C) 1998 Michele Clamp +/* + * Jalview - A Sequence Alignment Editor and Viewer + * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -13,17 +14,55 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - package jalview.schemes; import java.awt.*; -public class UserColourScheme extends ResidueColourScheme +public class UserColourScheme + extends ResidueColourScheme { - public void setColourScheme(Color [] newColors) + protected String schemeName; + + public UserColourScheme(String colour) + { + Color col = null; + try{ + int value = Integer.parseInt(colour, 16); + col = new Color(value); + } + catch(NumberFormatException ex){} + + if(col==null) + col = ColourSchemeProperty.getAWTColorFromName(colour); + + if(col==null) + { + System.out.println("Unknown colour!! "+colour); + } + + colors = new Color[24]; + for(int i=0; i<24; i++) + colors[i] = col; + } + + public UserColourScheme(Color[] newColors) { colors = newColors; } + + public Color[] getColours() + { + return colors; + } + + public void setName(String name) + { + schemeName = name; + } + public String getName() + { + return schemeName; + } }