X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fjalview%2Fjbgui%2FGWsPreferences.java;h=ad65bff7dc27f420d0882cd35e0aa5d1914de22c;hb=3f72d101fbeb83a7526a3c4f8f62cfe8e8a0189d;hp=7885d1265b9099348a400082de2bed4d6072376f;hpb=439d5ad378494d0afa9668e2308ad605c51afcc0;p=jalview.git
diff --git a/src/jalview/jbgui/GWsPreferences.java b/src/jalview/jbgui/GWsPreferences.java
index 7885d12..ad65bff 100644
--- a/src/jalview/jbgui/GWsPreferences.java
+++ b/src/jalview/jbgui/GWsPreferences.java
@@ -1,5 +1,19 @@
-/**
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ *
+ * This file is part of Jalview.
+ *
+ * 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.
+ *
+ * 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.jbgui;
@@ -21,6 +35,7 @@ import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.JScrollPane;
+import javax.swing.JTabbedPane;
import javax.swing.ListSelectionModel;
import javax.swing.SwingConstants;
import javax.swing.border.TitledBorder;
@@ -32,6 +47,17 @@ import javax.swing.border.TitledBorder;
*/
public class GWsPreferences extends JPanel
{
+ protected JList sbrsList = new JList();
+
+ protected TitledBorder sbrsListTitleBorder = new TitledBorder(
+ "Simple Bioinformatics Rest Services");
+
+ protected JButton newSbrsUrl = new JButton();
+
+ protected JButton editSbrsUrl = new JButton();
+
+ protected JButton deleteSbrsUrl = new JButton();
+
protected JList wsList = new JList();
protected TitledBorder wsListTitleBorder = new TitledBorder(
@@ -51,39 +77,56 @@ public class GWsPreferences extends JPanel
protected JCheckBox indexByType = new JCheckBox();
- protected JCheckBox enableJws1Services = new JCheckBox();
-
protected JCheckBox enableJws2Services = new JCheckBox();
protected JCheckBox enableEnfinServices = new JCheckBox();
+ protected JCheckBox displayWsWarning = new JCheckBox();
+
protected JButton refreshWs = new JButton();
+
protected JButton resetWs = new JButton();
-
+
protected JProgressBar progressBar = new JProgressBar();
JScrollPane wsListPane = new JScrollPane();
-
+
JPanel wsListUrlPanel = new JPanel();
-
+
JPanel wsListPanel = new JPanel();
JPanel wsListButtons = new JPanel();
-
+
JPanel wsListNavButs = new JPanel();
+ JScrollPane srbsListPane = new JScrollPane();
+
+ JPanel srbsListUrlPanel = new JPanel();
+
+ JPanel srbsListPanel = new JPanel();
+
+ JPanel srbsListButtons = new JPanel();
+
+ JPanel srbsListNavButs = new JPanel();
+
BorderLayout myBorderlayout = new BorderLayout();
BorderLayout wsListBorderlayout = new BorderLayout();
+
+ BorderLayout srbsListBorderlayout = new BorderLayout();
GridBagLayout wsPrefLayout = new GridBagLayout();
GridBagLayout wsListLayout = new GridBagLayout();
+ GridBagLayout srbsListLayout = new GridBagLayout();
+
GridBagLayout wsMenuLayout = new GridBagLayout();
JPanel wsMenuButtons = new JPanel();
+
JPanel wsMenuRefreshButs = new JPanel();
+
public GWsPreferences()
{
jbInit();
@@ -103,7 +146,7 @@ public class GWsPreferences extends JPanel
});
resetWs.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
resetWs.setText("Reset Services");
-
+
resetWs.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
@@ -143,7 +186,7 @@ public class GWsPreferences extends JPanel
});
enableJws2Services
.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
- enableJws2Services.setText("Enable JWS2 Services");
+ enableJws2Services.setText("Enable JABAWS Services");
enableJws2Services.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
@@ -151,14 +194,15 @@ public class GWsPreferences extends JPanel
enableJws2Services_actionPerformed(e);
}
});
- enableJws1Services
- .setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
- enableJws1Services.setText("Enable JWS1 Services");
- enableJws1Services.addActionListener(new ActionListener()
+ displayWsWarning.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
+ displayWsWarning.setText("Display warnings");
+ displayWsWarning
+ .setToolTipText("Check this option if you want to be informed
when a web service URL cannot be accessed by Jalview
when it starts up");
+ displayWsWarning.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
- enableJws1Services_actionPerformed(e);
+ displayWsWarning_actionPerformed(e);
}
});
newWsUrl.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
@@ -209,32 +253,61 @@ public class GWsPreferences extends JPanel
moveWsUrlDown_actionPerformed(e);
}
});
+ newSbrsUrl.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
+ newSbrsUrl.setText("Add a SBRS definition");
+ newSbrsUrl.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ newSbrsUrl_actionPerformed(e);
+ }
+ });
+ editSbrsUrl.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
+ editSbrsUrl.setText("Edit SBRS definition");
+ editSbrsUrl.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ editSbrsUrl_actionPerformed(e);
+ }
+ });
+
+ deleteSbrsUrl.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
+ deleteSbrsUrl.setText("Delete SBRS definition");
+ deleteSbrsUrl.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ deleteSbrsUrl_actionPerformed(e);
+ }
+ });
setLayout(myBorderlayout);
- setPreferredSize(new Dimension(500,400));
+ setPreferredSize(new Dimension(500, 400));
progressBar.setPreferredSize(new Dimension(450, 20));
progressBar.setString("");
wsListUrlPanel.setBorder(BorderFactory.createEtchedBorder());
wsListUrlPanel.setLayout(new BorderLayout());
-// wsListUrlPanel.setPreferredSize(new Dimension(482,202));
+ // wsListUrlPanel.setPreferredSize(new Dimension(482,202));
wsListPane.setBorder(BorderFactory.createEtchedBorder());
wsListPane.getViewport().add(wsList);
- wsListPane.setPreferredSize(new Dimension(380, 200));
+ // wsListPane.setPreferredSize(new Dimension(380, 80));
wsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- wsList.addMouseListener(new MouseListener() {
+ wsList.addMouseListener(new MouseListener()
+ {
public void mouseClicked(MouseEvent e)
{
- if (e.getClickCount()>1)
+ if (e.getClickCount() > 1)
{
editWsUrl_actionPerformed(null);
}
-
+
}
public void mouseEntered(MouseEvent e)
{
-
+
}
public void mouseExited(MouseEvent e)
@@ -243,56 +316,136 @@ public class GWsPreferences extends JPanel
public void mousePressed(MouseEvent e)
{
-
+
}
public void mouseReleased(MouseEvent e)
{
-
+
}
-
+
});
-// wsListButtons.setPreferredSize(new Dimension(480, 60));
+ // wsListButtons.setPreferredSize(new Dimension(480, 60));
wsListButtons.setLayout(new FlowLayout());
- //wsListButtons.add(moveWsUrlUp);
- //wsListButtons.add(moveWsUrlDown);
+ // wsListButtons.add(moveWsUrlUp);
+ // wsListButtons.add(moveWsUrlDown);
wsListButtons.add(newWsUrl);
wsListButtons.add(editWsUrl);
wsListButtons.add(deleteWsUrl);
- wsListNavButs.setSize(new Dimension(80,80));
- wsListNavButs.setPreferredSize(new Dimension(80,80));
+ wsListNavButs.setSize(new Dimension(80, 80));
+ wsListNavButs.setPreferredSize(new Dimension(80, 80));
wsListNavButs.setLayout(new FlowLayout());
wsListNavButs.add(moveWsUrlUp);
wsListNavButs.add(moveWsUrlDown);
- wsListUrlPanel.add(wsListPane,BorderLayout.EAST);
- wsListUrlPanel.add(wsListNavButs,BorderLayout.WEST);
+ wsListUrlPanel.add(wsListPane, BorderLayout.CENTER);
+ wsListUrlPanel.add(wsListNavButs, BorderLayout.WEST);
wsListPanel.setBorder(wsListTitleBorder);
wsListPanel.setLayout(new BorderLayout());
wsListPanel.add(wsListUrlPanel, BorderLayout.NORTH);
wsListPanel.add(wsListButtons, BorderLayout.SOUTH);
- wsMenuButtons.setLayout(new GridLayout(2,3));
+
+ srbsListUrlPanel.setBorder(BorderFactory.createEtchedBorder());
+ srbsListUrlPanel.setLayout(new BorderLayout());
+ srbsListPane.setBorder(BorderFactory.createEtchedBorder());
+ srbsListPane.getViewport().add(sbrsList);
+ //srbsListPane.setMinimumSize(new Dimension(380, 80));
+ sbrsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ sbrsList.addMouseListener(new MouseListener()
+ {
+
+ public void mouseClicked(MouseEvent e)
+ {
+ if (e.getClickCount() > 1)
+ {
+ editSbrsUrl_actionPerformed(null);
+ }
+
+ }
+
+ public void mouseEntered(MouseEvent e)
+ {
+
+ }
+
+ public void mouseExited(MouseEvent e)
+ {
+ }
+
+ public void mousePressed(MouseEvent e)
+ {
+
+ }
+
+ public void mouseReleased(MouseEvent e)
+ {
+
+ }
+
+ });
+ srbsListButtons.setLayout(new FlowLayout());
+ srbsListButtons.add(newSbrsUrl);
+ srbsListButtons.add(editSbrsUrl);
+ srbsListButtons.add(deleteSbrsUrl);
+ srbsListUrlPanel.add(srbsListPane, BorderLayout.CENTER);
+ srbsListPanel.setBorder(sbrsListTitleBorder);
+ srbsListPanel.setLayout(new BorderLayout());
+ srbsListPanel.add(srbsListUrlPanel, BorderLayout.NORTH);
+ srbsListPanel.add(srbsListButtons, BorderLayout.CENTER);
+
+ wsMenuButtons.setLayout(new GridLayout(2, 3));
wsMenuButtons.add(indexByHost);
wsMenuButtons.add(indexByType);
- wsMenuButtons.add(enableJws1Services);
wsMenuButtons.add(enableJws2Services);
wsMenuButtons.add(enableEnfinServices);
+ wsMenuButtons.add(displayWsWarning);
wsMenuRefreshButs.setLayout(new FlowLayout());
- wsMenuRefreshButs.setPreferredSize(new Dimension(480,30));
- wsMenuRefreshButs.setSize(new Dimension(480,30));
- wsMenuRefreshButs.add(refreshWs,null);
- wsMenuRefreshButs.add(resetWs,null);
- wsMenuRefreshButs.add(progressBar,null);
+ wsMenuRefreshButs.setPreferredSize(new Dimension(480, 30));
+ wsMenuRefreshButs.setSize(new Dimension(480, 30));
+ wsMenuRefreshButs.add(refreshWs, null);
+ wsMenuRefreshButs.add(resetWs, null);
+ wsMenuRefreshButs.add(progressBar, null);
myBorderlayout.setHgap(3);
- add(wsListPanel,BorderLayout.NORTH);
- add(wsMenuButtons,BorderLayout.CENTER);
+ if (jalview.bin.Cache.getDefault("ENABLE_RSBS_EDITOR",false)) {
+ JTabbedPane listPanels=new JTabbedPane();
+ listPanels.addTab("JABAWS Servers",wsListPanel);
+ listPanels.addTab("RSB Services", srbsListPanel);
+ add(listPanels, BorderLayout.NORTH);
+ } else {
+ add(wsListPanel, BorderLayout.NORTH);
+ }
+ add(wsMenuButtons, BorderLayout.CENTER);
add(wsMenuRefreshButs, BorderLayout.SOUTH);
}
- protected void resetWs_actionPerformed(ActionEvent e)
+ protected void deleteSbrsUrl_actionPerformed(ActionEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ protected void editSbrsUrl_actionPerformed(ActionEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ protected void newSbrsUrl_actionPerformed(ActionEvent e)
{
+ // TODO Auto-generated method stub
}
+ protected void displayWsWarning_actionPerformed(ActionEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ protected void resetWs_actionPerformed(ActionEvent e)
+ {
+
+ }
+
protected void indexByType_actionPerformed(ActionEvent e)
{
@@ -338,11 +491,6 @@ public class GWsPreferences extends JPanel
}
- protected void enableJws1Services_actionPerformed(ActionEvent e)
- {
-
- }
-
protected void refreshWs_actionPerformed(ActionEvent e)
{