X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FPaintRefresher.java;h=6bec8fdd40fb68627f9f9cea0356bdd959d41aeb;hb=588042b69abf8e60bcc950b24c283933c7dd422f;hp=12545af3519f5dd18081a0a66d62794c76205975;hpb=5cd8e373c75fb348ecda4d94d8a46468fb92756d;p=jalview.git diff --git a/src/jalview/gui/PaintRefresher.java b/src/jalview/gui/PaintRefresher.java index 12545af..6bec8fd 100755 --- a/src/jalview/gui/PaintRefresher.java +++ b/src/jalview/gui/PaintRefresher.java @@ -1,54 +1,62 @@ /* -* 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 -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. -* -* 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. -* -* 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 - 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 + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * 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. + * + * 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 + */ package jalview.gui; -import java.awt.*; + import java.util.*; +import java.awt.*; + public class PaintRefresher { static Vector components = new Vector(); public static void Register(Component c) { - if(!components.contains(c)) + if (!components.contains(c)) + { components.add(c); + } else + { components.remove(c); + } } public static void Refresh(Component c) { Component temp; Enumeration e = components.elements(); - while( e.hasMoreElements() ) + + while (e.hasMoreElements()) { - temp = (Component)e.nextElement(); + temp = (Component) e.nextElement(); - if(!temp.isValid()) - components.removeElement( temp ); - else if( temp == c ) - continue; + if (!temp.isValid()) + { + components.removeElement(temp); + } + else if (temp == c) + { + continue; + } temp.repaint(); } - } - }