From: gmungoc Date: Wed, 8 Oct 2014 11:15:45 +0000 (+0100) Subject: Merge branch 'Release_2_8_2_Branch' into X-Git-Tag: Jalview_2_9~169^2~22^2~16 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=8ba93f7655ea7165579539158b6a5eb076135bba;p=jalview.git Merge branch 'Release_2_8_2_Branch' into features/JAL-1264_showHideAnnotations Conflicts: resources/lang/Messages.properties src/jalview/datamodel/Alignment.java --- 8ba93f7655ea7165579539158b6a5eb076135bba diff --cc resources/lang/Messages.properties index a4bc4b8,cdbe0f3..b1962e0 --- a/resources/lang/Messages.properties +++ b/resources/lang/Messages.properties @@@ -54,11 -54,11 +54,12 @@@ action.right_justify_alignment = Right action.boxes = Boxes action.text = Text action.by_pairwise_id = by Pairwise Identity +action.by_length = by Length action.by_id = by Id + action.by_length = by Length action.by_group = by Group action.remove = Remove -action.remove_redundancy = Remove Redundancy +action.remove_redundancy = Remove Redundancy... action.pairwise_alignment = Pairwise Alignments... action.by_rna_helixes = by RNA Helices action.user_defined = User Defined... diff --cc src/jalview/datamodel/Alignment.java index f19d117,5e75725..bfe6406 --- a/src/jalview/datamodel/Alignment.java +++ b/src/jalview/datamodel/Alignment.java @@@ -20,12 -20,9 +20,14 @@@ */ package jalview.datamodel; + import jalview.util.MessageManager; + -import java.util.*; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.List; +import java.util.Map; +import java.util.Vector; /** * Data structure to hold and manipulate a multiple sequence alignment diff --cc src/jalview/gui/Desktop.java index eb4f968,123aed2..63f0caa --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@@ -2359,11 -2361,10 +2355,10 @@@ public class Desktop extends jalview.jb { if (progressBarHandlers == null || !progressBars.contains(new Long(id))) { - throw new Error( - "call setProgressBar before registering the progress bar's handler."); + throw new Error(MessageManager.getString("error.call_setprogressbar_before_registering_handler")); } progressBarHandlers.put(new Long(id), handler); - final JPanel progressPanel = (JPanel) progressBars.get(new Long(id)); + final JPanel progressPanel = progressBars.get(new Long(id)); if (handler.canCancel()) { JButton cancel = new JButton( diff --cc src/jalview/gui/FeatureSettings.java index 3dae4e5,304d352..908eac5 --- a/src/jalview/gui/FeatureSettings.java +++ b/src/jalview/gui/FeatureSettings.java @@@ -20,28 -20,28 +20,75 @@@ */ package jalview.gui; import jalview.analysis.AlignmentSorter; import jalview.bin.Cache; import jalview.commands.OrderCommand; --import jalview.datamodel.*; --import jalview.io.*; ++import jalview.datamodel.AlignmentI; ++import jalview.datamodel.SequenceFeature; ++import jalview.datamodel.SequenceGroup; ++import jalview.datamodel.SequenceI; ++import jalview.io.JalviewFileChooser; import jalview.schemes.AnnotationColourGradient; import jalview.schemes.GraduatedColor; import jalview.util.MessageManager; import jalview.ws.dbsources.das.api.jalviewSourceI; ++import java.awt.BorderLayout; ++import java.awt.Color; ++import java.awt.Component; ++import java.awt.Font; ++import java.awt.Graphics; ++import java.awt.GridLayout; ++import java.awt.Rectangle; ++import java.awt.event.ActionEvent; ++import java.awt.event.ActionListener; ++import java.awt.event.ItemEvent; ++import java.awt.event.ItemListener; ++import java.awt.event.MouseAdapter; ++import java.awt.event.MouseEvent; ++import java.awt.event.MouseMotionAdapter; ++import java.beans.PropertyChangeEvent; ++import java.beans.PropertyChangeListener; ++import java.io.File; ++import java.io.FileInputStream; ++import java.io.FileOutputStream; ++import java.io.InputStreamReader; ++import java.io.OutputStreamWriter; ++import java.io.PrintWriter; ++import java.util.ArrayList; ++import java.util.Hashtable; ++import java.util.Iterator; ++import java.util.List; ++import java.util.Vector; ++ ++import javax.swing.AbstractCellEditor; ++import javax.swing.BorderFactory; ++import javax.swing.Icon; ++import javax.swing.JButton; ++import javax.swing.JCheckBox; ++import javax.swing.JCheckBoxMenuItem; ++import javax.swing.JColorChooser; ++import javax.swing.JDialog; ++import javax.swing.JInternalFrame; ++import javax.swing.JLabel; ++import javax.swing.JLayeredPane; ++import javax.swing.JMenuItem; ++import javax.swing.JOptionPane; ++import javax.swing.JPanel; ++import javax.swing.JPopupMenu; ++import javax.swing.JScrollPane; ++import javax.swing.JSlider; ++import javax.swing.JTabbedPane; ++import javax.swing.JTable; ++import javax.swing.ListSelectionModel; ++import javax.swing.SwingConstants; ++import javax.swing.SwingUtilities; ++import javax.swing.event.ChangeEvent; ++import javax.swing.event.ChangeListener; ++import javax.swing.table.AbstractTableModel; ++import javax.swing.table.TableCellEditor; ++import javax.swing.table.TableCellRenderer; ++ public class FeatureSettings extends JPanel { DasSourceBrowser dassourceBrowser; @@@ -115,6 -115,6 +162,19 @@@ (String) table.getValueAt(selectedRow, 0)); } } ++ ++ // isPopupTrigger fires on mouseReleased on Mac ++ @Override ++ public void mouseReleased(MouseEvent evt) ++ { ++ selectedRow = table.rowAtPoint(evt.getPoint()); ++ if (evt.isPopupTrigger()) ++ { ++ popupSort(selectedRow, (String) table.getValueAt(selectedRow, 0), ++ table.getValueAt(selectedRow, 1), fr.minmax, evt.getX(), ++ evt.getY()); ++ } ++ } }); table.addMouseMotionListener(new MouseMotionAdapter() @@@ -663,7 -661,7 +721,7 @@@ file), "UTF-8"); jalview.schemabinding.version2.JalviewUserColours jucs = new jalview.schemabinding.version2.JalviewUserColours(); -- jucs = (jalview.schemabinding.version2.JalviewUserColours) jucs ++ jucs = jucs .unmarshal(in); for (int i = jucs.getColourCount() - 1; i >= 0; i--) @@@ -1030,7 -1028,7 +1088,7 @@@ { public void stateChanged(ChangeEvent evt) { -- fr.setTransparency((float) (100 - transparency.getValue()) / 100f); ++ fr.setTransparency((100 - transparency.getValue()) / 100f); af.alignPanel.paintAlignment(true); } }); diff --cc src/jalview/gui/IdPanel.java index 7f2e669,39afd2c..6b1109a --- a/src/jalview/gui/IdPanel.java +++ b/src/jalview/gui/IdPanel.java @@@ -20,30 -20,20 +20,31 @@@ */ package jalview.gui; -import java.awt.*; -import java.awt.event.*; -import java.util.List; -import java.util.Vector; - -import javax.swing.*; - -import jalview.datamodel.*; +import jalview.datamodel.Sequence; +import jalview.datamodel.SequenceFeature; +import jalview.datamodel.SequenceGroup; +import jalview.datamodel.SequenceI; import jalview.io.SequenceAnnotationReport; + import jalview.util.MessageManager; import jalview.util.UrlLink; +import java.awt.BorderLayout; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.awt.event.MouseWheelEvent; +import java.awt.event.MouseWheelListener; +import java.util.List; +import java.util.Vector; + +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; +import javax.swing.ToolTipManager; + /** - * DOCUMENT ME! + * This panel hosts alignment sequence ids and responds to mouse clicks on them, + * as well as highlighting ids matched by a search from the Find menu. * * @author $author$ * @version $Revision$ @@@ -246,11 -227,11 +247,10 @@@ public class IdPanel extends JPanel imp JOptionPane .showInternalMessageDialog( Desktop.desktop, - "Unixers: Couldn't find default web browser." - + "\nAdd the full path to your browser in Preferences.", - "Web browser not found", JOptionPane.WARNING_MESSAGE); + MessageManager.getString("label.web_browser_not_found_unix"), + MessageManager.getString("label.web_browser_not_found"), JOptionPane.WARNING_MESSAGE); ex.printStackTrace(); } - } /** diff --cc test/jalview/ws/jabaws/MinJabawsClientTests.java index 0000000,a938dd6..0c25cdb mode 000000,100644..100644 --- a/test/jalview/ws/jabaws/MinJabawsClientTests.java +++ b/test/jalview/ws/jabaws/MinJabawsClientTests.java @@@ -1,0 -1,84 +1,91 @@@ + package jalview.ws.jabaws; + + import static org.junit.Assert.assertEquals; + import static org.junit.Assert.fail; + + import java.util.ArrayList; + import java.util.List; -import java.util.function.Consumer; + + import org.junit.Test; + + import compbio.data.msa.MsaWS; + import compbio.data.msa.RegistryWS; + import compbio.data.sequence.FastaSequence; + import compbio.metadata.JobStatus; + import compbio.ws.client.Jws2Client; + import compbio.ws.client.Services; + + public class MinJabawsClientTests { + + /** + * simple test for the benefit of JAL-1338 + * @throws Exception + */ + @SuppressWarnings("rawtypes") + @Test + public void msaTest() throws Exception { + String url; + RegistryWS registry = Jws2Client + .connectToRegistry(url = "http://www.compbio.dundee.ac.uk/jabaws"); + if (registry != null) { + + MsaWS msaservice = null; + for (Services service : registry.getSupportedServices()) { + if (service.equals(Services.ClustalOWS)) { + msaservice = (MsaWS) Jws2Client.connect(url, service); + if (msaservice != null) { + break; + } + } + } + if (msaservice == null) { + fail("couldn't find a clustalO service on the public registry"); + } + FastaSequence fsq = new FastaSequence("seqA", + "SESESESESESESESSESESSESESESESESESESESESEEEEEESSESESESESSSSESESESESESESE"); + List iseqs = new ArrayList(); + for (int i = 0; i < 9; i++) { + iseqs.add(new FastaSequence(fsq.getId() + i, fsq.getSequence() + + fsq.getSequence().substring(i + 3, i + 3 + i))); + } + + String jobid = msaservice.align(iseqs); - if (jobid != null) { - JobStatus js = null; - do { - try { - Thread.sleep(500); - } catch (InterruptedException q) { - } - ; - js = msaservice.getJobStatus(jobid); - } while (!js.equals(JobStatus.FAILED) - && !js.equals(JobStatus.CANCELLED) - && !js.equals(JobStatus.FINISHED)); - assertEquals("Trial alignment failed. State was " + js.name(), - js, JobStatus.FINISHED); - assertEquals( - "Mismatch in number of input and result sequences - assume alignment service wasn't interacted with correctly", - msaservice.getResult(jobid).getSequences().size(), - iseqs.size()); - msaservice.getResult(jobid).getSequences() - .forEach(new Consumer() { - @Override - public void accept(FastaSequence t) { - System.out.println(">"+t.getId()); - System.out.println(t.getFormattedFasta()); - } - }); ++ if (jobid != null) ++ { ++ JobStatus js = null; ++ do ++ { ++ try ++ { ++ Thread.sleep(500); ++ } catch (InterruptedException q) ++ { ++ } ++ ; ++ js = msaservice.getJobStatus(jobid); ++ } while (!js.equals(JobStatus.FAILED) ++ && !js.equals(JobStatus.CANCELLED) ++ && !js.equals(JobStatus.FINISHED)); ++ assertEquals("Trial alignment failed. State was " + js.name(), js, ++ JobStatus.FINISHED); ++ assertEquals( ++ "Mismatch in number of input and result sequences - assume alignment service wasn't interacted with correctly", ++ msaservice.getResult(jobid).getSequences().size(), ++ iseqs.size()); ++ for (FastaSequence t : msaservice.getResult(jobid).getSequences()) ++ { ++ System.out.println(">" + t.getId()); ++ System.out.println(t.getFormattedFasta()); ++ } ++ // .forEach(new Consumer() { ++ // @Override ++ // public void accept(FastaSequence t) { ++ // System.out.println(">"+t.getId()); ++ // System.out.println(t.getFormattedFasta()); ++ // } ++ // }); + } + + } + } + }