X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fjbgui%2FGSequenceLink.java;h=b412f6c92977d2dc16e4ce857c26afd58949762a;hb=1576c6118a09c59098483daa16a94e9cca8de260;hp=40d00be9f32c7195cb19d9f9eac16a19106f55a2;hpb=988f114b8ade17976c45693a1da84eda2dbd6e3f;p=jalview.git diff --git a/src/jalview/jbgui/GSequenceLink.java b/src/jalview/jbgui/GSequenceLink.java index 40d00be..b412f6c 100755 --- a/src/jalview/jbgui/GSequenceLink.java +++ b/src/jalview/jbgui/GSequenceLink.java @@ -1,17 +1,17 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer - * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle - * + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4) + * Copyright (C) 2008 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 @@ -24,23 +24,20 @@ import java.awt.*; import java.awt.event.*; import javax.swing.*; -public class GSequenceLink - extends Panel +public class GSequenceLink extends Panel { public GSequenceLink() { try { jbInit(); - } - catch (Exception ex) + } catch (Exception ex) { ex.printStackTrace(); } } - private void jbInit() - throws Exception + private void jbInit() throws Exception { this.setLayout(gridBagLayout1); nameTB.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11)); @@ -84,10 +81,9 @@ public class GSequenceLink jPanel1.add(jLabel2); jPanel1.add(jLabel3); jPanel1.add(jLabel4); - this.add(jPanel1, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0 - , GridBagConstraints.CENTER, - GridBagConstraints.BOTH, - new Insets(5, 4, 6, 5), 390, 130)); + this.add(jPanel1, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, + GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets( + 5, 4, 6, 5), 390, 130)); } public void setName(String name) @@ -112,27 +108,36 @@ public class GSequenceLink public boolean checkValid() { - UrlLink ul = new UrlLink("foo|"+urlTB.getText().trim()); - if (ul.isValid()&&ul.isDynamic()) + UrlLink ul = new UrlLink("foo|" + urlTB.getText().trim()); + if (ul.isValid() && ul.isDynamic()) { return true; } - - JOptionPane.showInternalMessageDialog(jalview.gui.Desktop.desktop, - "Sequence URL must contain $SEQUENCE_ID$ or a regex $SEQUENCE_ID=//=$", - "URL not valid", - JOptionPane.WARNING_MESSAGE); + + JOptionPane + .showInternalMessageDialog( + jalview.gui.Desktop.desktop, + "Sequence URL must contain $SEQUENCE_ID$ or a regex $SEQUENCE_ID=//=$", + "URL not valid", JOptionPane.WARNING_MESSAGE); return false; } JTextField nameTB = new JTextField(); + JTextField urlTB = new JTextField(); + JLabel jLabel1 = new JLabel(); + JLabel jLabel2 = new JLabel(); + JLabel jLabel3 = new JLabel(); + JLabel jLabel4 = new JLabel(); + JPanel jPanel1 = new JPanel(); + GridBagLayout gridBagLayout1 = new GridBagLayout(); + public void nameTB_keyTyped(KeyEvent e) { if (e.getKeyChar() == '|') @@ -144,10 +149,10 @@ public class GSequenceLink public void urlTB_keyTyped(KeyEvent e) { // URLLink object validation takes care of incorrect regexes. - //if (e.getKeyChar() == '|' || e.getKeyChar() == ' ') - //{ - // e.consume(); - // } + // if (e.getKeyChar() == '|' || e.getKeyChar() == ' ') + // { + // e.consume(); + // } } }