X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=blobdiff_plain;f=src%2Fjalview%2Fjbgui%2FGRestServiceEditorPane.java;h=e964a22cf0cb5ebe06c9f2decca287df883d5778;hp=74b1463c26ab51794155030127444a427957a57a;hb=797df64fa2a0a30773d0f48f5494d4155e5a8be3;hpb=e74c1be398cd4ebe5f420c13be6143464100bb52 diff --git a/src/jalview/jbgui/GRestServiceEditorPane.java b/src/jalview/jbgui/GRestServiceEditorPane.java index 74b1463..e964a22 100644 --- a/src/jalview/jbgui/GRestServiceEditorPane.java +++ b/src/jalview/jbgui/GRestServiceEditorPane.java @@ -1,3 +1,20 @@ +/******************************************************************************* + * 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; import jalview.gui.JvSwingUtils; @@ -8,6 +25,8 @@ import java.awt.FlowLayout; 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.BoxLayout; import javax.swing.JButton; @@ -20,12 +39,14 @@ import javax.swing.JScrollPane; import javax.swing.JTabbedPane; import javax.swing.JTextArea; import javax.swing.JViewport; +import javax.swing.ListSelectionModel; import javax.swing.UIManager; import javax.swing.border.TitledBorder; import javax.swing.event.CaretEvent; import javax.swing.event.CaretListener; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; +import javax.swing.event.ListSelectionListener; import net.miginfocom.swing.MigLayout; @@ -80,7 +101,7 @@ public class GRestServiceEditorPane extends JPanel { inputs.setLayout(new MigLayout("","[grow 85,fill][]","")); paste = new JPanel(); paste.setName("Cut'n'Paste"); - paste.setLayout(new MigLayout()); + paste.setLayout(new MigLayout("","[grow 100, fill]","[][grow 100,fill]")); panels = new JTabbedPane(); panels.addTab(details.getName(), details); @@ -102,13 +123,13 @@ public class GRestServiceEditorPane extends JPanel { cpanel, "What kind of function the service performs (e.g. alignment, analysis, search, etc).", new JLabel("Service Action:"), action,"wrap"); - descr = new JTextArea(4, 40); + descr = new JTextArea(4, 60); descrVp = new JScrollPane(); descrVp.setViewportView(descr); JvSwingUtils.mgAddtoLayout(cpanel, "Brief description of service", new JLabel("Description:"), descrVp,"wrap"); - url = new JTextArea(2, 20); + url = new JTextArea(2, 60); urlVp = new JScrollPane(); urlVp.setViewportView(url); JvSwingUtils @@ -118,7 +139,7 @@ public class GRestServiceEditorPane extends JPanel { new JLabel("POST URL:"), urlVp,"wrap"); urlsuff = new JTextArea(); - urlsuff.setColumns(20); + urlsuff.setColumns(60); JvSwingUtils .mgAddtoLayout( @@ -179,10 +200,51 @@ public class GRestServiceEditorPane extends JPanel { // Inputparams JPanel iprmsList = new JPanel(); iprmsList.setBorder(new TitledBorder("Data input parameters")); - iprmsList.setLayout(new MigLayout()); + iprmsList.setLayout(new MigLayout("","[grow 90, fill][]")); iprmVp = new JScrollPane(); iprmVp.getViewport().setView(iprms = new JList()); iprmsList.add(iprmVp); + iprms.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + iprms.addMouseListener(new MouseListener() + { + + @Override + public void mouseReleased(MouseEvent e) + { + // TODO Auto-generated method stub + + } + + @Override + public void mousePressed(MouseEvent e) + { + // TODO Auto-generated method stub + + } + + @Override + public void mouseExited(MouseEvent e) + { + // TODO Auto-generated method stub + + } + + @Override + public void mouseEntered(MouseEvent e) + { + // TODO Auto-generated method stub + + } + + @Override + public void mouseClicked(MouseEvent e) + { + if (e.getClickCount()>1) { + iprmListSelection_doubleClicked(); + } + + } + }); JPanel iprmButs = new JPanel(); iprmButs.setLayout(new MigLayout()); @@ -263,8 +325,49 @@ public class GRestServiceEditorPane extends JPanel { JPanel rparamList = new JPanel(); rparamList.setBorder(new TitledBorder("Data returned by service")); - rparamList.setLayout(new MigLayout()); + rparamList.setLayout(new MigLayout("","[grow 90, fill][]")); rdata = new JList(); + rdata.setToolTipText("Right click to edit currently selected parameter."); + rdata.addMouseListener(new MouseListener() + { + + @Override + public void mouseReleased(MouseEvent arg0) + { + // TODO Auto-generated method stub + + } + + @Override + public void mousePressed(MouseEvent arg0) + { + + } + + @Override + public void mouseExited(MouseEvent arg0) + { + // TODO Auto-generated method stub + + } + + @Override + public void mouseEntered(MouseEvent arg0) + { + // TODO Auto-generated method stub + + } + + @Override + public void mouseClicked(MouseEvent arg0) + { + if (arg0.getButton()==MouseEvent.BUTTON3) + { + rdata_rightClicked(arg0); + } + + } + }); rdataVp = new JScrollPane(); rdataVp.getViewport().setView(rdata); rparamList.add(rdataVp); @@ -280,21 +383,29 @@ public class GRestServiceEditorPane extends JPanel { // Parse flat-text to a service - urldesc = new JTextArea(2,40); + urldesc = new JTextArea(4,60); urldesc.setEditable(true); + urldesc.setWrapStyleWord(true); urldescVp = new JScrollPane(); urldescVp.setViewportView(urldesc); - JvSwingUtils.mgAddtoLayout(paste,"Flat file representation of this rest service using the Really Simple Bioinformatics Service formalism", new JLabel("RSBS Encoded Service:"), urldescVp,"wrap"); - - parseRes = new JTextArea(5,40); + JPanel urldescPane = new JPanel(); + urldescPane.setLayout(new MigLayout("","[grow 100, fill]", "[grow 100, fill]")); + urldescPane.setBorder(new TitledBorder("RSBS Encoded Service")); + urldescPane.add(urldescVp, "span"); + paste.add(urldescPane,"span"); + urldescPane.setToolTipText(""+JvSwingUtils.wrapTooltip("Flat file representation of this rest service using the Really Simple Bioinformatics Service formalism")); + + parseRes = new JTextArea(); parseResVp = new JScrollPane(); parseResVp.setViewportView(parseRes); - parseWarnings = new JPanel(new MigLayout()); + parseRes.setWrapStyleWord(true); + parseRes.setColumns(60); + parseWarnings = new JPanel(new MigLayout("","[grow 100, fill]", "[grow 100, fill]")); parseWarnings.setBorder(new TitledBorder("Parsing errors")); parseWarnings.setToolTipText(""+JvSwingUtils.wrapTooltip("Results of parsing the RSBS representation")+""); - parseWarnings.add(parseResVp, "wrap"); + parseWarnings.add(parseResVp, "center"); parseRes.setEditable(false); - + paste.add(parseWarnings, "span"); setLayout(new BorderLayout()); add(panels, BorderLayout.CENTER); okButton = JvSwingUtils.makeButton("OK", "", new ActionListener() @@ -319,6 +430,18 @@ public class GRestServiceEditorPane extends JPanel { } + protected void rdata_rightClicked(MouseEvent arg0) + { + // TODO Auto-generated method stub + + } + + protected void iprmListSelection_doubleClicked() + { + // TODO Auto-generated method stub + + } + protected void hSeparable_actionPerformed(ActionEvent arg0) { // TODO Auto-generated method stub