X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FUserDefinedColours.java;h=792ef7d2e81b5d55cd1a791a7aa0f933471ca47c;hb=a45774ee31d9f35d4eff46d54d7deab719afb092;hp=83f9d0ce8d590bd037beb7fb0d2c8e47a38287d5;hpb=3825c0853b33c036d396bb9e3f8b4d7b4966e5ad;p=jalview.git diff --git a/src/jalview/gui/UserDefinedColours.java b/src/jalview/gui/UserDefinedColours.java index 83f9d0c..792ef7d 100755 --- a/src/jalview/gui/UserDefinedColours.java +++ b/src/jalview/gui/UserDefinedColours.java @@ -1,20 +1,19 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4) - * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7) + * Copyright (C) 2011 J Procter, AM Waterhouse, 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 - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This file is part of Jalview. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. * - * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with Jalview. If not, see . */ package jalview.gui; @@ -60,9 +59,9 @@ public class UserDefinedColours extends GUserDefinedColours implements * Creates a new UserDefinedColours object. * * @param ap - * DOCUMENT ME! + * DOCUMENT ME! * @param sg - * DOCUMENT ME! + * DOCUMENT ME! */ public UserDefinedColours(AlignmentPanel ap, SequenceGroup sg) { @@ -218,7 +217,7 @@ public class UserDefinedColours extends GUserDefinedColours implements * DOCUMENT ME! * * @param evt - * DOCUMENT ME! + * DOCUMENT ME! */ public void stateChanged(ChangeEvent evt) { @@ -249,7 +248,7 @@ public class UserDefinedColours extends GUserDefinedColours implements * DOCUMENT ME! * * @param e - * DOCUMENT ME! + * DOCUMENT ME! */ public void colourButtonPressed(MouseEvent e) { @@ -298,9 +297,7 @@ public class UserDefinedColours extends GUserDefinedColours implements JButton button = (JButton) buttonPanel.getComponent(b); if (!selectedButtons.contains(button)) { - button - .setForeground(button.getBackground().brighter() - .brighter()); + button.setForeground(button.getBackground().brighter().brighter()); selectedButtons.add(button); } } @@ -326,9 +323,7 @@ public class UserDefinedColours extends GUserDefinedColours implements } else { - pressed - .setForeground(pressed.getBackground().brighter() - .brighter()); + pressed.setForeground(pressed.getBackground().brighter().brighter()); selectedButtons.addElement(pressed); } } @@ -344,9 +339,9 @@ public class UserDefinedColours extends GUserDefinedColours implements * DOCUMENT ME! * * @param label - * DOCUMENT ME! + * DOCUMENT ME! * @param aa - * DOCUMENT ME! + * DOCUMENT ME! */ JButton makeButton(String label, String aa, Vector caseSensitiveButtons, int buttonIndex) @@ -373,7 +368,7 @@ public class UserDefinedColours extends GUserDefinedColours implements caseSensitiveButtons.addElement(button); col = Color.white; - if (oldColourScheme!=null) + if (oldColourScheme != null) { try { @@ -405,7 +400,7 @@ public class UserDefinedColours extends GUserDefinedColours implements * DOCUMENT ME! * * @param e - * DOCUMENT ME! + * DOCUMENT ME! */ protected void okButton_actionPerformed(ActionEvent e) { @@ -423,7 +418,7 @@ public class UserDefinedColours extends GUserDefinedColours implements * DOCUMENT ME! * * @param e - * DOCUMENT ME! + * DOCUMENT ME! */ protected void applyButton_actionPerformed(ActionEvent e) { @@ -481,17 +476,17 @@ public class UserDefinedColours extends GUserDefinedColours implements * DOCUMENT ME! * * @param e - * DOCUMENT ME! + * DOCUMENT ME! */ protected void loadbutton_actionPerformed(ActionEvent e) { upperCaseButtons = new Vector(); lowerCaseButtons = new Vector(); - JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache - .getProperty("LAST_DIRECTORY"), new String[] - { "jc" }, new String[] - { "Jalview User Colours" }, "Jalview User Colours"); + JalviewFileChooser chooser = new JalviewFileChooser( + jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] + { "jc" }, new String[] + { "Jalview User Colours" }, "Jalview User Colours"); chooser.setFileView(new jalview.io.JalviewFileView()); chooser.setDialogTitle("Load colour scheme"); chooser.setToolTipText("Load"); @@ -581,7 +576,7 @@ public class UserDefinedColours extends GUserDefinedColours implements * DOCUMENT ME! * * @param file - * DOCUMENT ME! + * DOCUMENT ME! * * @return DOCUMENT ME! */ @@ -694,7 +689,7 @@ public class UserDefinedColours extends GUserDefinedColours implements * DOCUMENT ME! * * @param e - * DOCUMENT ME! + * DOCUMENT ME! */ protected void savebutton_actionPerformed(ActionEvent e) { @@ -709,7 +704,8 @@ public class UserDefinedColours extends GUserDefinedColours implements if (userColourSchemes != null && userColourSchemes.containsKey(schemeName.getText())) { - int reply = JOptionPane.showInternalConfirmDialog(Desktop.desktop, + int reply = JOptionPane.showInternalConfirmDialog( + Desktop.desktop, "Colour scheme " + schemeName.getText() + " exists." + "\nContinue saving colour scheme as " + schemeName.getText() + "?", @@ -721,10 +717,10 @@ public class UserDefinedColours extends GUserDefinedColours implements userColourSchemes.remove(schemeName.getText()); } - JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache - .getProperty("LAST_DIRECTORY"), new String[] - { "jc" }, new String[] - { "Jalview User Colours" }, "Jalview User Colours"); + JalviewFileChooser chooser = new JalviewFileChooser( + jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] + { "jc" }, new String[] + { "Jalview User Colours" }, "Jalview User Colours"); chooser.setFileView(new jalview.io.JalviewFileView()); chooser.setDialogTitle("Save colour scheme"); @@ -783,7 +779,7 @@ public class UserDefinedColours extends GUserDefinedColours implements * DOCUMENT ME! * * @param e - * DOCUMENT ME! + * DOCUMENT ME! */ protected void cancelButton_actionPerformed(ActionEvent e) { @@ -857,8 +853,8 @@ public class UserDefinedColours extends GUserDefinedColours implements { if (coloursFound.toString().length() > 1) { - jalview.bin.Cache.setProperty("USER_DEFINED_COLOURS", coloursFound - .toString()); + jalview.bin.Cache.setProperty("USER_DEFINED_COLOURS", + coloursFound.toString()); } else { @@ -877,8 +873,8 @@ public class UserDefinedColours extends GUserDefinedColours implements userColourSchemes = new Hashtable(); StringBuffer coloursFound = new StringBuffer(); - StringTokenizer st = new StringTokenizer(jalview.bin.Cache - .getProperty("USER_DEFINED_COLOURS"), "|"); + StringTokenizer st = new StringTokenizer( + jalview.bin.Cache.getProperty("USER_DEFINED_COLOURS"), "|"); while (st.hasMoreElements()) { @@ -903,8 +899,8 @@ public class UserDefinedColours extends GUserDefinedColours implements if (coloursFound.toString().length() > 1) { - jalview.bin.Cache.setProperty("USER_DEFINED_COLOURS", coloursFound - .toString()); + jalview.bin.Cache.setProperty("USER_DEFINED_COLOURS", + coloursFound.toString()); } else {