X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fjbgui%2FGWsPreferences.java;h=c3fd4fabecf4a091bdec1b113113a1ca864a0a7a;hb=0b93ce8953aaec40a5e06f076cd0b7378f44291d;hp=da9322c7fe248cd0a73c169f27054b87697254ac;hpb=077fea81a02a33eefed6895bfa7cff993609dab8;p=jalview.git
diff --git a/src/jalview/jbgui/GWsPreferences.java b/src/jalview/jbgui/GWsPreferences.java
index da9322c..c3fd4fa 100644
--- a/src/jalview/jbgui/GWsPreferences.java
+++ b/src/jalview/jbgui/GWsPreferences.java
@@ -1,22 +1,27 @@
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
- * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* 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.
- *
+ * 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 .
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see .
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.jbgui;
+import jalview.util.MessageManager;
+
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
@@ -35,8 +40,9 @@ import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.JScrollPane;
+import javax.swing.JTabbedPane;
+import javax.swing.JTable;
import javax.swing.ListSelectionModel;
-import javax.swing.SwingConstants;
import javax.swing.border.TitledBorder;
/**
@@ -46,10 +52,23 @@ import javax.swing.border.TitledBorder;
*/
public class GWsPreferences extends JPanel
{
- protected JList wsList = new JList();
+ protected JList sbrsList = new JList();
+
+ protected TitledBorder sbrsListTitleBorder = new TitledBorder(
+ MessageManager
+ .getString("label.simple_bioinformatics_rest_services"));
+
+ protected JButton newSbrsUrl = new JButton();
+
+ protected JButton editSbrsUrl = new JButton();
+
+ protected JButton deleteSbrsUrl = new JButton();
+
+ // Web service status and url table
+ protected JTable wsList = new JTable();
protected TitledBorder wsListTitleBorder = new TitledBorder(
- "Web Service Discovery URLS");
+ MessageManager.getString("label.web_service_discovery_urls"));
protected JButton newWsUrl = new JButton();
@@ -65,8 +84,6 @@ 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();
@@ -89,14 +106,28 @@ public class GWsPreferences extends 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();
@@ -112,7 +143,7 @@ public class GWsPreferences extends JPanel
{
refreshWs.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
- refreshWs.setText("Refresh Services");
+ refreshWs.setText(MessageManager.getString("action.refresh_services"));
refreshWs.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
@@ -121,7 +152,7 @@ public class GWsPreferences extends JPanel
}
});
resetWs.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
- resetWs.setText("Reset Services");
+ resetWs.setText(MessageManager.getString("action.reset_services"));
resetWs.addActionListener(new ActionListener()
{
@@ -131,9 +162,9 @@ public class GWsPreferences extends JPanel
}
});
indexByHost.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
- indexByHost.setText("Index by host");
- indexByHost
- .setToolTipText("Index web services in menu by the host site.");
+ indexByHost.setText(MessageManager.getString("label.index_by_host"));
+ indexByHost.setToolTipText(MessageManager
+ .getString("label.index_web_services_menu_by_host_site"));
indexByHost.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
@@ -142,7 +173,7 @@ public class GWsPreferences extends JPanel
}
});
indexByType.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
- indexByType.setText("Index by type");
+ indexByType.setText(MessageManager.getString("label.index_by_type"));
indexByType.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
@@ -150,19 +181,10 @@ public class GWsPreferences extends JPanel
indexByType_actionPerformed(e);
}
});
- enableEnfinServices
- .setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
- enableEnfinServices.setText("Enable Enfin Services");
- enableEnfinServices.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- enableEnfinServices_actionPerformed(e);
- }
- });
enableJws2Services
.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
- enableJws2Services.setText("Enable JABAWS Services");
+ enableJws2Services.setText(
+ MessageManager.getString("label.enable_jabaws_services"));
enableJws2Services.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
@@ -170,20 +192,11 @@ public class GWsPreferences extends JPanel
enableJws2Services_actionPerformed(e);
}
});
- enableJws1Services
- .setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
- enableJws1Services.setText("Enable Legacy Services");
- enableJws1Services.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- enableJws1Services_actionPerformed(e);
- }
- });
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");
+ .setText(MessageManager.getString("label.display_warnings"));
+ displayWsWarning.setToolTipText("" + MessageManager.getString(
+ "label.option_want_informed_web_service_URL_cannot_be_accessed_jalview_when_starts_up"));
displayWsWarning.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
@@ -192,7 +205,7 @@ public class GWsPreferences extends JPanel
}
});
newWsUrl.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
- newWsUrl.setText("New Service URL");
+ newWsUrl.setText(MessageManager.getString("label.new_service_url"));
newWsUrl.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
@@ -201,7 +214,7 @@ public class GWsPreferences extends JPanel
}
});
editWsUrl.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
- editWsUrl.setText("Edit Service URL");
+ editWsUrl.setText(MessageManager.getString("label.edit_service_url"));
editWsUrl.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
@@ -211,7 +224,8 @@ public class GWsPreferences extends JPanel
});
deleteWsUrl.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
- deleteWsUrl.setText("Delete Service URL");
+ deleteWsUrl
+ .setText(MessageManager.getString("label.delete_service_url"));
deleteWsUrl.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
@@ -220,8 +234,9 @@ public class GWsPreferences extends JPanel
}
});
moveWsUrlUp.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
- moveWsUrlUp.setText("Up");
- moveWsUrlUp.setToolTipText("Move URL up");
+ moveWsUrlUp.setText(MessageManager.getString("action.move_up"));
+ moveWsUrlUp
+ .setToolTipText(MessageManager.getString("label.move_url_up"));
moveWsUrlUp.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
@@ -230,8 +245,9 @@ public class GWsPreferences extends JPanel
}
});
moveWsUrlDown.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
- moveWsUrlDown.setText("Down");
- moveWsUrlDown.setToolTipText("Move URL Down");
+ moveWsUrlDown.setText(MessageManager.getString("action.move_down"));
+ moveWsUrlDown.setToolTipText(
+ MessageManager.getString("label.move_url_down"));
moveWsUrlDown.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
@@ -239,6 +255,37 @@ public class GWsPreferences extends JPanel
moveWsUrlDown_actionPerformed(e);
}
});
+ newSbrsUrl.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
+ newSbrsUrl
+ .setText(MessageManager.getString("label.add_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(
+ MessageManager.getString("label.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(
+ MessageManager.getString("label.delete_sbrs_definition"));
+ deleteSbrsUrl.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ deleteSbrsUrl_actionPerformed(e);
+ }
+ });
setLayout(myBorderlayout);
setPreferredSize(new Dimension(500, 400));
@@ -246,11 +293,12 @@ public class GWsPreferences extends JPanel
progressBar.setString("");
wsListUrlPanel.setBorder(BorderFactory.createEtchedBorder());
wsListUrlPanel.setLayout(new BorderLayout());
- // wsListUrlPanel.setPreferredSize(new Dimension(482,202));
wsListPane.setBorder(BorderFactory.createEtchedBorder());
wsListPane.getViewport().add(wsList);
- wsListPane.setPreferredSize(new Dimension(380, 200));
+ wsList.setPreferredSize(new Dimension(482, 202));
+ wsListPane.setPreferredSize(new Dimension(380, 80));
wsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ wsList.setColumnSelectionAllowed(false);
wsList.addMouseListener(new MouseListener()
{
@@ -283,30 +331,74 @@ public class GWsPreferences extends JPanel
}
});
- // wsListButtons.setPreferredSize(new Dimension(480, 60));
wsListButtons.setLayout(new FlowLayout());
- // wsListButtons.add(moveWsUrlUp);
- // wsListButtons.add(moveWsUrlDown);
wsListButtons.add(newWsUrl);
wsListButtons.add(editWsUrl);
wsListButtons.add(deleteWsUrl);
+ wsListButtons.setMinimumSize(new Dimension(350, 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(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);
+
+ srbsListUrlPanel.setBorder(BorderFactory.createEtchedBorder());
+ srbsListUrlPanel.setLayout(new BorderLayout());
+ srbsListPane.setBorder(BorderFactory.createEtchedBorder());
+ srbsListPane.getViewport().add(sbrsList);
+ 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));
@@ -315,15 +407,43 @@ public class GWsPreferences extends JPanel
wsMenuRefreshButs.add(resetWs, null);
wsMenuRefreshButs.add(progressBar, null);
myBorderlayout.setHgap(3);
- add(wsListPanel, BorderLayout.NORTH);
+ 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 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)
@@ -376,11 +496,6 @@ public class GWsPreferences extends JPanel
}
- protected void enableJws1Services_actionPerformed(ActionEvent e)
- {
-
- }
-
protected void refreshWs_actionPerformed(ActionEvent e)
{