From: Jim Procter Date: Wed, 7 Oct 2015 10:57:37 +0000 (+0100) Subject: Merge branch 'features/JAL-1912_biojson-per-sequence-annotation' of http://source... X-Git-Tag: Release_2_10_0~365^2~4 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=fd9428e5dcaee143c17ce93054db6698bbd9fb99;hp=1b64bc7c6e51618b6a9acbbad423244d89eba203;p=jalview.git Merge branch 'features/JAL-1912_biojson-per-sequence-annotation' of source.jalview.org/git/jalview into features/JAL-1912_biojson-per-sequence-annotation --- diff --git a/examples/appletParameters.html b/examples/appletParameters.html index 8daa4ee..1e45aae 100644 --- a/examples/appletParameters.html +++ b/examples/appletParameters.html @@ -118,6 +118,14 @@ the applet can be interacted with via its Default is no colour. + defaultColourNuc + A colour scheme (from the list above) to apply to Nucleotide alignmentsThis overrides defaultColour if it is specified. + + + defaultColourProt + A colour scheme (from the list above) to apply to Peptide alignmentsThis overrides defaultColour if it is specified. + + userDefinedColour

Example:
D,E=red; K,R,H=0022FF; c=yellow

diff --git a/examples/applets.html b/examples/applets.html index d811e94..34118b8 100644 --- a/examples/applets.html +++ b/examples/applets.html @@ -187,7 +187,8 @@ Try out JalviewLite by pressing one of the buttons below.
- + + diff --git a/examples/estrogenReceptorProtein_frag.fa b/examples/estrogenReceptorProtein_frag.fa index cb3c37e..c9e31aa 100644 --- a/examples/estrogenReceptorProtein_frag.fa +++ b/examples/estrogenReceptorProtein_frag.fa @@ -1,14 +1,8 @@ ->UNIPROT|Q7LCB3/249-274 ----SLEHTLPVNRETLKRKVSGNRCASPV---------- ->UNIPROT|Q9VSE9/175-200 ----GSGTSGGNGGGGGGGTSGGNATNASA---------- >UNIPROT|Q9IBD5/371-408 EGHHNYLCAGRNDCIVDKIRRKNCPACRLRKCYQAGMI- >UNIPROT|Q9YGV9/522-559 EGKQKYLCASINDCTIDKLRRKNCPSCRLKRCFAAGMT- >UNIPROT|Q90ZM7/97-134 EGQHNYLCAGRNDCIIDKIRRKNCPACRLRKCIQAGMT- ->UNIPROT|Q91445/24-61 -EGKQKYLCASRNDCTIDKFRRKNCPSCRLRKCYEAGMT- >UNIPROT|Q90ZM8/198-236 QGHNDYMCPATNQCTIDRNRRKSCQACRLRKCYEVGMVK diff --git a/help/html/releases.html b/help/html/releases.html index 9c2a10e..7f1b627 100755 --- a/help/html/releases.html +++ b/help/html/releases.html @@ -48,24 +48,46 @@
2.9.0b1
- 29/09/2015
+ 6/10/2015
-
+ General + + Application + Applet +
+ General + Application + Applet
diff --git a/src/jalview/appletgui/AlignViewport.java b/src/jalview/appletgui/AlignViewport.java index e434825..7ef2d59 100644 --- a/src/jalview/appletgui/AlignViewport.java +++ b/src/jalview/appletgui/AlignViewport.java @@ -187,8 +187,13 @@ public class AlignViewport extends AlignmentViewport implements if (applet != null) { - String colour = applet.getParameter("defaultColour"); - + String colour = al.isNucleotide() ? applet + .getParameter("defaultColourNuc") : applet + .getParameter("defaultColourProt"); + if (colour == null) + { + colour = applet.getParameter("defaultColour"); + } if (colour == null) { colour = applet.getParameter("userDefinedColour"); diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index a857f11..92c6355 100644 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -1072,7 +1072,7 @@ public class AlignViewport extends AlignmentViewport implements // TODO would like next line without cast but needs more refactoring... final AlignmentPanel complementPanel = ((AlignViewport) getCodingComplement()) .getAlignPanel(); - complementPanel.setFollowingComplementScroll(true); + complementPanel.setDontScrollComplement(true); complementPanel.scrollToCentre(sr, verticalOffset); } } diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index 2c7dd3e..4d49bc2 100644 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -99,7 +99,7 @@ public class AlignmentPanel extends GAlignmentPanel implements * Flag set while scrolling to follow complementary cDNA/protein scroll. When * true, suppresses invoking the same method recursively. */ - private boolean followingComplementScroll; + private boolean dontScrollComplement; /** * Creates a new AlignmentPanel object. @@ -732,7 +732,14 @@ public class AlignmentPanel extends GAlignmentPanel implements x = 0; } + /* + * each scroll adjustment triggers adjustmentValueChanged, which resets the + * 'do not scroll complement' flag; ensure it is the same for both + * operations + */ + boolean flag = isDontScrollComplement(); hscroll.setValues(x, hextent, 0, width); + setDontScrollComplement(flag); vscroll.setValues(y, vextent, 0, height); } @@ -831,9 +838,9 @@ public class AlignmentPanel extends GAlignmentPanel implements * If there is one, scroll the (Protein/cDNA) complementary alignment to * match, unless we are ourselves doing that. */ - if (isFollowingComplementScroll()) + if (isDontScrollComplement()) { - setFollowingComplementScroll(false); + setDontScrollComplement(false); } else { @@ -880,6 +887,12 @@ public class AlignmentPanel extends GAlignmentPanel implements hscrollFillerPanel.setPreferredSize(new Dimension(d.width, 12)); validate(); + /* + * set scroll bar positions; first suppress this being 'followed' in any + * complementary split pane + */ + setDontScrollComplement(true); + if (av.getWrapAlignment()) { int maxwidth = av.getAlignment().getWidth(); @@ -1789,17 +1802,17 @@ public class AlignmentPanel extends GAlignmentPanel implements } /** - * Set a flag to say we are scrolling to follow a (cDNA/protein) complement. + * Set a flag to say do not scroll any (cDNA/protein) complement. * * @param b */ - protected void setFollowingComplementScroll(boolean b) + protected void setDontScrollComplement(boolean b) { - this.followingComplementScroll = b; + this.dontScrollComplement = b; } - protected boolean isFollowingComplementScroll() + protected boolean isDontScrollComplement() { - return this.followingComplementScroll; + return this.dontScrollComplement; } } diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index d03e3f2..c957444 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -33,6 +33,7 @@ import jalview.jbgui.GStructureViewer; import jalview.structure.StructureSelectionManager; import jalview.util.ImageMaker; import jalview.util.MessageManager; +import jalview.util.Platform; import jalview.viewmodel.AlignmentViewport; import jalview.ws.params.ParamManager; @@ -305,6 +306,10 @@ public class Desktop extends jalview.jbgui.GDesktop implements boolean showjconsole = jalview.bin.Cache.getDefault( "SHOW_JAVA_CONSOLE", false); desktop = new MyDesktopPane(selmemusage); + if (Platform.isAMac()) + { + desktop.setDoubleBuffered(false); + } showMemusage.setSelected(selmemusage); desktop.setBackground(Color.white); getContentPane().setLayout(new BorderLayout()); @@ -750,8 +755,13 @@ public class Desktop extends jalview.jbgui.GDesktop implements frame.setResizable(resizable); frame.setMaximizable(resizable); frame.setIconifiable(resizable); - frame.setFrameIcon(null); - + if (Platform.isAMac()) + { + frame.setIconifiable(false); + frame.setFrameIcon(null); + // frame.setDesktopIcon(null); + frame.setDoubleBuffered(false); + } if (frame.getX() < 1 && frame.getY() < 1) { frame.setLocation(xOffset * openFrameCount, yOffset @@ -2966,25 +2976,39 @@ public class Desktop extends jalview.jbgui.GDesktop implements * AlignmentPanel objects, including their AlignmentViewports, so the * cdna/protein relationships between the viewports is carried over to the * new split frames. + * + * explodedGeometry holds the (x, y) position of the previously exploded + * SplitFrame, and the (width, height) of the AlignFrame component */ AlignmentPanel topPanel = (AlignmentPanel) topPanels.get(i); AlignFrame newTopFrame = new AlignFrame(topPanel); newTopFrame.setSize(oldTopFrame.getSize()); newTopFrame.setVisible(true); + Rectangle geometry = ((AlignViewport) topPanel.getAlignViewport()) + .getExplodedGeometry(); + if (geometry != null) + { + newTopFrame.setSize(geometry.getSize()); + } + AlignmentPanel bottomPanel = (AlignmentPanel) bottomPanels.get(i); AlignFrame newBottomFrame = new AlignFrame(bottomPanel); newBottomFrame.setSize(oldBottomFrame.getSize()); newBottomFrame.setVisible(true); + geometry = ((AlignViewport) bottomPanel.getAlignViewport()) + .getExplodedGeometry(); + if (geometry != null) + { + newBottomFrame.setSize(geometry.getSize()); + } + topPanel.av.setGatherViewsHere(false); bottomPanel.av.setGatherViewsHere(false); JInternalFrame splitFrame = new SplitFrame(newTopFrame, newBottomFrame); - // either panel may hold previous exploded frame geometry - Rectangle geometry = ((AlignViewport) topPanel.getAlignViewport()) - .getExplodedGeometry(); if (geometry != null) { - splitFrame.setBounds(geometry); + splitFrame.setLocation(geometry.getLocation()); } Desktop.addInternalFrame(splitFrame, sf.getTitle(), -1, -1); } @@ -3007,10 +3031,18 @@ public class Desktop extends jalview.jbgui.GDesktop implements */ public void gatherViews(GSplitFrame source) { + /* + * special handling of explodedGeometry for a view within a SplitFrame: - it + * holds the (x, y) position of the enclosing SplitFrame, and the (width, + * height) of the AlignFrame component + */ AlignFrame myTopFrame = (AlignFrame) source.getTopFrame(); AlignFrame myBottomFrame = (AlignFrame) source.getBottomFrame(); - myTopFrame.viewport.setExplodedGeometry(source.getBounds()); - myBottomFrame.viewport.setExplodedGeometry(source.getBounds()); + myTopFrame.viewport.setExplodedGeometry(new Rectangle(source.getX(), + source.getY(), myTopFrame.getWidth(), myTopFrame.getHeight())); + myBottomFrame.viewport.setExplodedGeometry(new Rectangle(source.getX(), + source.getY(), myBottomFrame.getWidth(), myBottomFrame + .getHeight())); myTopFrame.viewport.setGatherViewsHere(true); myBottomFrame.viewport.setGatherViewsHere(true); String topViewId = myTopFrame.viewport.getSequenceSetId(); @@ -3035,10 +3067,10 @@ public class Desktop extends jalview.jbgui.GDesktop implements gatherThis = true; topPanel.av.setGatherViewsHere(false); bottomPanel.av.setGatherViewsHere(false); - // both panels refer to the same split frame geometry - Rectangle position = sf.getBounds(); - topPanel.av.setExplodedGeometry(position); - bottomPanel.av.setExplodedGeometry(position); + topPanel.av.setExplodedGeometry(new Rectangle(sf.getLocation(), + topFrame.getSize())); + bottomPanel.av.setExplodedGeometry(new Rectangle(sf + .getLocation(), bottomFrame.getSize())); myTopFrame.addAlignmentPanel(topPanel, false); myBottomFrame.addAlignmentPanel(bottomPanel, false); } diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index 4ee87fc..fe05e6e 100644 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -680,7 +680,7 @@ public class SeqPanel extends JPanel implements MouseListener, * * @see AlignmentPanel#adjustmentValueChanged */ - ap.setFollowingComplementScroll(true); + ap.setDontScrollComplement(true); if (ap.scrollToPosition(results, false)) { seqCanvas.revalidate(); diff --git a/src/jalview/gui/SplitFrame.java b/src/jalview/gui/SplitFrame.java index 9da8240..3a6d266 100644 --- a/src/jalview/gui/SplitFrame.java +++ b/src/jalview/gui/SplitFrame.java @@ -26,6 +26,7 @@ import jalview.datamodel.AlignmentI; import jalview.jbgui.GAlignFrame; import jalview.jbgui.GSplitFrame; import jalview.structure.StructureSelectionManager; +import jalview.util.Platform; import jalview.viewmodel.AlignmentViewport; import java.awt.Component; @@ -37,12 +38,15 @@ import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.beans.PropertyVetoException; import java.util.Map.Entry; +import java.util.Set; import javax.swing.AbstractAction; import javax.swing.InputMap; import javax.swing.JComponent; import javax.swing.JMenuItem; import javax.swing.KeyStroke; +import javax.swing.UIDefaults; +import javax.swing.UIManager; import javax.swing.event.InternalFrameAdapter; import javax.swing.event.InternalFrameEvent; @@ -81,10 +85,23 @@ public class SplitFrame extends GSplitFrame implements SplitContainerI ((AlignFrame) getTopFrame()).getViewport().setCodingComplement( ((AlignFrame) getBottomFrame()).getViewport()); - int width = ((AlignFrame) getTopFrame()).getWidth(); - // about 50 pixels for the SplitFrame's title bar etc + /* + * estimate width and height of SplitFrame; this.getInsets() doesn't seem to + * give the full additional size (a few pixels short) + */ + UIDefaults defaults = UIManager.getDefaults(); + Set keySet = defaults.keySet(); + for (Object key : keySet) + { + System.out.println(key.toString() + " = " + + UIManager.get(key).toString()); + } + int widthFudge = Platform.isAMac() ? 28 : 28; // Windows tbc + int heightFudge = Platform.isAMac() ? 50 : 50; // tbc + int width = ((AlignFrame) getTopFrame()).getWidth() + widthFudge; int height = ((AlignFrame) getTopFrame()).getHeight() - + ((AlignFrame) getBottomFrame()).getHeight() + 50; + + ((AlignFrame) getBottomFrame()).getHeight() + DIVIDER_SIZE + + heightFudge; height = fitHeightToDesktop(height); setSize(width, height); diff --git a/src/jalview/io/HtmlSvgOutput.java b/src/jalview/io/HtmlSvgOutput.java index e946367..6c2faca 100644 --- a/src/jalview/io/HtmlSvgOutput.java +++ b/src/jalview/io/HtmlSvgOutput.java @@ -76,6 +76,10 @@ public class HtmlSvgOutput .getSelectedFile().getParent()); file = chooser.getSelectedFile(); } + else + { + return; + } } AlignmentDimension aDimension = ap.getAlignmentDimension(); diff --git a/src/jalview/jbgui/GPDBSearchPanel.java b/src/jalview/jbgui/GPDBSearchPanel.java index ddb2f7a..a105999 100644 --- a/src/jalview/jbgui/GPDBSearchPanel.java +++ b/src/jalview/jbgui/GPDBSearchPanel.java @@ -191,12 +191,13 @@ public abstract class GPDBSearchPanel extends JPanel case KeyEvent.VK_TAB: // tab key if (evt.isShiftDown()) { - txt_search.requestFocus(); + tabbedPane.requestFocus(); } else { btn_back.requestFocus(); } + evt.consume(); break; default: return; diff --git a/src/jalview/jbgui/GSplitFrame.java b/src/jalview/jbgui/GSplitFrame.java index daad4fd..7c4dcf3 100644 --- a/src/jalview/jbgui/GSplitFrame.java +++ b/src/jalview/jbgui/GSplitFrame.java @@ -33,7 +33,7 @@ import javax.swing.plaf.basic.BasicInternalFrameUI; public class GSplitFrame extends JInternalFrame { - private static final int DIVIDER_SIZE = 5; + protected static final int DIVIDER_SIZE = 5; private static final long serialVersionUID = 1L; diff --git a/src/jalview/jbgui/GStructureChooser.java b/src/jalview/jbgui/GStructureChooser.java index cf80613..25924f0 100644 --- a/src/jalview/jbgui/GStructureChooser.java +++ b/src/jalview/jbgui/GStructureChooser.java @@ -164,7 +164,7 @@ public abstract class GStructureChooser extends JPanel implements toolTipText = getValueAt(rowIndex, colIndex).toString(); } catch (Exception e) { - e.printStackTrace(); + // e.printStackTrace(); } toolTipText = (toolTipText == null ? null : (toolTipText.length() > 500 ? JvSwingUtils.wrapTooltip( @@ -243,12 +243,13 @@ public abstract class GStructureChooser extends JPanel implements case KeyEvent.VK_TAB: // tab key if (evt.isShiftDown()) { - chk_invertFilter.requestFocus(); + pnl_filter.requestFocus(); } else { btn_view.requestFocus(); } + evt.consume(); break; default: return; @@ -293,9 +294,16 @@ public abstract class GStructureChooser extends JPanel implements } else { + if (btn_view.isEnabled()) + { btn_view.requestFocus(); + } + else + { + btn_cancel.requestFocus(); + } } - + evt.consume(); default: return; } diff --git a/src/jalview/ws/uimodel/PDBRestRequest.java b/src/jalview/ws/uimodel/PDBRestRequest.java index 5442b65..24f38d1 100644 --- a/src/jalview/ws/uimodel/PDBRestRequest.java +++ b/src/jalview/ws/uimodel/PDBRestRequest.java @@ -21,6 +21,7 @@ package jalview.ws.uimodel; +import jalview.bin.Cache; import jalview.datamodel.SequenceI; import jalview.ws.dbsources.PDBRestClient.PDBDocField; @@ -44,14 +45,14 @@ public class PDBRestRequest private boolean allowEmptySequence; - private boolean allowUnpublishedEntries; + private boolean allowUnpublishedEntries = Cache.getDefault( + "ALLOW_UNPUBLISHED_PDB_QUERYING", false); private int responseSize; private boolean isSortAscending; - private Collection wantedFields;// = new - // Collection(); + private Collection wantedFields; public String getFieldToSearchBy() { diff --git a/test/jalview/ws/dbsources/PDBRestClientTest.java b/test/jalview/ws/dbsources/PDBRestClientTest.java index 0005ba9..401f4c9 100644 --- a/test/jalview/ws/dbsources/PDBRestClientTest.java +++ b/test/jalview/ws/dbsources/PDBRestClientTest.java @@ -264,7 +264,7 @@ public class PDBRestClientTest if (pdbJsonDoc.get(field.getCode()) == null) { // System.out.println(">>>\t" + field.getCode()); - assertTrue(field.getClass() + assertTrue(field.getCode() + " has been removed from PDB doc Entity", !pdbJsonResponseString.contains(field.getCode())); }