+/**
+ *
+ */
+package jalview.jbgui;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.GridBagLayout;
+import java.awt.GridLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JList;
+import javax.swing.JPanel;
+import javax.swing.JProgressBar;
+import javax.swing.JScrollPane;
+import javax.swing.ListSelectionModel;
+import javax.swing.SwingConstants;
+import javax.swing.border.TitledBorder;
+
+/**
+ * Preference dialog for jalview web services
+ *
+ * @author JimP
+ */
+public class GWsPreferences extends JPanel
+{
+ protected JList wsList = new JList();
+
+ protected TitledBorder wsListTitleBorder = new TitledBorder(
+ "Web Service Discovery URLS");
+
+ protected JButton newWsUrl = new JButton();
+
+ protected JButton editWsUrl = new JButton();
+
+ protected JButton deleteWsUrl = new JButton();
+
+ protected JButton moveWsUrlUp = new JButton();
+
+ protected JButton moveWsUrlDown = new JButton();
+
+ protected JCheckBox indexByHost = new JCheckBox();
+
+ protected JCheckBox indexByType = new JCheckBox();
+
+ protected JCheckBox enableJws1Services = new JCheckBox();
+
+ protected JCheckBox enableJws2Services = new JCheckBox();
+
+ protected JCheckBox enableEnfinServices = 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();
+
+ BorderLayout myBorderlayout = new BorderLayout();
+
+ BorderLayout wsListBorderlayout = new BorderLayout();
+
+ GridBagLayout wsPrefLayout = new GridBagLayout();
+
+ GridBagLayout wsListLayout = new GridBagLayout();
+
+ GridBagLayout wsMenuLayout = new GridBagLayout();
+
+ JPanel wsMenuButtons = new JPanel();
+ JPanel wsMenuRefreshButs = new JPanel();
+ public GWsPreferences()
+ {
+ jbInit();
+ }
+
+ private void jbInit()
+ {
+
+ refreshWs.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
+ refreshWs.setText("Refresh Services");
+ refreshWs.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ refreshWs_actionPerformed(e);
+ }
+ });
+ resetWs.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
+ resetWs.setText("Reset Services");
+
+ resetWs.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ resetWs_actionPerformed(e);
+ }
+ });
+ 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.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ indexByHost_actionPerformed(e);
+ }
+ });
+ indexByType.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
+ indexByType.setText("Index by type");
+ indexByType.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ 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 JWS2 Services");
+ enableJws2Services.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ enableJws2Services_actionPerformed(e);
+ }
+ });
+ enableJws1Services
+ .setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
+ enableJws1Services.setText("Enable JWS1 Services");
+ enableJws1Services.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ enableJws1Services_actionPerformed(e);
+ }
+ });
+ newWsUrl.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
+ newWsUrl.setText("New Service URL");
+ newWsUrl.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ newWsUrl_actionPerformed(e);
+ }
+ });
+ editWsUrl.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
+ editWsUrl.setText("Edit Service URL");
+ editWsUrl.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ editWsUrl_actionPerformed(e);
+ }
+ });
+
+ deleteWsUrl.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
+ deleteWsUrl.setText("Delete Service URL");
+ deleteWsUrl.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ deleteWsUrl_actionPerformed(e);
+ }
+ });
+ moveWsUrlUp.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
+ moveWsUrlUp.setText("Up");
+ moveWsUrlUp.setToolTipText("Move URL up");
+ moveWsUrlUp.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ moveWsUrlUp_actionPerformed(e);
+ }
+ });
+ moveWsUrlDown.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
+ moveWsUrlDown.setText("Down");
+ moveWsUrlDown.setToolTipText("Move URL Down");
+ moveWsUrlDown.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ moveWsUrlDown_actionPerformed(e);
+ }
+ });
+
+ setLayout(myBorderlayout);
+ 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));
+ wsListPane.setBorder(BorderFactory.createEtchedBorder());
+ wsListPane.getViewport().add(wsList);
+ wsListPane.setPreferredSize(new Dimension(380, 200));
+ wsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ wsList.addMouseListener(new MouseListener() {
+
+ @Override
+ public void mouseClicked(MouseEvent e)
+ {
+ if (e.getClickCount()>1)
+ {
+ editWsUrl_actionPerformed(null);
+ }
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void mouseEntered(MouseEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void mouseExited(MouseEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void mousePressed(MouseEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void mouseReleased(MouseEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ });
+// 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);
+ 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);
+ wsListPanel.setBorder(wsListTitleBorder);
+ wsListPanel.setLayout(new BorderLayout());
+ wsListPanel.add(wsListUrlPanel, BorderLayout.NORTH);
+ wsListPanel.add(wsListButtons, BorderLayout.SOUTH);
+ wsMenuButtons.setLayout(new GridLayout(2,3));
+ wsMenuButtons.add(indexByHost);
+ wsMenuButtons.add(indexByType);
+ wsMenuButtons.add(enableJws1Services);
+ wsMenuButtons.add(enableJws2Services);
+ wsMenuButtons.add(enableEnfinServices);
+ 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);
+ myBorderlayout.setHgap(3);
+ add(wsListPanel,BorderLayout.NORTH);
+ add(wsMenuButtons,BorderLayout.CENTER);
+ add(wsMenuRefreshButs, BorderLayout.SOUTH);
+ }
+
+ protected void resetWs_actionPerformed(ActionEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ protected void indexByType_actionPerformed(ActionEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ protected void indexByHost_actionPerformed(ActionEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ protected void newWsUrl_actionPerformed(ActionEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ protected void editWsUrl_actionPerformed(ActionEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ protected void deleteWsUrl_actionPerformed(ActionEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ protected void moveWsUrlUp_actionPerformed(ActionEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ protected void moveWsUrlDown_actionPerformed(ActionEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ protected void enableEnfinServices_actionPerformed(ActionEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ protected void enableJws2Services_actionPerformed(ActionEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ protected void enableJws1Services_actionPerformed(ActionEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ protected void refreshWs_actionPerformed(ActionEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+}